资源简介
网络开发时,发现服务器一定时间会内存溢出,发现是SSLSocketImpl类初始化数量过多造成,终于在jdk7源代码中找到了jsse方面的源代码。
代码片段和文件信息
/*
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.oracle.net;
import java.net.Socket;
import java.net.ServerSocket;
import java.net.SocketImpl;
import java.net.SocketImplFactory;
import java.net.SocketException;
import java.nio.channels.SocketChannel;
import java.nio.channels.ServerSocketChannel;
import java.io.IOException;
import java.io.FileDescriptor;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.lang.reflect.Constructor;
import java.lang.reflect.Accessibleobject;
import java.lang.reflect.InvocationTargetException;
import sun.net.sdp.SdpSupport;
/**
* This class consists exclusively of static methods that Sockets or Channels to
* sockets that support the InfiniBand Sockets Direct Protocol (SDP).
*/
public final class Sdp {
private Sdp() { }
/**
* The package-privage ServerSocket(SocketImpl) constructor
*/
private static final Constructor serverSocketCtor;
static {
try {
serverSocketCtor = (Constructor)
ServerSocket.class.getDeclaredConstructor(SocketImpl.class);
setAccessible(serverSocketCtor);
} catch (NoSuchMethodException e) {
throw new Assertionerror(e);
}
}
/**
* The package-private SdpSocketImpl() constructor
*/
private static final Constructor socketImplCtor;
static {
try {
Class> cl = Class.forName(“java.net.SdpSocketImpl“ true null);
socketImplCtor = (Constructor)cl.getDeclaredConstructor();
setAccessible(socketImplCtor);
} catch (ClassNotFoundException e) {
throw new Assertionerror(e);
} catch (NoSuchMethodException e) {
throw new Assertionerror(e);
}
}
private static void setAccessible(final Accessibleobject o) {
AccessController.doPrivileged(new PrivilegedAction() {
public Void run() {
o.setAccessible(true);
return null;
}
});
}
/**
* SDP enabled Socket.
*/
private static class SdpSocket extends Socket {
SdpSocket(SocketImpl impl) throws SocketException {
super(impl);
}
}
/**
* Creates a SDP enabled SocketImpl
*/
private static SocketImpl createSocketImpl() {
try {
return socketImplCtor.newInstance();
} catch (InstantiationException x) {
throw new Assertionerror(x);
} catch (IllegalAccessException x) {
throw new Assertionerror(x);
} catch (InvocationTargetException x) {
throw new Assertionerror(x);
}
}
/**
* Creates an unconnected and unbound SDP socket. The {@code Socket} is
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-06-23 03:14 com\
目录 0 2012-06-23 03:14 com\oracle\
目录 0 2012-06-23 04:11 com\oracle\net\
文件 5943 2012-06-23 04:11 com\oracle\net\Sdp.java
目录 0 2012-06-23 03:18 com\sun\
目录 0 2012-06-23 03:06 com\sun\accessibility\
目录 0 2012-06-23 03:06 com\sun\accessibility\internal\
目录 0 2012-06-23 04:11 com\sun\accessibility\internal\resources\
文件 4365 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility.java
文件 4668 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility_de.java
文件 4318 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility_en.java
文件 4787 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility_es.java
文件 4967 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility_fr.java
文件 4774 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility_it.java
文件 6187 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility_ja.java
文件 5690 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility_ko.java
文件 4898 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility_pt_BR.java
文件 4575 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility_sv.java
文件 5159 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility_zh_CN.java
文件 5391 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility_zh_HK.java
文件 5391 2012-06-23 04:11 com\sun\accessibility\internal\resources\accessibility_zh_TW.java
目录 0 2012-06-23 03:15 com\sun\activation\
目录 0 2012-06-23 04:11 com\sun\activation\registries\
文件 1258 2012-06-23 04:11 com\sun\activation\registries\LogSupport.java
文件 21649 2012-06-23 04:11 com\sun\activation\registries\MailcapFile.java
文件 523 2012-06-23 04:11 com\sun\activation\registries\MailcapParseException.java
文件 9558 2012-06-23 04:11 com\sun\activation\registries\MailcapTokenizer.java
文件 721 2012-06-23 04:11 com\sun\activation\registries\MimeTypeEntry.java
文件 9191 2012-06-23 04:11 com\sun\activation\registries\MimeTypeFile.java
目录 0 2012-06-23 04:11 com\sun\awt\
文件 18874 2012-06-23 04:11 com\sun\awt\AWTUtilities.java
............此处省略16884个文件信息
- 上一篇:Ogre乒乓游戏
- 下一篇:Global Mapper v20.0 破解包
评论
共有 条评论