Class EmbeddedChannel
- java.lang.Object
-
- org.jboss.netty.channel.AbstractChannel
-
- org.jboss.netty.handler.codec.embedder.EmbeddedChannel
-
class EmbeddedChannel extends AbstractChannel
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
Fields Modifier and Type Field Description private ChannelConfig
config
private static java.lang.Integer
DUMMY_ID
private java.net.SocketAddress
localAddress
private java.net.SocketAddress
remoteAddress
-
Fields inherited from interface org.jboss.netty.channel.Channel
OP_NONE, OP_READ, OP_READ_WRITE, OP_WRITE
-
-
Constructor Summary
Constructors Constructor Description EmbeddedChannel(ChannelPipeline pipeline, ChannelSink sink)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChannelConfig
getConfig()
Returns the configuration of this channel.java.net.SocketAddress
getLocalAddress()
Returns the local address where this channel is bound to.java.net.SocketAddress
getRemoteAddress()
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
isConnected()
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 Detail
-
DUMMY_ID
private static final java.lang.Integer DUMMY_ID
-
config
private final ChannelConfig config
-
localAddress
private final java.net.SocketAddress localAddress
-
remoteAddress
private final java.net.SocketAddress remoteAddress
-
-
Constructor Detail
-
EmbeddedChannel
EmbeddedChannel(ChannelPipeline pipeline, ChannelSink sink)
-
-
Method Detail
-
getConfig
public ChannelConfig getConfig()
Description copied from interface:Channel
Returns the configuration of this channel.
-
getLocalAddress
public java.net.SocketAddress 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
public java.net.SocketAddress 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.
-
-