abstract class AbstractNioChannel<C extends java.nio.channels.SelectableChannel & java.nio.channels.WritableByteChannel> extends AbstractChannel
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
AbstractNioChannel.WriteRequestQueue |
private class |
AbstractNioChannel.WriteTask |
| Modifier and Type | Field and Description |
|---|---|
(package private) C |
channel |
(package private) SocketSendBufferPool.SendBuffer |
currentWriteBuffer |
(package private) MessageEvent |
currentWriteEvent
The current write
MessageEvent |
(package private) java.util.concurrent.atomic.AtomicInteger |
highWaterMarkCounter
Keeps track of the highWaterMark.
|
(package private) boolean |
inWriteNowLoop
Boolean that indicates that write operation is in progress.
|
private java.net.InetSocketAddress |
localAddress |
(package private) java.net.InetSocketAddress |
remoteAddress |
(package private) AbstractNioWorker |
worker
The
AbstractNioWorker. |
(package private) AbstractNioChannel.WriteRequestQueue |
writeBufferQueue
Queue of write
MessageEvents. |
(package private) java.util.concurrent.atomic.AtomicInteger |
writeBufferSize
Keeps track of the number of bytes that the
AbstractNioChannel.WriteRequestQueue currently
contains. |
(package private) java.lang.Object |
writeLock
Monitor object for synchronizing access to the
AbstractNioChannel.WriteRequestQueue. |
(package private) boolean |
writeSuspended |
(package private) java.lang.Runnable |
writeTask
WriteTask that performs write operations.
|
(package private) java.util.concurrent.atomic.AtomicBoolean |
writeTaskInTaskQueue
Indicates if there is a
AbstractNioChannel.WriteTask in the task queue. |
OP_NONE, OP_READ, OP_READ_WRITE, OP_WRITE| Modifier | Constructor and Description |
|---|---|
protected |
AbstractNioChannel(Channel parent,
ChannelFactory factory,
ChannelPipeline pipeline,
ChannelSink sink,
AbstractNioWorker worker,
C ch) |
protected |
AbstractNioChannel(java.lang.Integer id,
Channel parent,
ChannelFactory factory,
ChannelPipeline pipeline,
ChannelSink sink,
AbstractNioWorker worker,
C ch) |
| Modifier and Type | Method and Description |
|---|---|
abstract NioChannelConfig |
getConfig()
Returns the configuration of this channel.
|
protected int |
getInternalInterestOps() |
java.net.InetSocketAddress |
getLocalAddress()
Returns the local address where this channel is bound to.
|
(package private) abstract java.net.InetSocketAddress |
getLocalSocketAddress() |
java.net.InetSocketAddress |
getRemoteAddress()
Returns the remote address where this channel is connected to.
|
(package private) abstract java.net.InetSocketAddress |
getRemoteSocketAddress() |
AbstractNioWorker |
getWorker()
Return the
AbstractNioWorker that handle the IO of the
AbstractNioChannel |
protected boolean |
setClosed()
Marks this channel as closed.
|
protected void |
setInternalInterestOps(int interestOps)
Sets the
interestOps property of this channel
immediately. |
bind, close, compareTo, connect, disconnect, equals, getAttachment, getCloseFuture, getFactory, getId, getInterestOps, getParent, getPipeline, getSucceededFuture, getUnsupportedOperationFuture, getUserDefinedWritability, hashCode, isOpen, isReadable, isWritable, setAttachment, setInterestOps, setReadable, setUnwritable, setUserDefinedWritability, setWritable, toString, unbind, write, writeclone, finalize, getClass, notify, notifyAll, wait, wait, waitisBound, isConnectedfinal AbstractNioWorker worker
AbstractNioWorker.final java.lang.Object writeLock
AbstractNioChannel.WriteRequestQueue.final java.lang.Runnable writeTask
final java.util.concurrent.atomic.AtomicBoolean writeTaskInTaskQueue
AbstractNioChannel.WriteTask in the task queue.final AbstractNioChannel.WriteRequestQueue writeBufferQueue
MessageEvents.final java.util.concurrent.atomic.AtomicInteger writeBufferSize
AbstractNioChannel.WriteRequestQueue currently
contains.final java.util.concurrent.atomic.AtomicInteger highWaterMarkCounter
MessageEvent currentWriteEvent
MessageEventSocketSendBufferPool.SendBuffer currentWriteBuffer
boolean inWriteNowLoop
boolean writeSuspended
private volatile java.net.InetSocketAddress localAddress
volatile java.net.InetSocketAddress remoteAddress
final C extends java.nio.channels.SelectableChannel & java.nio.channels.WritableByteChannel channel
protected AbstractNioChannel(java.lang.Integer id,
Channel parent,
ChannelFactory factory,
ChannelPipeline pipeline,
ChannelSink sink,
AbstractNioWorker worker,
C ch)
protected AbstractNioChannel(Channel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, AbstractNioWorker worker, C ch)
public AbstractNioWorker getWorker()
AbstractNioWorker that handle the IO of the
AbstractNioChannelpublic java.net.InetSocketAddress getLocalAddress()
ChannelSocketAddress is supposed to be down-cast into more concrete
type such as InetSocketAddress to retrieve the detailed
information.null if this channel is not bound.public java.net.InetSocketAddress getRemoteAddress()
ChannelSocketAddress is supposed to be down-cast into more
concrete type such as InetSocketAddress to retrieve the detailed
information.null if this channel is not connected.
If this channel is not connected but it can receive messages
from arbitrary remote addresses (e.g. DatagramChannel,
use MessageEvent.getRemoteAddress() to determine
the origination of the received message as this method will
return null.public abstract NioChannelConfig getConfig()
Channelprotected int getInternalInterestOps()
getInternalInterestOps in class AbstractChannelprotected void setInternalInterestOps(int interestOps)
AbstractChannelinterestOps property of this channel
immediately. This method is intended to be called by an internal
component - please do not call it unless you know what you are doing.setInternalInterestOps in class AbstractChannelprotected boolean setClosed()
AbstractChannelsetClosed in class AbstractChanneltrue if and only if this channel was not marked as
closed yetabstract java.net.InetSocketAddress getLocalSocketAddress()
throws java.lang.Exception
java.lang.Exceptionabstract java.net.InetSocketAddress getRemoteSocketAddress()
throws java.lang.Exception
java.lang.Exception