public class RemotingMessageChannel
extends org.xnio.channels.TranslatingSuspendableChannel<org.xnio.channels.ConnectedMessageChannel,org.xnio.channels.ConnectedStreamChannel>
implements org.xnio.channels.ConnectedMessageChannel
FramedMessageChannel
to fix
REM3-259 issue.
While slightly modified, it is basically a copy of FramedMessageChannel
org.xnio.channels.ReadListenerSettable.Setter<C extends Channel>
org.xnio.channels.WriteListenerSettable.Setter<C extends Channel>
org.xnio.channels.CloseListenerSettable.Setter<C extends Channel>
Constructor and Description |
---|
RemotingMessageChannel(org.xnio.channels.ConnectedStreamChannel channel,
ByteBuffer receiveBuffer,
ByteBuffer transmitBuffer)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeAction(boolean readShutDown,
boolean writeShutDown) |
protected boolean |
flushAction(boolean shutDown) |
org.xnio.channels.ConnectedStreamChannel |
getChannel()
Get the underlying channel.
|
SocketAddress |
getLocalAddress() |
<A extends SocketAddress> |
getLocalAddress(Class<A> type) |
SocketAddress |
getPeerAddress() |
<A extends SocketAddress> |
getPeerAddress(Class<A> type) |
int |
receive(ByteBuffer buffer) |
long |
receive(ByteBuffer[] buffers) |
long |
receive(ByteBuffer[] buffers,
int offs,
int len) |
boolean |
send(ByteBuffer buffer) |
boolean |
send(ByteBuffer[] buffers) |
boolean |
send(ByteBuffer[] buffers,
int offs,
int len) |
protected void |
shutdownReadsAction(boolean writeComplete) |
protected void |
shutdownWritesComplete(boolean readShutDown) |
awaitReadable, awaitReadable, awaitWritable, awaitWritable, clearReadReady, clearReadRequiresWrite, clearWriteReady, clearWriteRequiresRead, close, flush, getCloseListener, getCloseSetter, getIoThread, getOption, getReadListener, getReadSetter, getReadThread, getWorker, getWriteListener, getWriteSetter, getWriteThread, handleClosed, handleReadable, handleWritable, isOpen, isReadResumed, isReadShutDown, isWriteComplete, isWriteResumed, isWriteShutDown, readRequiresWrite, removeReadRequiresExternal, removeWriteRequiresExternal, resumeReads, resumeWrites, setClosed, setCloseListener, setOption, setReadListener, setReadReady, setReadRequiresWrite, setReadShutDown, setWriteListener, setWriteReady, setWriteRequiresRead, setWriteShutDown, shutdownReads, shutdownWrites, shutdownWritesAction, supportsOption, suspendReads, suspendWrites, thisTyped, toString, tryAddReadRequiresExternal, tryAddWriteRequiresExternal, wakeupReads, wakeupWrites, writeRequiresRead
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCloseSetter, getReadSetter, getWriteSetter
awaitReadable, awaitReadable, getReadThread, isReadResumed, resumeReads, shutdownReads, suspendReads, wakeupReads
public RemotingMessageChannel(org.xnio.channels.ConnectedStreamChannel channel, ByteBuffer receiveBuffer, ByteBuffer transmitBuffer)
channel
- the channel to wrapreceiveBuffer
- the receive buffer (should be direct)transmitBuffer
- the send buffer (should be direct)public int receive(ByteBuffer buffer) throws IOException
receive
in interface org.xnio.channels.ReadableMessageChannel
IOException
public long receive(ByteBuffer[] buffers) throws IOException
receive
in interface org.xnio.channels.ReadableMessageChannel
IOException
public long receive(ByteBuffer[] buffers, int offs, int len) throws IOException
receive
in interface org.xnio.channels.ReadableMessageChannel
IOException
protected void shutdownReadsAction(boolean writeComplete) throws IOException
shutdownReadsAction
in class org.xnio.channels.TranslatingSuspendableChannel<org.xnio.channels.ConnectedMessageChannel,org.xnio.channels.ConnectedStreamChannel>
IOException
public boolean send(ByteBuffer buffer) throws IOException
send
in interface org.xnio.channels.WritableMessageChannel
IOException
public boolean send(ByteBuffer[] buffers) throws IOException
send
in interface org.xnio.channels.WritableMessageChannel
IOException
public boolean send(ByteBuffer[] buffers, int offs, int len) throws IOException
send
in interface org.xnio.channels.WritableMessageChannel
IOException
protected boolean flushAction(boolean shutDown) throws IOException
flushAction
in class org.xnio.channels.TranslatingSuspendableChannel<org.xnio.channels.ConnectedMessageChannel,org.xnio.channels.ConnectedStreamChannel>
IOException
protected void shutdownWritesComplete(boolean readShutDown) throws IOException
shutdownWritesComplete
in class org.xnio.channels.TranslatingSuspendableChannel<org.xnio.channels.ConnectedMessageChannel,org.xnio.channels.ConnectedStreamChannel>
IOException
protected void closeAction(boolean readShutDown, boolean writeShutDown) throws IOException
closeAction
in class org.xnio.channels.TranslatingSuspendableChannel<org.xnio.channels.ConnectedMessageChannel,org.xnio.channels.ConnectedStreamChannel>
IOException
public SocketAddress getPeerAddress()
getPeerAddress
in interface org.xnio.channels.ConnectedChannel
public <A extends SocketAddress> A getPeerAddress(Class<A> type)
getPeerAddress
in interface org.xnio.channels.ConnectedChannel
public SocketAddress getLocalAddress()
getLocalAddress
in interface org.xnio.channels.BoundChannel
public <A extends SocketAddress> A getLocalAddress(Class<A> type)
getLocalAddress
in interface org.xnio.channels.BoundChannel
public org.xnio.channels.ConnectedStreamChannel getChannel()
getChannel
in interface org.xnio.channels.WrappedChannel<org.xnio.channels.ConnectedStreamChannel>
getChannel
in class org.xnio.channels.TranslatingSuspendableChannel<org.xnio.channels.ConnectedMessageChannel,org.xnio.channels.ConnectedStreamChannel>
Copyright © 2018 JBoss, a division of Red Hat, Inc.. All rights reserved.