Java 类java.nio.channels.AsynchronousChannel 实例源码

项目:mycat-src-1.6.1-RELEASE    文件:AbstractConnection.java   
public AbstractConnection(NetworkChannel channel) {
    this.channel = channel;
    boolean isAIO = (channel instanceof AsynchronousChannel);
    if (isAIO) {
        socketWR = new AIOSocketWR(this);
    } else {
        socketWR = new NIOSocketWR(this);
    }
    this.isClosed = new AtomicBoolean(false);
    this.startupTime = TimeUtil.currentTimeMillis();
    this.lastReadTime = startupTime;
    this.lastWriteTime = startupTime;
}
项目:dble    文件:AbstractConnection.java   
public AbstractConnection(NetworkChannel channel) {
    this.channel = channel;
    boolean isAIO = (channel instanceof AsynchronousChannel);
    if (isAIO) {
        socketWR = new AIOSocketWR(this);
    } else {
        socketWR = new NIOSocketWR(this);
    }
    this.isClosed = new AtomicBoolean(false);
    this.startupTime = TimeUtil.currentTimeMillis();
    this.lastReadTime = startupTime;
    this.lastWriteTime = startupTime;
}
项目:jephyr    文件:PendingFuture.java   
PendingFuture(AsynchronousChannel channel,
              CompletionHandler<V,? super A> handler,
              A attachment,
              Object context)
{
    this.channel = channel;
    this.handler = handler;
    this.attachment = attachment;
    this.context = context;
}
项目:jephyr    文件:PendingFuture.java   
PendingFuture(AsynchronousChannel channel,
              CompletionHandler<V,? super A> handler,
              A attachment)
{
    this.channel = channel;
    this.handler = handler;
    this.attachment = attachment;
}
项目:sonews    文件:SocketChannelWrapperFactory.java   
public SocketChannelWrapper create() {
    if(wrapier instanceof AsynchronousChannel) {
        return new AsyncSocketChannelWrapper((AsynchronousSocketChannel)wrapier);
    }

    if(wrapier instanceof SocketChannel) {
        return new SyncSocketChannelWrapper((SocketChannel)wrapier);
    }

    return null;
}
项目:jephyr    文件:PendingFuture.java   
PendingFuture(AsynchronousChannel channel) {
    this(channel, null, null);
}
项目:jephyr    文件:PendingFuture.java   
PendingFuture(AsynchronousChannel channel, Object context) {
    this(channel, null, null, context);
}
项目:jephyr    文件:PendingFuture.java   
AsynchronousChannel channel() {
    return channel;
}