org.jboss.netty.channel
Class Channels

java.lang.Object
  extended by org.jboss.netty.channel.Channels

public class Channels
extends Object

A helper class which provides various convenience methods related with Channel, ChannelHandler, and ChannelPipeline.

Factory methods

It is always recommended to use the factory methods provided by Channels rather than calling the constructor of the implementation types.

Upstream and downstream event generation

Various event generation methods are provided to simplify the generation of upstream events and downstream events. It is always recommended to use the event generation methods provided by Channels rather than calling ChannelHandlerContext.sendUpstream(ChannelEvent) or ChannelHandlerContext.sendDownstream(ChannelEvent) by yourself.

Version:
$Rev: 1706 $, $Date: 2009-09-03 13:33:15 +0900 (목, 03 9 2009) $
Author:
The Netty Project (netty-dev@lists.jboss.org), Trustin Lee (tlee@redhat.com)

Method Summary
static void bind(ChannelHandlerContext ctx, Channel channel, ChannelFuture future, SocketAddress localAddress)
          Deprecated. Use bind(ChannelHandlerContext, ChannelFuture, SocketAddress) instead. Sends a "bind" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static void bind(ChannelHandlerContext ctx, ChannelFuture future, SocketAddress localAddress)
          Sends a "bind" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static ChannelFuture bind(Channel channel, SocketAddress localAddress)
          Sends a "bind" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.
static ChannelFuture close(Channel channel)
          Sends a "close" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.
static void close(ChannelHandlerContext ctx, Channel channel, ChannelFuture future)
          Deprecated. Use close(ChannelHandlerContext, ChannelFuture) instead. Sends a "close" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static void close(ChannelHandlerContext ctx, ChannelFuture future)
          Sends a "close" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static void connect(ChannelHandlerContext ctx, Channel channel, ChannelFuture future, SocketAddress remoteAddress)
          Deprecated. Use connect(ChannelHandlerContext, ChannelFuture, SocketAddress) instead. Sends a "connect" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static void connect(ChannelHandlerContext ctx, ChannelFuture future, SocketAddress remoteAddress)
          Sends a "connect" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static ChannelFuture connect(Channel channel, SocketAddress remoteAddress)
          Sends a "connect" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.
static ChannelFuture disconnect(Channel channel)
          Sends a "disconnect" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.
static void disconnect(ChannelHandlerContext ctx, Channel channel, ChannelFuture future)
          Deprecated. Use disconnect(ChannelHandlerContext, ChannelFuture) instead. Sends a "disconnect" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static void disconnect(ChannelHandlerContext ctx, ChannelFuture future)
          Sends a "disconnect" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static ChannelFuture failedFuture(Channel channel, Throwable cause)
          Creates a new ChannelFuture which has failed already for the specified Channel.
static void fireChannelBound(ChannelHandlerContext ctx, Channel channel, SocketAddress localAddress)
          Deprecated. Use fireChannelBound(ChannelHandlerContext, SocketAddress) instead. Sends a "channelBound" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireChannelBound(ChannelHandlerContext ctx, SocketAddress localAddress)
          Sends a "channelBound" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireChannelBound(Channel channel, SocketAddress localAddress)
          Sends a "channelBound" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
static void fireChannelClosed(Channel channel)
          Sends a "channelClosed" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
static void fireChannelClosed(ChannelHandlerContext ctx)
          Sends a "channelClosed" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireChannelClosed(ChannelHandlerContext ctx, Channel channel)
          Deprecated. Use fireChannelClosed(ChannelHandlerContext). Sends a "channelClosed" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireChannelConnected(ChannelHandlerContext ctx, Channel channel, SocketAddress remoteAddress)
          Deprecated. Use fireChannelConnected(ChannelHandlerContext, SocketAddress) instead. Sends a "channelConnected" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireChannelConnected(ChannelHandlerContext ctx, SocketAddress remoteAddress)
          Sends a "channelConnected" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireChannelConnected(Channel channel, SocketAddress remoteAddress)
          Sends a "channelConnected" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
static void fireChannelDisconnected(Channel channel)
          Sends a "channelDisconnected" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
static void fireChannelDisconnected(ChannelHandlerContext ctx)
          Sends a "channelDisconnected" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireChannelDisconnected(ChannelHandlerContext ctx, Channel channel)
          Deprecated. Use fireChannelDisconnected(ChannelHandlerContext) instead. Sends a "channelDisconnected" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireChannelInterestChanged(Channel channel)
          Sends a "channelInterestChanged" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
static void fireChannelInterestChanged(ChannelHandlerContext ctx)
          Sends a "channelInterestChanged" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireChannelInterestChanged(ChannelHandlerContext ctx, Channel channel, int interestOps)
          Deprecated. Use fireChannelInterestChanged(ChannelHandlerContext) instead. Sends a "channelInterestChanged" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireChannelInterestChanged(Channel channel, int interestOps)
          Deprecated. Use fireChannelInterestChanged(Channel) instead. Sends a "channelInterestChanged" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
static void fireChannelOpen(Channel channel)
          Sends a "channelOpen" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
static void fireChannelOpen(ChannelHandlerContext ctx)
          Sends a "channelOpen" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireChannelOpen(ChannelHandlerContext ctx, Channel channel)
          Deprecated. Use fireChannelOpen(ChannelHandlerContext) instead. Sends a "channelOpen" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.

Please note that this method does not trigger a "childChannelOpen" event unlike fireChannelOpen(Channel) method.

static void fireChannelUnbound(Channel channel)
          Sends a "channelUnbound" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
static void fireChannelUnbound(ChannelHandlerContext ctx)
          Sends a "channelUnbound" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireChannelUnbound(ChannelHandlerContext ctx, Channel channel)
          Deprecated. Use fireChannelUnbound(ChannelHandlerContext) instead. Sends a "channelUnbound" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireExceptionCaught(ChannelHandlerContext ctx, Channel channel, Throwable cause)
          Deprecated. Use fireExceptionCaught(ChannelHandlerContext, Throwable) instead. Sends a "exceptionCaught" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireExceptionCaught(ChannelHandlerContext ctx, Throwable cause)
          Sends a "exceptionCaught" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireExceptionCaught(Channel channel, Throwable cause)
          Sends a "exceptionCaught" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
static void fireMessageReceived(ChannelHandlerContext ctx, Channel channel, Object message)
          Deprecated. Use fireMessageReceived(ChannelHandlerContext, Object) instead. Sends a "messageReceived" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireMessageReceived(ChannelHandlerContext ctx, Channel channel, Object message, SocketAddress remoteAddress)
          Deprecated. Use fireMessageReceived(ChannelHandlerContext, Object, SocketAddress) instead. Sends a "messageReceived" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireMessageReceived(ChannelHandlerContext ctx, Object message)
          Sends a "messageReceived" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireMessageReceived(ChannelHandlerContext ctx, Object message, SocketAddress remoteAddress)
          Sends a "messageReceived" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireMessageReceived(Channel channel, Object message)
          Sends a "messageReceived" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
static void fireMessageReceived(Channel channel, Object message, SocketAddress remoteAddress)
          Sends a "messageReceived" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel belongs.
static void fireWriteComplete(ChannelHandlerContext ctx, int amount)
          Sends a "writeComplete" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.
static void fireWriteComplete(Channel channel, int amount)
          Sends a "writeComplete" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
static ChannelFuture future(Channel channel)
          Creates a new non-cancellable ChannelFuture for the specified Channel.
static ChannelFuture future(Channel channel, boolean cancellable)
          Creates a new ChannelFuture for the specified Channel.
static MessageEvent messageEvent(Channel channel, ChannelFuture future, Object message)
          Deprecated. Instantiate UpstreamMessageEvent or DownstreamMessageEvent directly instead. Creates a new MessageEvent
static MessageEvent messageEvent(Channel channel, ChannelFuture future, Object message, SocketAddress remoteAddress)
          Deprecated. Instantiate UpstreamMessageEvent or DownstreamMessageEvent directly instead. Creates a new MessageEvent
static ChannelPipeline pipeline()
          Creates a new ChannelPipeline.
static ChannelPipeline pipeline(ChannelPipeline pipeline)
          Creates a new ChannelPipeline which contains the same entries with the specified pipeline.
static ChannelPipelineFactory pipelineFactory(ChannelPipeline pipeline)
          Creates a new ChannelPipelineFactory which creates a new ChannelPipeline which contains the same entries with the specified pipeline.
static void setInterestOps(ChannelHandlerContext ctx, Channel channel, ChannelFuture future, int interestOps)
          Deprecated. Use setInterestOps(ChannelHandlerContext, ChannelFuture, int) instead. Sends a "setInterestOps" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static void setInterestOps(ChannelHandlerContext ctx, ChannelFuture future, int interestOps)
          Sends a "setInterestOps" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static ChannelFuture setInterestOps(Channel channel, int interestOps)
          Sends a "setInterestOps" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.
static ChannelFuture succeededFuture(Channel channel)
          Creates a new ChannelFuture which is already succeeded for the specified Channel.
static ChannelFuture unbind(Channel channel)
          Sends a "unbind" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.
static void unbind(ChannelHandlerContext ctx, Channel channel, ChannelFuture future)
          Deprecated. Use unbind(ChannelHandlerContext, ChannelFuture) instead. Sends a "unbind" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static void unbind(ChannelHandlerContext ctx, ChannelFuture future)
          Sends a "unbind" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static void write(ChannelHandlerContext ctx, Channel channel, ChannelFuture future, Object message)
          Deprecated. Use write(ChannelHandlerContext, ChannelFuture, Object) instead. Sends a "write" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static void write(ChannelHandlerContext ctx, Channel channel, ChannelFuture future, Object message, SocketAddress remoteAddress)
          Deprecated. Use write(ChannelHandlerContext, ChannelFuture, Object, SocketAddress) instead. Sends a "write" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static void write(ChannelHandlerContext ctx, ChannelFuture future, Object message)
          Sends a "write" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static void write(ChannelHandlerContext ctx, ChannelFuture future, Object message, SocketAddress remoteAddress)
          Sends a "write" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.
static ChannelFuture write(Channel channel, Object message)
          Sends a "write" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.
static ChannelFuture write(Channel channel, Object message, SocketAddress remoteAddress)
          Sends a "write" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

pipeline

public static ChannelPipeline pipeline()
Creates a new ChannelPipeline.


pipeline

public static ChannelPipeline pipeline(ChannelPipeline pipeline)
Creates a new ChannelPipeline which contains the same entries with the specified pipeline. Please note that only the names and the references of the ChannelHandlers will be copied; a new ChannelHandler instance will never be created.


pipelineFactory

public static ChannelPipelineFactory pipelineFactory(ChannelPipeline pipeline)
Creates a new ChannelPipelineFactory which creates a new ChannelPipeline which contains the same entries with the specified pipeline. Please note that only the names and the references of the ChannelHandlers will be copied; a new ChannelHandler instance will never be created.


future

public static ChannelFuture future(Channel channel)
Creates a new non-cancellable ChannelFuture for the specified Channel.


future

public static ChannelFuture future(Channel channel,
                                   boolean cancellable)
Creates a new ChannelFuture for the specified Channel.

Parameters:
cancellable - true if and only if the returned future can be canceled by ChannelFuture.cancel()

succeededFuture

public static ChannelFuture succeededFuture(Channel channel)
Creates a new ChannelFuture which is already succeeded for the specified Channel.


failedFuture

public static ChannelFuture failedFuture(Channel channel,
                                         Throwable cause)
Creates a new ChannelFuture which has failed already for the specified Channel.

Parameters:
cause - the cause of the failure

messageEvent

@Deprecated
public static MessageEvent messageEvent(Channel channel,
                                                   ChannelFuture future,
                                                   Object message)
Deprecated. Instantiate UpstreamMessageEvent or DownstreamMessageEvent directly instead. Creates a new MessageEvent

Parameters:
channel - the channel which is associated with the event
future - the future which will be notified when a message is sent (only meaningful when the event is sent downstream)
message - the received or sent message object ('received' when the event is sent upstream, and 'sent' when the event is sent downstream)

messageEvent

@Deprecated
public static MessageEvent messageEvent(Channel channel,
                                                   ChannelFuture future,
                                                   Object message,
                                                   SocketAddress remoteAddress)
Deprecated. Instantiate UpstreamMessageEvent or DownstreamMessageEvent directly instead. Creates a new MessageEvent

Parameters:
channel - the channel which is associated with the event
future - the future which will be notified when a message is sent (only meaningful when the event is sent downstream)
message - the received or sent message object ('received' when the event is sent upstream, and 'sent' when the event is sent downstream)
remoteAddress - the source or destination address of the message ('source' when the event is sent upstream, and 'destination' when the event is sent downstream)

fireChannelOpen

public static void fireChannelOpen(Channel channel)
Sends a "channelOpen" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel. If the specified channel has a parent, a "childChannelOpen" event will be sent, too.


fireChannelOpen

public static void fireChannelOpen(ChannelHandlerContext ctx)
Sends a "channelOpen" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.

Please note that this method does not trigger a "childChannelOpen" event unlike fireChannelOpen(Channel) method.


fireChannelOpen

@Deprecated
public static void fireChannelOpen(ChannelHandlerContext ctx,
                                              Channel channel)
Deprecated. Use fireChannelOpen(ChannelHandlerContext) instead. Sends a "channelOpen" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.

Please note that this method does not trigger a "childChannelOpen" event unlike fireChannelOpen(Channel) method.


fireChannelBound

public static void fireChannelBound(Channel channel,
                                    SocketAddress localAddress)
Sends a "channelBound" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.

Parameters:
localAddress - the local address where the specified channel is bound

fireChannelBound

public static void fireChannelBound(ChannelHandlerContext ctx,
                                    SocketAddress localAddress)
Sends a "channelBound" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
localAddress - the local address where the specified channel is bound

fireChannelBound

@Deprecated
public static void fireChannelBound(ChannelHandlerContext ctx,
                                               Channel channel,
                                               SocketAddress localAddress)
Deprecated. Use fireChannelBound(ChannelHandlerContext, SocketAddress) instead. Sends a "channelBound" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
localAddress - the local address where the specified channel is bound

fireChannelConnected

public static void fireChannelConnected(Channel channel,
                                        SocketAddress remoteAddress)
Sends a "channelConnected" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.

Parameters:
remoteAddress - the remote address where the specified channel is connected

fireChannelConnected

public static void fireChannelConnected(ChannelHandlerContext ctx,
                                        SocketAddress remoteAddress)
Sends a "channelConnected" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
remoteAddress - the remote address where the specified channel is connected

fireChannelConnected

@Deprecated
public static void fireChannelConnected(ChannelHandlerContext ctx,
                                                   Channel channel,
                                                   SocketAddress remoteAddress)
Deprecated. Use fireChannelConnected(ChannelHandlerContext, SocketAddress) instead. Sends a "channelConnected" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
remoteAddress - the remote address where the specified channel is connected

fireMessageReceived

public static void fireMessageReceived(Channel channel,
                                       Object message)
Sends a "messageReceived" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.

Parameters:
message - the received message

fireMessageReceived

public static void fireMessageReceived(Channel channel,
                                       Object message,
                                       SocketAddress remoteAddress)
Sends a "messageReceived" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel belongs.

Parameters:
message - the received message
remoteAddress - the remote address where the received message came from

fireMessageReceived

public static void fireMessageReceived(ChannelHandlerContext ctx,
                                       Object message)
Sends a "messageReceived" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
message - the received message

fireMessageReceived

@Deprecated
public static void fireMessageReceived(ChannelHandlerContext ctx,
                                                  Channel channel,
                                                  Object message)
Deprecated. Use fireMessageReceived(ChannelHandlerContext, Object) instead. Sends a "messageReceived" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
message - the received message

fireMessageReceived

public static void fireMessageReceived(ChannelHandlerContext ctx,
                                       Object message,
                                       SocketAddress remoteAddress)
Sends a "messageReceived" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
message - the received message
remoteAddress - the remote address where the received message came from

fireMessageReceived

@Deprecated
public static void fireMessageReceived(ChannelHandlerContext ctx,
                                                  Channel channel,
                                                  Object message,
                                                  SocketAddress remoteAddress)
Deprecated. Use fireMessageReceived(ChannelHandlerContext, Object, SocketAddress) instead. Sends a "messageReceived" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
message - the received message
remoteAddress - the remote address where the received message came from

fireWriteComplete

public static void fireWriteComplete(Channel channel,
                                     int amount)
Sends a "writeComplete" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.


fireWriteComplete

public static void fireWriteComplete(ChannelHandlerContext ctx,
                                     int amount)
Sends a "writeComplete" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.


fireChannelInterestChanged

public static void fireChannelInterestChanged(Channel channel)
Sends a "channelInterestChanged" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.


fireChannelInterestChanged

@Deprecated
public static void fireChannelInterestChanged(Channel channel,
                                                         int interestOps)
Deprecated. Use fireChannelInterestChanged(Channel) instead. Sends a "channelInterestChanged" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.

Parameters:
interestOps - the new interestOps

fireChannelInterestChanged

public static void fireChannelInterestChanged(ChannelHandlerContext ctx)
Sends a "channelInterestChanged" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.


fireChannelInterestChanged

@Deprecated
public static void fireChannelInterestChanged(ChannelHandlerContext ctx,
                                                         Channel channel,
                                                         int interestOps)
Deprecated. Use fireChannelInterestChanged(ChannelHandlerContext) instead. Sends a "channelInterestChanged" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
channel - the Channel
interestOps - the new interestOps

fireChannelDisconnected

public static void fireChannelDisconnected(Channel channel)
Sends a "channelDisconnected" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.


fireChannelDisconnected

public static void fireChannelDisconnected(ChannelHandlerContext ctx)
Sends a "channelDisconnected" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.


fireChannelDisconnected

@Deprecated
public static void fireChannelDisconnected(ChannelHandlerContext ctx,
                                                      Channel channel)
Deprecated. Use fireChannelDisconnected(ChannelHandlerContext) instead. Sends a "channelDisconnected" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.


fireChannelUnbound

public static void fireChannelUnbound(Channel channel)
Sends a "channelUnbound" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.


fireChannelUnbound

public static void fireChannelUnbound(ChannelHandlerContext ctx)
Sends a "channelUnbound" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.


fireChannelUnbound

@Deprecated
public static void fireChannelUnbound(ChannelHandlerContext ctx,
                                                 Channel channel)
Deprecated. Use fireChannelUnbound(ChannelHandlerContext) instead. Sends a "channelUnbound" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.


fireChannelClosed

public static void fireChannelClosed(Channel channel)
Sends a "channelClosed" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.


fireChannelClosed

public static void fireChannelClosed(ChannelHandlerContext ctx)
Sends a "channelClosed" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.


fireChannelClosed

@Deprecated
public static void fireChannelClosed(ChannelHandlerContext ctx,
                                                Channel channel)
Deprecated. Use fireChannelClosed(ChannelHandlerContext). Sends a "channelClosed" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.


fireExceptionCaught

public static void fireExceptionCaught(Channel channel,
                                       Throwable cause)
Sends a "exceptionCaught" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.


fireExceptionCaught

public static void fireExceptionCaught(ChannelHandlerContext ctx,
                                       Throwable cause)
Sends a "exceptionCaught" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.


fireExceptionCaught

@Deprecated
public static void fireExceptionCaught(ChannelHandlerContext ctx,
                                                  Channel channel,
                                                  Throwable cause)
Deprecated. Use fireExceptionCaught(ChannelHandlerContext, Throwable) instead. Sends a "exceptionCaught" event to the ChannelUpstreamHandler which is placed in the closest upstream from the handler associated with the specified ChannelHandlerContext.


bind

public static ChannelFuture bind(Channel channel,
                                 SocketAddress localAddress)
Sends a "bind" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.

Parameters:
channel - the channel to bind
localAddress - the local address to bind to
Returns:
the ChannelFuture which will be notified when the bind operation is done

bind

public static void bind(ChannelHandlerContext ctx,
                        ChannelFuture future,
                        SocketAddress localAddress)
Sends a "bind" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
future - the future which will be notified when the bind operation is done
localAddress - the local address to bind to

bind

@Deprecated
public static void bind(ChannelHandlerContext ctx,
                                   Channel channel,
                                   ChannelFuture future,
                                   SocketAddress localAddress)
Deprecated. Use bind(ChannelHandlerContext, ChannelFuture, SocketAddress) instead. Sends a "bind" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
channel - the channel to bind
future - the future which will be notified when the bind operation is done
localAddress - the local address to bind to

unbind

public static void unbind(ChannelHandlerContext ctx,
                          ChannelFuture future)
Sends a "unbind" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
future - the future which will be notified when the unbind operation is done

unbind

@Deprecated
public static void unbind(ChannelHandlerContext ctx,
                                     Channel channel,
                                     ChannelFuture future)
Deprecated. Use unbind(ChannelHandlerContext, ChannelFuture) instead. Sends a "unbind" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
channel - the channel to unbind
future - the future which will be notified when the unbind operation is done

unbind

public static ChannelFuture unbind(Channel channel)
Sends a "unbind" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.

Parameters:
channel - the channel to unbind
Returns:
the ChannelFuture which will be notified when the unbind operation is done

connect

public static ChannelFuture connect(Channel channel,
                                    SocketAddress remoteAddress)
Sends a "connect" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.

Parameters:
channel - the channel to attempt a connection
remoteAddress - the remote address to connect to
Returns:
the ChannelFuture which will be notified when the connection attempt is done

connect

public static void connect(ChannelHandlerContext ctx,
                           ChannelFuture future,
                           SocketAddress remoteAddress)
Sends a "connect" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
future - the future which will be notified when the connection attempt is done
remoteAddress - the remote address to connect to

connect

@Deprecated
public static void connect(ChannelHandlerContext ctx,
                                      Channel channel,
                                      ChannelFuture future,
                                      SocketAddress remoteAddress)
Deprecated. Use connect(ChannelHandlerContext, ChannelFuture, SocketAddress) instead. Sends a "connect" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
channel - the channel to attempt a connection
future - the future which will be notified when the connection attempt is done
remoteAddress - the remote address to connect to

write

public static ChannelFuture write(Channel channel,
                                  Object message)
Sends a "write" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.

Parameters:
channel - the channel to write a message
message - the message to write to the channel
Returns:
the ChannelFuture which will be notified when the write operation is done

write

public static void write(ChannelHandlerContext ctx,
                         ChannelFuture future,
                         Object message)
Sends a "write" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
future - the future which will be notified when the write operation is done

write

@Deprecated
public static void write(ChannelHandlerContext ctx,
                                    Channel channel,
                                    ChannelFuture future,
                                    Object message)
Deprecated. Use write(ChannelHandlerContext, ChannelFuture, Object) instead. Sends a "write" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
channel - the channel to write a message
future - the future which will be notified when the write operation is done

write

public static ChannelFuture write(Channel channel,
                                  Object message,
                                  SocketAddress remoteAddress)
Sends a "write" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.

Parameters:
channel - the channel to write a message
message - the message to write to the channel
remoteAddress - the destination of the message. null to use the default remote address
Returns:
the ChannelFuture which will be notified when the write operation is done

write

public static void write(ChannelHandlerContext ctx,
                         ChannelFuture future,
                         Object message,
                         SocketAddress remoteAddress)
Sends a "write" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
future - the future which will be notified when the write operation is done
message - the message to write to the channel
remoteAddress - the destination of the message. null to use the default remote address.

write

@Deprecated
public static void write(ChannelHandlerContext ctx,
                                    Channel channel,
                                    ChannelFuture future,
                                    Object message,
                                    SocketAddress remoteAddress)
Deprecated. Use write(ChannelHandlerContext, ChannelFuture, Object, SocketAddress) instead. Sends a "write" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
channel - the channel to write a message
future - the future which will be notified when the write operation is done
message - the message to write to the channel
remoteAddress - the destination of the message. null to use the default remote address.

setInterestOps

public static ChannelFuture setInterestOps(Channel channel,
                                           int interestOps)
Sends a "setInterestOps" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.

Parameters:
channel - the channel to change its interestOps
interestOps - the new interestOps
Returns:
the ChannelFuture which will be notified when the interestOps is changed

setInterestOps

public static void setInterestOps(ChannelHandlerContext ctx,
                                  ChannelFuture future,
                                  int interestOps)
Sends a "setInterestOps" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
future - the future which will be notified when the interestOps is changed.

setInterestOps

@Deprecated
public static void setInterestOps(ChannelHandlerContext ctx,
                                             Channel channel,
                                             ChannelFuture future,
                                             int interestOps)
Deprecated. Use setInterestOps(ChannelHandlerContext, ChannelFuture, int) instead. Sends a "setInterestOps" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
channel - the channel to change the interestOps
future - the future which will be notified when the interestOps is changed.

disconnect

public static ChannelFuture disconnect(Channel channel)
Sends a "disconnect" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.

Parameters:
channel - the channel to disconnect
Returns:
the ChannelFuture which will be notified on disconnection

disconnect

public static void disconnect(ChannelHandlerContext ctx,
                              ChannelFuture future)
Sends a "disconnect" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
future - the future which will be notified on disconnection

disconnect

@Deprecated
public static void disconnect(ChannelHandlerContext ctx,
                                         Channel channel,
                                         ChannelFuture future)
Deprecated. Use disconnect(ChannelHandlerContext, ChannelFuture) instead. Sends a "disconnect" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
channel - the channel to disconnect
future - the future which will be notified on disconnection

close

public static ChannelFuture close(Channel channel)
Sends a "close" request to the last ChannelDownstreamHandler in the ChannelPipeline of the specified Channel.

Parameters:
channel - the channel to close
Returns:
the ChannelFuture which will be notified on closure

close

public static void close(ChannelHandlerContext ctx,
                         ChannelFuture future)
Sends a "close" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
future - the future which will be notified on closure

close

@Deprecated
public static void close(ChannelHandlerContext ctx,
                                    Channel channel,
                                    ChannelFuture future)
Deprecated. Use close(ChannelHandlerContext, ChannelFuture) instead. Sends a "close" request to the ChannelDownstreamHandler which is placed in the closest downstream from the handler associated with the specified ChannelHandlerContext.

Parameters:
ctx - the context
channel - the channel to close
future - the future which will be notified on closure


Copyright © 2008-2009 JBoss, by Red Hat. All Rights Reserved.