- java.lang.Object
-
- org.xnio.channels.AssembledStreamChannel
-
- org.xnio.channels.AssembledConnectedStreamChannel
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.ByteChannel,java.nio.channels.Channel,java.nio.channels.GatheringByteChannel,java.nio.channels.InterruptibleChannel,java.nio.channels.ReadableByteChannel,java.nio.channels.ScatteringByteChannel,java.nio.channels.WritableByteChannel,BoundChannel,ByteChannel,CloseableChannel,Configurable,ConnectedChannel,ConnectedStreamChannel,StreamChannel,StreamSinkChannel,StreamSourceChannel,SuspendableChannel,SuspendableReadChannel,SuspendableWriteChannel
- Direct Known Subclasses:
AssembledConnectedSslStreamChannel
public class AssembledConnectedStreamChannel extends AssembledStreamChannel implements ConnectedStreamChannel
A connected stream channel assembled from a stream source and stream sink.- Author:
- David M. Lloyd
-
-
Field Summary
-
Fields inherited from interface org.xnio.channels.Configurable
EMPTY
-
-
Constructor Summary
Constructors Constructor Description AssembledConnectedStreamChannel(ConnectedChannel connection, StreamSourceChannel source, StreamSinkChannel sink)Construct a new instance.AssembledConnectedStreamChannel(StreamSourceChannel source, StreamSinkChannel sink)Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChannelListener.Setter<? extends AssembledConnectedStreamChannel>getCloseSetter()Get the setter which can be used to change the close listener for this channel.java.net.SocketAddressgetLocalAddress()Get the local address that this channel is bound to.<A extends java.net.SocketAddress>
AgetLocalAddress(java.lang.Class<A> type)Get the local address of a given type, ornullif the address is not of that type.java.net.SocketAddressgetPeerAddress()Get the peer address of this channel.<A extends java.net.SocketAddress>
AgetPeerAddress(java.lang.Class<A> type)Get the peer address of a given type, ornullif the address is not of that type.ChannelListener.Setter<? extends AssembledConnectedStreamChannel>getReadSetter()Get the setter which can be used to change the read listener for this channel.ChannelListener.Setter<? extends AssembledConnectedStreamChannel>getWriteSetter()Get the setter which can be used to change the write listener for this channel.-
Methods inherited from class org.xnio.channels.AssembledStreamChannel
awaitReadable, awaitReadable, awaitWritable, awaitWritable, close, flush, getIoThread, getOption, getReadThread, getWorker, getWriteThread, isOpen, isReadResumed, isWriteResumed, read, read, read, resumeReads, resumeWrites, setOption, shutdownReads, shutdownWrites, supportsOption, suspendReads, suspendWrites, transferFrom, transferFrom, transferTo, transferTo, wakeupReads, wakeupWrites, write, write, write, writeFinal, writeFinal, writeFinal
-
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.CloseableChannel
getIoThread, getWorker
-
Methods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOption
-
Methods inherited from interface org.xnio.channels.StreamSinkChannel
transferFrom, transferFrom, writeFinal, writeFinal, writeFinal
-
Methods inherited from interface org.xnio.channels.StreamSourceChannel
transferTo, transferTo
-
Methods inherited from interface org.xnio.channels.SuspendableReadChannel
awaitReadable, awaitReadable, getReadThread, isReadResumed, resumeReads, shutdownReads, suspendReads, wakeupReads
-
Methods inherited from interface org.xnio.channels.SuspendableWriteChannel
awaitWritable, awaitWritable, close, flush, getWriteThread, isOpen, isWriteResumed, resumeWrites, shutdownWrites, suspendWrites, wakeupWrites
-
-
-
-
Constructor Detail
-
AssembledConnectedStreamChannel
public AssembledConnectedStreamChannel(ConnectedChannel connection, StreamSourceChannel source, StreamSinkChannel sink)
Construct a new instance.- Parameters:
connection- the connected channelsource- the sourcesink- the sink
-
AssembledConnectedStreamChannel
public AssembledConnectedStreamChannel(StreamSourceChannel source, StreamSinkChannel sink)
Construct a new instance. At least one side must be connected.- Parameters:
source- the sourcesink- the sink
-
-
Method Detail
-
getCloseSetter
public ChannelListener.Setter<? extends AssembledConnectedStreamChannel> getCloseSetter()
Description copied from interface:StreamChannelGet 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 interfaceConnectedStreamChannel- Specified by:
getCloseSetterin interfaceStreamChannel- Specified by:
getCloseSetterin interfaceStreamSinkChannel- Specified by:
getCloseSetterin interfaceStreamSourceChannel- Specified by:
getCloseSetterin interfaceSuspendableChannel- Specified by:
getCloseSetterin interfaceSuspendableReadChannel- Specified by:
getCloseSetterin interfaceSuspendableWriteChannel- Overrides:
getCloseSetterin classAssembledStreamChannel- Returns:
- the setter
-
getReadSetter
public ChannelListener.Setter<? extends AssembledConnectedStreamChannel> getReadSetter()
Description copied from interface:StreamChannelGet the setter which can be used to change the read listener for this channel.- Specified by:
getReadSetterin interfaceConnectedStreamChannel- Specified by:
getReadSetterin interfaceStreamChannel- Specified by:
getReadSetterin interfaceStreamSourceChannel- Specified by:
getReadSetterin interfaceSuspendableChannel- Specified by:
getReadSetterin interfaceSuspendableReadChannel- Overrides:
getReadSetterin classAssembledStreamChannel- Returns:
- the setter
-
getWriteSetter
public ChannelListener.Setter<? extends AssembledConnectedStreamChannel> getWriteSetter()
Description copied from interface:StreamChannelGet the setter which can be used to change the write listener for this channel.- Specified by:
getWriteSetterin interfaceConnectedStreamChannel- Specified by:
getWriteSetterin interfaceStreamChannel- Specified by:
getWriteSetterin interfaceStreamSinkChannel- Specified by:
getWriteSetterin interfaceSuspendableChannel- Specified by:
getWriteSetterin interfaceSuspendableWriteChannel- Overrides:
getWriteSetterin classAssembledStreamChannel- Returns:
- the setter
-
getPeerAddress
public java.net.SocketAddress getPeerAddress()
Description copied from interface:ConnectedChannelGet the peer address of this channel.- Specified by:
getPeerAddressin interfaceConnectedChannel- Returns:
- the peer address
-
getPeerAddress
public <A extends java.net.SocketAddress> A getPeerAddress(java.lang.Class<A> type)
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
public java.net.SocketAddress getLocalAddress()
Description copied from interface:BoundChannelGet the local address that this channel is bound to.- Specified by:
getLocalAddressin interfaceBoundChannel- Returns:
- the local address
-
getLocalAddress
public <A extends java.net.SocketAddress> A getLocalAddress(java.lang.Class<A> type)
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
-
-