Class BufferedSelectionChannel<T extends SelectionChannel>
- java.lang.Object
-
- org.restlet.ext.nio.internal.channel.WrapperChannel<T>
-
- org.restlet.ext.nio.internal.channel.WrapperSelectionChannel<T>
-
- org.restlet.ext.nio.internal.channel.BufferedSelectionChannel<T>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,BlockableChannel,SelectionChannel,BufferProcessor
- Direct Known Subclasses:
ReadableBufferedChannel,WritableBufferedChannel
@Deprecated public abstract class BufferedSelectionChannel<T extends SelectionChannel> extends WrapperSelectionChannel<T> implements BufferProcessor
Deprecated.Will be removed to favor lower-level network extensions allowing more control at the Restlet API level.Byte channel wrapping a byte buffer.
-
-
Constructor Summary
Constructors Constructor Description BufferedSelectionChannel(Buffer buffer, T source, WakeupListener wakeupListener)Deprecated.Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancanLoop(Buffer buffer, java.lang.Object... args)Deprecated.Indicates if the processing loop can continue.voidclose()Deprecated.Delegates to the wrapped channel.BuffergetBuffer()Deprecated.Returns the source buffer.voidonFillEof()Deprecated.Called back when a fill operation returns with an EOF status.voidpostProcess(int drained)Deprecated.Does nothing by default.intpreProcess(int maxDrained, java.lang.Object... args)Deprecated.Does nothing by default.-
Methods inherited from class org.restlet.ext.nio.internal.channel.WrapperSelectionChannel
getRegistration, isBlocking, setRegistration, toString
-
Methods inherited from class org.restlet.ext.nio.internal.channel.WrapperChannel
getWrappedChannel, isOpen
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.restlet.ext.nio.internal.buffer.BufferProcessor
couldFill, onDrain, onFill
-
-
-
-
Field Detail
-
buffer
private final Buffer buffer
Deprecated.The source IO buffer.
-
-
Constructor Detail
-
BufferedSelectionChannel
public BufferedSelectionChannel(Buffer buffer, T source, WakeupListener wakeupListener)
Deprecated.Constructor.- Parameters:
buffer- The source byte buffer, typically remaining from previous read processing.source- The source channel.wakeupListener- The wakeup listener that will be notified.
-
-
Method Detail
-
canLoop
public boolean canLoop(Buffer buffer, java.lang.Object... args)
Deprecated.Indicates if the processing loop can continue.- Specified by:
canLoopin interfaceBufferProcessor- Parameters:
buffer- The IO buffer to drain.args- The optional arguments to pass back to the callbacks.- Returns:
- True if the processing loop can continue.
-
close
public void close() throws java.io.IOExceptionDeprecated.Description copied from class:WrapperChannelDelegates to the wrapped channel.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classWrapperChannel<T extends SelectionChannel>- Throws:
java.io.IOException
-
getBuffer
public Buffer getBuffer()
Deprecated.Returns the source buffer.- Returns:
- The source buffer.
-
onFillEof
public void onFillEof()
Deprecated.Called back when a fill operation returns with an EOF status.- Specified by:
onFillEofin interfaceBufferProcessor
-
postProcess
public void postProcess(int drained) throws java.io.IOExceptionDeprecated.Does nothing by default.- Specified by:
postProcessin interfaceBufferProcessor- Parameters:
drained- The number of bytes drained or -1 if the filling source has ended.- Throws:
java.io.IOException
-
preProcess
public int preProcess(int maxDrained, java.lang.Object... args) throws java.io.IOExceptionDeprecated.Does nothing by default.- Specified by:
preProcessin interfaceBufferProcessor- Parameters:
maxDrained- The maximum number of bytes drained by this call or 0 for unlimited length.args- The optional arguments to pass back to the callbacks.- Returns:
- The number of bytes drained or -1 if the filling source has ended.
- Throws:
java.io.IOException
-
-