final class DefaultLocalChannel extends AbstractChannel implements LocalChannel
| Modifier and Type | Field and Description |
|---|---|
private ChannelConfig |
config |
private ThreadLocalBoolean |
delivering |
(package private) LocalAddress |
localAddress |
(package private) DefaultLocalChannel |
pairedChannel |
(package private) LocalAddress |
remoteAddress |
private static int |
ST_BOUND |
private static int |
ST_CLOSED |
private static int |
ST_CONNECTED |
private static int |
ST_OPEN |
(package private) java.util.concurrent.atomic.AtomicInteger |
state |
(package private) java.util.Queue<MessageEvent> |
writeBuffer |
OP_NONE, OP_READ, OP_READ_WRITE, OP_WRITE| Constructor and Description |
|---|
DefaultLocalChannel(LocalServerChannel parent,
ChannelFactory factory,
ChannelPipeline pipeline,
ChannelSink sink,
DefaultLocalChannel pairedChannel) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
closeNow(ChannelFuture future) |
(package private) void |
flushWriteBuffer() |
ChannelConfig |
getConfig()
Returns the configuration of this channel.
|
LocalAddress |
getLocalAddress()
Returns the local address where this channel is bound to.
|
LocalAddress |
getRemoteAddress()
Returns the remote address where this channel is connected to.
|
boolean |
isBound()
Returns
true if and only if this channel is bound to a
local address. |
boolean |
isConnected()
Returns
true if and only if this channel is connected to a
remote address. |
boolean |
isOpen()
Returns
true if and only if this channel is open. |
(package private) void |
setBound() |
protected boolean |
setClosed()
Marks this channel as closed.
|
(package private) void |
setConnected() |
bind, close, compareTo, connect, disconnect, equals, getAttachment, getCloseFuture, getFactory, getId, getInterestOps, getInternalInterestOps, getParent, getPipeline, getSucceededFuture, getUnsupportedOperationFuture, getUserDefinedWritability, hashCode, isReadable, isWritable, setAttachment, setInterestOps, setInternalInterestOps, setReadable, setUnwritable, setUserDefinedWritability, setWritable, toString, unbind, write, writeclone, finalize, getClass, notify, notifyAll, wait, wait, waitbind, close, connect, disconnect, getAttachment, getCloseFuture, getFactory, getId, getInterestOps, getParent, getPipeline, getUserDefinedWritability, isReadable, isWritable, setAttachment, setInterestOps, setReadable, setUserDefinedWritability, unbind, write, writeprivate static final int ST_OPEN
private static final int ST_BOUND
private static final int ST_CONNECTED
private static final int ST_CLOSED
final java.util.concurrent.atomic.AtomicInteger state
private final ChannelConfig config
private final ThreadLocalBoolean delivering
final java.util.Queue<MessageEvent> writeBuffer
volatile DefaultLocalChannel pairedChannel
volatile LocalAddress localAddress
volatile LocalAddress remoteAddress
DefaultLocalChannel(LocalServerChannel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, DefaultLocalChannel pairedChannel)
public ChannelConfig getConfig()
Channelpublic boolean isOpen()
Channeltrue if and only if this channel is open.isOpen in interface ChannelisOpen in class AbstractChannelpublic boolean isBound()
Channeltrue if and only if this channel is bound to a
local address.public boolean isConnected()
Channeltrue if and only if this channel is connected to a
remote address.isConnected in interface Channelvoid setBound()
throws java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelExceptionvoid setConnected()
protected boolean setClosed()
AbstractChannelsetClosed in class AbstractChanneltrue if and only if this channel was not marked as
closed yetpublic LocalAddress getLocalAddress()
ChannelSocketAddress is supposed to be down-cast into more concrete
type such as InetSocketAddress to retrieve the detailed
information.getLocalAddress in interface ChannelgetLocalAddress in interface LocalChannelnull if this channel is not bound.public LocalAddress getRemoteAddress()
ChannelSocketAddress is supposed to be down-cast into more
concrete type such as InetSocketAddress to retrieve the detailed
information.getRemoteAddress in interface ChannelgetRemoteAddress in interface LocalChannelnull 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.void closeNow(ChannelFuture future)
void flushWriteBuffer()