org.apache.ws.commons.tcpmon.core.filter
Interface StreamFilter

All Known Implementing Classes:
CharsetDecoderFilter, CharsetRecoderFilter, ChunkedEncoder, GZIPDecoder, GZIPEncoder, HttpFilter, HttpRequestFilter, HttpResponseFilter, IdentityEncoder, MimePartFilter, MultipartFilter, ReadOnlyFilterWrapper, ReplaceFilter, RequestLineExtractor, Tee, Throttle, XmlFormatFilter

public interface StreamFilter

A filter acting on a stream.


Method Summary
 void invoke(Stream stream)
          Invoke the filter.
 boolean isReadOnly()
          Determine whether this filter is read-only.
 

Method Detail

isReadOnly

boolean isReadOnly()
Determine whether this filter is read-only. A read-only filter will not modify any data in the stream and exclusively use the skip operation to advance in the stream. The information provided by this method may be used to optimize processing of the stream.

Returns:
true if this filter is read-only

invoke

void invoke(Stream stream)
Invoke the filter. This method is called by Pipeline when data is available for processing. The implementation can modify the stream by discarding bytes from the stream and inserting new data. If it doesn't wish to modify the stream, it should skip the relevant parts, so that it will be processed by the next filter in the pipeline.

An implementation is not required to process (skip or discard) all the data available on each invocation. If after the invocation of this method Stream.available() is non zero, the remaining (unprocessed) data will be available again during the next invocation of the filter.

Parameters:
stream - the stream to process


Copyright © The Apache Software Foundation. All Rights Reserved.