org.restlet.engine.io
Class ReadableTraceChannel

java.lang.Object
  extended by org.restlet.engine.io.WrapperChannel<T>
      extended by org.restlet.engine.io.WrapperSelectionChannel<T>
          extended by org.restlet.engine.io.TraceChannel<ReadableSelectionChannel>
              extended by org.restlet.engine.io.ReadableTraceChannel
All Implemented Interfaces:
Closeable, Channel, ReadableByteChannel, BlockableChannel, ReadableSelectionChannel, SelectionChannel

public class ReadableTraceChannel
extends TraceChannel<ReadableSelectionChannel>
implements ReadableSelectionChannel

Trace byte channel that sends a copy of all data on the trace output stream. It is important to implement SelectionChannel as some framework classes rely on this down the processing chain.

Author:
Jerome Louvel

Constructor Summary
ReadableTraceChannel(ReadableSelectionChannel wrappedChannel)
          Constructor.
ReadableTraceChannel(ReadableSelectionChannel wrappedChannel, OutputStream traceStream)
          Constructor.
 
Method Summary
 int read(ByteBuffer dst)
          Reads the available byte from the wrapped channel to the destination buffer while writing them to the console.
 
Methods inherited from class org.restlet.engine.io.TraceChannel
getTraceStream
 
Methods inherited from class org.restlet.engine.io.WrapperSelectionChannel
getRegistration, isBlocking, setRegistration, toString
 
Methods inherited from class org.restlet.engine.io.WrapperChannel
close, 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.engine.io.SelectionChannel
getRegistration
 
Methods inherited from interface org.restlet.engine.io.BlockableChannel
isBlocking
 
Methods inherited from interface java.nio.channels.Channel
close, isOpen
 

Constructor Detail

ReadableTraceChannel

public ReadableTraceChannel(ReadableSelectionChannel wrappedChannel)
Constructor.

Parameters:
wrappedChannel - The wrapped channel.

ReadableTraceChannel

public ReadableTraceChannel(ReadableSelectionChannel wrappedChannel,
                            OutputStream traceStream)
Constructor.

Parameters:
wrappedChannel - The wrapped channel.
traceStream - The trace stream.
Method Detail

read

public int read(ByteBuffer dst)
         throws IOException
Reads the available byte from the wrapped channel to the destination buffer while writing them to the console.

Specified by:
read in interface ReadableByteChannel
Parameters:
dst - The destination buffer.
Returns:
The number of bytes read.
Throws:
IOException


Copyright © 2005-2013 Restlet.