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

All Known Implementing Classes:
DecoderMonitorAdapter

public interface DecoderMonitor

Monitors decoder activity. This class borrowed some from the org.xml.sax.ErrorHandler interface and its documentation. A monitor is a generalized callback for any sort of activity used for tracking both successes and failures. So you'll realize similarities between monitors and callbacks especially where the callbackOccurred() method is concerned.

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

Method Summary
 void callbackOccured(StatefulDecoder decoder, DecoderCallback cb, java.lang.Object decoded)
          Monitors callbacks that deliver a fully decoded object.
 void callbackSet(StatefulDecoder decoder, DecoderCallback oldcb, DecoderCallback newcb)
          Monitors changes to the callback.
 void error(StatefulDecoder decoder, java.lang.Exception exception)
          Receive notification of a recoverable error.
 void fatalError(StatefulDecoder decoder, java.lang.Exception exception)
          Receive notification of a non-recoverable error.
 void warning(StatefulDecoder decoder, java.lang.Exception exception)
          Receive notification of a warning.
 

Method Detail

error

public void error(StatefulDecoder decoder,
                  java.lang.Exception exception)
Receive notification of a recoverable error. This callback is used to denote a failure to handle a unit of data to be encoded or decoded. The entire [en|de]codable unit is lost but the [en|de]coding operation can still proceed.

Parameters:
decoder - the decoder that had the error
exception - the error information encapsulated in an exception

fatalError

public void fatalError(StatefulDecoder decoder,
                       java.lang.Exception exception)
Receive notification of a non-recoverable error. The application must assume that the stream data is unusable after the decoder has invoked this method, and should continue (if at all) only for the sake of collecting addition error messages: in fact, decoders are free to stop reporting any other events once this method has been invoked.

Parameters:
decoder - the decoder that had the failure
exception - the warning information encapsulated in an exception

warning

public void warning(StatefulDecoder decoder,
                    java.lang.Exception exception)
Receive notification of a warning. The decoder must continue to provide normal callbacks after invoking this method: it should still be possible for the application to process the encoded data through to the end.

Parameters:
decoder - the decoder that had the error
exception - the warning information encapsulated in an exception

callbackOccured

public void callbackOccured(StatefulDecoder decoder,
                            DecoderCallback cb,
                            java.lang.Object decoded)
Monitors callbacks that deliver a fully decoded object.

Parameters:
decoder - the stateful decoder driving the callback
decoded - the object that was decoded

callbackSet

public void callbackSet(StatefulDecoder decoder,
                        DecoderCallback oldcb,
                        DecoderCallback newcb)
Monitors changes to the callback.

Parameters:
decoder - the decoder whose callback was set
oldcb - the unset old callback, or null if none was set
newcb - the newly set callback, or null if callback is cleared


Copyright © 2004-2008 null. All Rights Reserved.