Package org.xnio.channels
Class AssembledConnectedMessageChannel
java.lang.Object
org.xnio.channels.AssembledMessageChannel
org.xnio.channels.AssembledConnectedMessageChannel
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,InterruptibleChannel,BoundChannel,CloseableChannel,Configurable,ConnectedChannel,ConnectedMessageChannel,MessageChannel,ReadableMessageChannel,SuspendableChannel,SuspendableReadChannel,SuspendableWriteChannel,WritableMessageChannel
public class AssembledConnectedMessageChannel
extends AssembledMessageChannel
implements ConnectedMessageChannel
A connected bidirectional message channel assembled from a readable and writable message channel.
- Author:
- David M. Lloyd
-
Field Summary
Fields inherited from interface org.xnio.channels.Configurable
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionAssembledConnectedMessageChannel(ConnectedChannel connection, ReadableMessageChannel readable, WritableMessageChannel writable) Construct a new instance.AssembledConnectedMessageChannel(ReadableMessageChannel readable, WritableMessageChannel writable) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionGet the setter which can be used to change the close listener for this channel.Get the local address that this channel is bound to.<A extends SocketAddress>
AgetLocalAddress(Class<A> type) Get the local address of a given type, ornullif the address is not of that type.Get the peer address of this channel.<A extends SocketAddress>
AgetPeerAddress(Class<A> type) Get the peer address of a given type, ornullif the address is not of that type.Get the setter which can be used to change the read listener for this channel.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, getIoThread, getOption, getReadThread, getWorker, getWriteThread, isOpen, isReadResumed, isWriteResumed, receive, receive, receive, resumeReads, resumeWrites, send, send, send, sendFinal, sendFinal, sendFinal, setOption, shutdownReads, shutdownWrites, supportsOption, suspendReads, suspendWrites, wakeupReads, wakeupWritesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xnio.channels.CloseableChannel
getIoThread, getWorkerMethods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOptionMethods inherited from interface org.xnio.channels.ReadableMessageChannel
receive, receive, receiveMethods inherited from interface org.xnio.channels.SuspendableReadChannel
awaitReadable, awaitReadable, getReadThread, isReadResumed, resumeReads, shutdownReads, suspendReads, wakeupReadsMethods inherited from interface org.xnio.channels.SuspendableWriteChannel
awaitWritable, awaitWritable, close, flush, getWriteThread, isOpen, isWriteResumed, resumeWrites, shutdownWrites, suspendWrites, wakeupWrites
-
Constructor Details
-
AssembledConnectedMessageChannel
public AssembledConnectedMessageChannel(ConnectedChannel connection, ReadableMessageChannel readable, WritableMessageChannel writable) Construct a new instance.- Parameters:
connection- the connected channelreadable- the read channelwritable- 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 channelwritable- the write channel
-
-
Method Details
-
getCloseSetter
Description copied from interface:MessageChannelGet 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:
getCloseSetterin interfaceBoundChannel- Specified by:
getCloseSetterin interfaceCloseableChannel- Specified by:
getCloseSetterin interfaceConnectedChannel- Specified by:
getCloseSetterin interfaceConnectedMessageChannel- Specified by:
getCloseSetterin interfaceMessageChannel- Specified by:
getCloseSetterin interfaceReadableMessageChannel- Specified by:
getCloseSetterin interfaceSuspendableChannel- Specified by:
getCloseSetterin interfaceSuspendableReadChannel- Specified by:
getCloseSetterin interfaceSuspendableWriteChannel- Specified by:
getCloseSetterin interfaceWritableMessageChannel- Overrides:
getCloseSetterin classAssembledMessageChannel- Returns:
- the setter
-
getReadSetter
Description copied from interface:MessageChannelGet the setter which can be used to change the read listener for this channel.- Specified by:
getReadSetterin interfaceConnectedMessageChannel- Specified by:
getReadSetterin interfaceMessageChannel- Specified by:
getReadSetterin interfaceReadableMessageChannel- Specified by:
getReadSetterin interfaceSuspendableChannel- Specified by:
getReadSetterin interfaceSuspendableReadChannel- Overrides:
getReadSetterin classAssembledMessageChannel- Returns:
- the setter
-
getWriteSetter
Description copied from interface:MessageChannelGet the setter which can be used to change the write listener for this channel.- Specified by:
getWriteSetterin interfaceConnectedMessageChannel- Specified by:
getWriteSetterin interfaceMessageChannel- Specified by:
getWriteSetterin interfaceSuspendableChannel- Specified by:
getWriteSetterin interfaceSuspendableWriteChannel- Specified by:
getWriteSetterin interfaceWritableMessageChannel- Overrides:
getWriteSetterin classAssembledMessageChannel- Returns:
- the setter
-
getPeerAddress
Description copied from interface:ConnectedChannelGet the peer address of this channel.- Specified by:
getPeerAddressin interfaceConnectedChannel- Returns:
- the peer address
-
getPeerAddress
Description copied from interface:ConnectedChannelGet the peer address of a given type, ornullif the address is not of that type.- Specified by:
getPeerAddressin interfaceConnectedChannel- Parameters:
type- the address type class- Returns:
- the peer address, or
nullif unknown
-
getLocalAddress
Description copied from interface:BoundChannelGet the local address that this channel is bound to.- Specified by:
getLocalAddressin interfaceBoundChannel- Returns:
- the local address
-
getLocalAddress
Description copied from interface:BoundChannelGet the local address of a given type, ornullif the address is not of that type.- Specified by:
getLocalAddressin interfaceBoundChannel- Type Parameters:
A- the address type- Parameters:
type- the address type class- Returns:
- the local address, or
nullif unknown
-