当前位置: 首页>>代码示例>>Java>>正文


Java ResourceManager类代码示例

本文整理汇总了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;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:DatagramChannelImpl.java

示例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();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DatagramChannelImpl.java

示例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();
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:27,代码来源:AbstractPlainSocketImpl.java

示例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();
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:25,代码来源:AbstractPlainSocketImpl.java

示例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();
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:19,代码来源:DatagramChannelImpl.java


注:本文中的sun.net.ResourceManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。