Top Description Fields Constructors Methods
org.xnio

public abstract Class MessageConnection

extends Connection
implements CloseListenerSettable<MessageConnection>
Class Inheritance
All Implemented Interfaces
org.xnio.channels.CloseListenerSettable
Imports
org.xnio.channels.CloseListenerSettable, org.xnio.conduits.ConduitReadableMessageChannel, .ConduitWritableMessageChannel, .MessageSinkConduit, .MessageSourceConduit

A message-oriented connection between peers.
Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private ChannelListener<? super MessageConnection>
private ConduitWritableMessageChannel
private ConduitReadableMessageChannel
Inherited from org.xnio.Connection:
thread

Constructor Summary

AccessConstructor and Description
protected
MessageConnection(final XnioIoThread
the I/O thread
thread
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public ChannelListener<? super MessageConnection>
public ChannelListener.Setter<MessageConnection>
getCloseSetter()

Implements org.xnio.channels.CloseableChannel.getCloseSetter, org.xnio.channels.ConnectedChannel.getCloseSetter.

Get the setter which can be used to change the close listener for this channel.

public ConduitWritableMessageChannel

Returns:

the sink channel
getSinkChannel
()

Get the sink channel.

public ConduitReadableMessageChannel

Returns:

the source channel
getSourceChannel
()

Get the source channel.

pack-priv void
private static <T> T
notNull(T orig)

public void
setCloseListener(final ChannelListener<? super MessageConnection>
the close listener
listener
)

Implements org.xnio.channels.CloseListenerSettable.setCloseListener.

Set the close listener.

protected void
protected void
Inherited from org.xnio.Connection:
closecloseActiongetIoThreadgetLocalAddressgetOptiongetPeerAddressgetWorkerisOpenisReadShutdownisWriteShutdownnotifyReadClosednotifyWriteClosedreadClosedsetOptionsupportsOptionwriteClosed

Field Detail

closeListenerback to summary
private ChannelListener<? super MessageConnection> closeListener
sinkChannelback to summary
private ConduitWritableMessageChannel sinkChannel
sourceChannelback to summary
private ConduitReadableMessageChannel sourceChannel

Constructor Detail

MessageConnectionback to summary
protected MessageConnection(final XnioIoThread thread)

Construct a new instance.

Parameters
thread:XnioIoThread

the I/O thread

Method Detail

getCloseListenerback to summary
public ChannelListener<? super MessageConnection> getCloseListener()

Implements org.xnio.channels.CloseListenerSettable.getCloseListener.

Doc from org.xnio.channels.CloseListenerSettable.getCloseListener.

Get the close listener.

Returns:ChannelListener<? super MessageConnection>

the close listener

getCloseSetterback to summary
public ChannelListener.Setter<MessageConnection> getCloseSetter()

Implements org.xnio.channels.CloseableChannel.getCloseSetter, org.xnio.channels.ConnectedChannel.getCloseSetter.

Doc from org.xnio.channels.CloseableChannel.getCloseSetter.

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.

Returns:ChannelListener.Setter<MessageConnection>

the setter

getSinkChannelback to summary
public ConduitWritableMessageChannel getSinkChannel()

Get the sink channel.

Returns:ConduitWritableMessageChannel

the sink channel

getSourceChannelback to summary
public ConduitReadableMessageChannel getSourceChannel()

Get the source channel.

Returns:ConduitReadableMessageChannel

the source channel

invokeCloseListenerback to summary
pack-priv void invokeCloseListener()

Implements abstract org.xnio.Connection.invokeCloseListener.

notNullback to summary
private static <T> T notNull(T orig) throws IllegalStateException
setCloseListenerback to summary
public void setCloseListener(final ChannelListener<? super MessageConnection> listener)

Implements org.xnio.channels.CloseListenerSettable.setCloseListener.

Doc from org.xnio.channels.CloseListenerSettable.setCloseListener.

Set the close listener.

Parameters
listener:ChannelListener<? super MessageConnection>

the close listener

setSinkConduitback to summary
protected void setSinkConduit(MessageSinkConduit conduit)
setSourceConduitback to summary
protected void setSourceConduit(MessageSourceConduit conduit)