本文整理汇总了Java中sun.net.ResourceManager类的典型用法代码示例。如果您正苦于以下问题:Java ResourceManager类的具体用法?Java ResourceManager怎么用?Java ResourceManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResourceManager类属于sun.net包,在下文中一共展示了ResourceManager类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DatagramChannelImpl
import sun.net.ResourceManager; //导入依赖的package包/类
public DatagramChannelImpl(SelectorProvider sp)
throws IOException
{
super(sp);
ResourceManager.beforeUdpCreate();
try {
this.family = Net.isIPv6Available() ?
StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
this.fd = Net.socket(family, false);
this.fdVal = IOUtil.fdVal(fd);
this.state = ST_UNCONNECTED;
} catch (IOException ioe) {
ResourceManager.afterUdpClose();
throw ioe;
}
}
示例2: implCloseSelectableChannel
import sun.net.ResourceManager; //导入依赖的package包/类
protected void implCloseSelectableChannel() throws IOException {
synchronized (stateLock) {
if (state != ST_KILLED)
nd.preClose(fd);
ResourceManager.afterUdpClose();
// if member of mulitcast group then invalidate all keys
if (registry != null)
registry.invalidateAll();
long th;
if ((th = readerThread) != 0)
NativeThread.signal(th);
if ((th = writerThread) != 0)
NativeThread.signal(th);
if (!isRegistered())
kill();
}
}
示例3: create
import sun.net.ResourceManager; //导入依赖的package包/类
/**
* Creates a socket with a boolean that specifies whether this
* is a stream socket (true) or an unconnected UDP socket (false).
*/
protected synchronized void create(boolean stream) throws IOException {
this.stream = stream;
if (!stream) {
ResourceManager.beforeUdpCreate();
// only create the fd after we know we will be able to create the socket
fd = new FileDescriptor();
try {
socketCreate(false);
} catch (IOException ioe) {
ResourceManager.afterUdpClose();
fd = null;
throw ioe;
}
} else {
fd = new FileDescriptor();
socketCreate(true);
}
if (socket != null)
socket.setCreated();
if (serverSocket != null)
serverSocket.setCreated();
}
示例4: create
import sun.net.ResourceManager; //导入依赖的package包/类
/**
* Creates a socket with a boolean that specifies whether this
* is a stream socket (true) or an unconnected UDP socket (false).
*/
protected synchronized void create(boolean stream) throws IOException {
fd = new FileDescriptor();
this.stream = stream;
if (!stream) {
ResourceManager.beforeUdpCreate();
try {
socketCreate(false);
} catch (IOException ioe) {
ResourceManager.afterUdpClose();
fd = null;
throw ioe;
}
} else {
socketCreate(true);
}
if (socket != null)
socket.setCreated();
if (serverSocket != null)
serverSocket.setCreated();
}
示例5: implCloseSelectableChannel
import sun.net.ResourceManager; //导入依赖的package包/类
protected void implCloseSelectableChannel() throws IOException {
synchronized (stateLock) {
nd.preClose(fd);
ResourceManager.afterUdpClose();
// if member of mulitcast group then invalidate all keys
if (registry != null)
registry.invalidateAll();
long th;
if ((th = readerThread) != 0)
NativeThread.signal(th);
if ((th = writerThread) != 0)
NativeThread.signal(th);
if (!isRegistered())
kill();
}
}