Class EmbeddedChannel
java.lang.Object
org.jboss.netty.channel.AbstractChannel
org.jboss.netty.handler.codec.embedder.EmbeddedChannel
- All Implemented Interfaces:
Comparable<Channel>
,Channel
TODO Make EmbeddedChannel implement ChannelConfig and ChannelSink to reduce overhead.
TODO Do not extend AbstractChannel to reduce overhead and remove the internal-use-only
constructor in AbstractChannel.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChannelConfig
private static final Integer
private final SocketAddress
private final SocketAddress
Fields inherited from interface org.jboss.netty.channel.Channel
OP_NONE, OP_READ, OP_READ_WRITE, OP_WRITE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the configuration of this channel.Returns the local address where this channel is bound to.Returns the remote address where this channel is connected to.boolean
isBound()
Returnstrue
if and only if this channel is bound to a local address.boolean
Returnstrue
if and only if this channel is connected to a remote address.Methods inherited from class org.jboss.netty.channel.AbstractChannel
bind, close, compareTo, connect, disconnect, equals, getAttachment, getCloseFuture, getFactory, getId, getInterestOps, getInternalInterestOps, getParent, getPipeline, getSucceededFuture, getUnsupportedOperationFuture, getUserDefinedWritability, hashCode, isOpen, isReadable, isWritable, setAttachment, setClosed, setInterestOps, setInternalInterestOps, setReadable, setUnwritable, setUserDefinedWritability, setWritable, toString, unbind, write, write
-
Field Details
-
DUMMY_ID
-
config
-
localAddress
-
remoteAddress
-
-
Constructor Details
-
EmbeddedChannel
EmbeddedChannel(ChannelPipeline pipeline, ChannelSink sink)
-
-
Method Details
-
getConfig
Description copied from interface:Channel
Returns the configuration of this channel. -
getLocalAddress
Description copied from interface:Channel
Returns the local address where this channel is bound to. The returnedSocketAddress
is supposed to be down-cast into more concrete type such asInetSocketAddress
to retrieve the detailed information.- Returns:
- the local address of this channel.
null
if this channel is not bound.
-
getRemoteAddress
Description copied from interface:Channel
Returns the remote address where this channel is connected to. The returnedSocketAddress
is supposed to be down-cast into more concrete type such asInetSocketAddress
to retrieve the detailed information.- Returns:
- the remote address of this channel.
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
, useMessageEvent.getRemoteAddress()
to determine the origination of the received message as this method will returnnull
.
-
isBound
public boolean isBound()Description copied from interface:Channel
Returnstrue
if and only if this channel is bound to a local address. -
isConnected
public boolean isConnected()Description copied from interface:Channel
Returnstrue
if and only if this channel is connected to a remote address.
-