org.apache.directory.shared.asn1.codec.stateful
Interface StatefulDecoder

All Known Subinterfaces:
ProviderDecoder
All Known Implementing Classes:
AbstractStatefulDecoder, DecoderStack, HexDecoder, MessageDecoder, TwixDecoder

public interface StatefulDecoder

A decoder which decodes encoded data as it arrives in peices while maintaining the state of the decode operation between the arrival of encoded chunks. As chunks of encoded data arrive the decoder processes each chunk of encoded data and maintains decoding state in between arrivals: it is hence stateful and should be associated with a single channel or encoded data producer. When an arbitrary unit of encoding, to be determined by the encoding scheme, has been decoded, the decode() method of the registered DecoderCallback is called.

Version:
$Rev: 664290 $
Author:
Apache Directory Project

Method Summary
 void decode(java.lang.Object encoded)
          Decodes a piece of encoded data.
 void setCallback(DecoderCallback cb)
          Sets the callback for this StatefulDecoder.
 void setDecoderMonitor(DecoderMonitor monitor)
          Monitors all kinds of events that occur during processing.
 

Method Detail

decode

void decode(java.lang.Object encoded)
            throws DecoderException
Decodes a piece of encoded data. The nature of this call, synchronous verses asynchonous, with respect to driving the actual decoding of the encoded data argument is determined by an implementation. A return from this method does not guarantee any callbacks: zero or more callbacks may occur during this call.

Parameters:
encoded - an object representing a piece of encoded data
Throws:
DecoderException - if the encoded element can't be decoded

setCallback

void setCallback(DecoderCallback cb)
Sets the callback for this StatefulDecoder.

Parameters:
cb - the callback to inform of a complete decode operation

setDecoderMonitor

void setDecoderMonitor(DecoderMonitor monitor)
Monitors all kinds of events that occur during processing.

Parameters:
monitor - to set for this StatefulDecoder


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.