XNIO API 3.1.0.Beta1

org.xnio.channels
Class AssembledConnectedMessageChannel

java.lang.Object
  extended by org.xnio.channels.AssembledMessageChannel
      extended by org.xnio.channels.AssembledConnectedMessageChannel
All Implemented Interfaces:
Closeable, Channel, InterruptibleChannel, BoundChannel, CloseableChannel, Configurable, ConnectedChannel, MessageChannel, ReadableMessageChannel, SuspendableChannel, SuspendableReadChannel, SuspendableWriteChannel, WritableMessageChannel

public class AssembledConnectedMessageChannel
extends AssembledMessageChannel
implements ConnectedChannel

A connected bidirectional message channel assembled from a readable and writable message channel.

Author:
David M. Lloyd

Constructor Summary
AssembledConnectedMessageChannel(ConnectedChannel connection, ReadableMessageChannel readable, WritableMessageChannel writable)
          Construct a new instance.
AssembledConnectedMessageChannel(ReadableMessageChannel readable, WritableMessageChannel writable)
          Construct a new instance.
 
Method Summary
 ChannelListener.Setter<? extends AssembledConnectedMessageChannel> getCloseSetter()
          Get the setter which can be used to change the close listener for this channel.
 SocketAddress getLocalAddress()
          Get the local address that this channel is bound to.
<A extends SocketAddress>
A
getLocalAddress(Class<A> type)
          Get the local address of a given type, or null if the address is not of that type.
 SocketAddress getPeerAddress()
          Get the peer address of this channel.
<A extends SocketAddress>
A
getPeerAddress(Class<A> type)
          Get the peer address of a given type, or null if the address is not of that type.
 ChannelListener.Setter<? extends AssembledConnectedMessageChannel> getReadSetter()
          Get the setter which can be used to change the read listener for this channel.
 ChannelListener.Setter<? extends AssembledConnectedMessageChannel> getWriteSetter()
          Get the setter which can be used to change the write listener for this channel.
 
Methods inherited from class org.xnio.channels.AssembledMessageChannel
awaitReadable, awaitReadable, awaitWritable, awaitWritable, close, flush, getOption, getReadThread, getWorker, getWriteThread, isOpen, isReadResumed, isWriteResumed, receive, receive, receive, resumeReads, resumeWrites, send, send, send, setOption, shutdownReads, shutdownWrites, supportsOption, suspendReads, suspendWrites, wakeupReads, wakeupWrites
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xnio.channels.CloseableChannel
close, getWorker
 
Methods inherited from interface java.nio.channels.Channel
isOpen
 
Methods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOption
 

Constructor Detail

AssembledConnectedMessageChannel

public AssembledConnectedMessageChannel(ConnectedChannel connection,
                                        ReadableMessageChannel readable,
                                        WritableMessageChannel writable)
Construct a new instance.

Parameters:
connection - the connected channel
readable - the read channel
writable - the write channel

AssembledConnectedMessageChannel

public AssembledConnectedMessageChannel(ReadableMessageChannel readable,
                                        WritableMessageChannel writable)
Construct a new instance. At least one side must be connected.

Parameters:
readable - the read channel
writable - the write channel
Method Detail

getCloseSetter

public ChannelListener.Setter<? extends AssembledConnectedMessageChannel> getCloseSetter()
Description copied from interface: MessageChannel
Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.

Specified by:
getCloseSetter in interface BoundChannel
Specified by:
getCloseSetter in interface CloseableChannel
Specified by:
getCloseSetter in interface ConnectedChannel
Specified by:
getCloseSetter in interface MessageChannel
Specified by:
getCloseSetter in interface ReadableMessageChannel
Specified by:
getCloseSetter in interface SuspendableChannel
Specified by:
getCloseSetter in interface SuspendableReadChannel
Specified by:
getCloseSetter in interface SuspendableWriteChannel
Specified by:
getCloseSetter in interface WritableMessageChannel
Overrides:
getCloseSetter in class AssembledMessageChannel
Returns:
the setter

getReadSetter

public ChannelListener.Setter<? extends AssembledConnectedMessageChannel> getReadSetter()
Description copied from interface: MessageChannel
Get the setter which can be used to change the read listener for this channel.

Specified by:
getReadSetter in interface MessageChannel
Specified by:
getReadSetter in interface ReadableMessageChannel
Specified by:
getReadSetter in interface SuspendableChannel
Specified by:
getReadSetter in interface SuspendableReadChannel
Overrides:
getReadSetter in class AssembledMessageChannel
Returns:
the setter

getWriteSetter

public ChannelListener.Setter<? extends AssembledConnectedMessageChannel> getWriteSetter()
Description copied from interface: MessageChannel
Get the setter which can be used to change the write listener for this channel.

Specified by:
getWriteSetter in interface MessageChannel
Specified by:
getWriteSetter in interface SuspendableChannel
Specified by:
getWriteSetter in interface SuspendableWriteChannel
Specified by:
getWriteSetter in interface WritableMessageChannel
Overrides:
getWriteSetter in class AssembledMessageChannel
Returns:
the setter

getPeerAddress

public SocketAddress getPeerAddress()
Description copied from interface: ConnectedChannel
Get the peer address of this channel.

Specified by:
getPeerAddress in interface ConnectedChannel
Returns:
the peer address

getPeerAddress

public <A extends SocketAddress> A getPeerAddress(Class<A> type)
Description copied from interface: ConnectedChannel
Get the peer address of a given type, or null if the address is not of that type.

Specified by:
getPeerAddress in interface ConnectedChannel
Parameters:
type - the address type class
Returns:
the peer address, or null if unknown

getLocalAddress

public SocketAddress getLocalAddress()
Description copied from interface: BoundChannel
Get the local address that this channel is bound to.

Specified by:
getLocalAddress in interface BoundChannel
Returns:
the local address

getLocalAddress

public <A extends SocketAddress> A getLocalAddress(Class<A> type)
Description copied from interface: BoundChannel
Get the local address of a given type, or null if the address is not of that type.

Specified by:
getLocalAddress in interface BoundChannel
Type Parameters:
A - the address type
Parameters:
type - the address type class
Returns:
the local address, or null if unknown

XNIO API 3.1.0.Beta1

Copyright © 2010 JBoss, a division of Red Hat, Inc.