Package org.xnio
Class MessageConnection
java.lang.Object
org.xnio.Connection
org.xnio.MessageConnection
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,InterruptibleChannel,BoundChannel,CloseableChannel,CloseListenerSettable<MessageConnection>,Configurable,ConnectedChannel
public abstract class MessageConnection
extends Connection
implements CloseListenerSettable<MessageConnection>
A message-oriented connection between peers.
- Author:
- David M. Lloyd
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.xnio.channels.CloseListenerSettable
CloseListenerSettable.Setter<C extends Channel> -
Field Summary
Fields inherited from class org.xnio.Connection
threadFields inherited from interface org.xnio.channels.Configurable
EMPTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMessageConnection(XnioIoThread thread) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionChannelListener<? super MessageConnection>Get the close listener.Get the setter which can be used to change the close listener for this channel.Get the sink channel.Get the source channel.voidsetCloseListener(ChannelListener<? super MessageConnection> listener) Set the close listener.protected voidsetSinkConduit(MessageSinkConduit conduit) protected voidsetSourceConduit(MessageSourceConduit conduit) Methods inherited from class org.xnio.Connection
close, closeAction, getIoThread, getLocalAddress, getOption, getPeerAddress, getWorker, isOpen, isReadShutdown, isWriteShutdown, notifyReadClosed, notifyWriteClosed, readClosed, setOption, supportsOption, writeClosedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xnio.channels.BoundChannel
getLocalAddressMethods inherited from interface org.xnio.channels.ConnectedChannel
getPeerAddress
-
Constructor Details
-
MessageConnection
Construct a new instance.- Parameters:
thread- the I/O thread
-
-
Method Details
-
setCloseListener
Description copied from interface:CloseListenerSettableSet the close listener.- Specified by:
setCloseListenerin interfaceCloseListenerSettable<MessageConnection>- Parameters:
listener- the close listener
-
getCloseListener
Description copied from interface:CloseListenerSettableGet the close listener.- Specified by:
getCloseListenerin interfaceCloseListenerSettable<MessageConnection>- Returns:
- the close listener
-
getCloseSetter
Description copied from interface:CloseableChannelGet 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- Returns:
- the setter
-
setSourceConduit
-
setSinkConduit
-
getSourceChannel
Get the source channel.- Returns:
- the source channel
-
getSinkChannel
Get the sink channel.- Returns:
- the sink channel
-