org.restlet.engine.io
Class WritableTraceChannel

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<WritableSelectionChannel>
              extended by org.restlet.engine.io.WritableTraceChannel
All Implemented Interfaces:
Closeable, Channel, WritableByteChannel, BlockableChannel, SelectionChannel, WritableSelectionChannel

public class WritableTraceChannel
extends TraceChannel<WritableSelectionChannel>
implements WritableSelectionChannel

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
WritableTraceChannel(WritableSelectionChannel wrappedChannel)
          Constructor.
WritableTraceChannel(WritableSelectionChannel wrappedChannel, OutputStream traceStream)
          Constructor.
 
Method Summary
 int write(ByteBuffer src)
          Writes 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

WritableTraceChannel

public WritableTraceChannel(WritableSelectionChannel wrappedChannel)
Constructor.

Parameters:
wrappedChannel - The wrapped channel.

WritableTraceChannel

public WritableTraceChannel(WritableSelectionChannel wrappedChannel,
                            OutputStream traceStream)
Constructor.

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

write

public int write(ByteBuffer src)
          throws IOException
Writes the available byte from the wrapped channel to the destination buffer while writing them to the console.

Specified by:
write in interface WritableByteChannel
Parameters:
src - The source buffer.
Returns:
The number of bytes written.
Throws:
IOException


Copyright © 2005-2013 Restlet.