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
thread
Fields inherited from interface org.xnio.channels.Configurable
EMPTY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MessageConnection
(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.void
setCloseListener
(ChannelListener<? super MessageConnection> listener) Set the close listener.protected void
setSinkConduit
(MessageSinkConduit conduit) protected void
setSourceConduit
(MessageSourceConduit conduit) Methods inherited from class org.xnio.Connection
close, closeAction, getIoThread, getLocalAddress, getOption, getPeerAddress, getWorker, isOpen, isReadShutdown, isWriteShutdown, notifyReadClosed, notifyWriteClosed, readClosed, setOption, supportsOption, writeClosed
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.BoundChannel
getLocalAddress
Methods 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:CloseListenerSettable
Set the close listener.- Specified by:
setCloseListener
in interfaceCloseListenerSettable<MessageConnection>
- Parameters:
listener
- the close listener
-
getCloseListener
Description copied from interface:CloseListenerSettable
Get the close listener.- Specified by:
getCloseListener
in interfaceCloseListenerSettable<MessageConnection>
- Returns:
- the close listener
-
getCloseSetter
Description copied from interface:CloseableChannel
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 interfaceBoundChannel
- Specified by:
getCloseSetter
in interfaceCloseableChannel
- Specified by:
getCloseSetter
in interfaceConnectedChannel
- Returns:
- the setter
-
setSourceConduit
-
setSinkConduit
-
getSourceChannel
Get the source channel.- Returns:
- the source channel
-
getSinkChannel
Get the sink channel.- Returns:
- the sink channel
-