org.apache.asn1.codec.stateful
Interface EncoderMonitor

All Known Implementing Classes:
EncoderMonitorAdapter

public interface EncoderMonitor

Document me.

Author:
Apache Directory Project $Rev: 161723 $

Field Summary
static EncoderMonitor INSTANCE
          Use this if you don't want to recreate this as just a NOOP monitor
 
Method Summary
 void callbackOccured(StatefulEncoder encoder, EncoderCallback cb, java.lang.Object decoded)
          Monitors callbacks that deliver a fully decoded object.
 void callbackSet(StatefulEncoder encoder, EncoderCallback oldcb, EncoderCallback newcb)
          Monitors changes to the callback.
 void error(StatefulEncoder encoder, java.lang.Exception exception)
          Receive notification of a recoverable error.
 void fatalError(StatefulEncoder encoder, java.lang.Exception exception)
          Receive notification of a non-recoverable error.
 void warning(StatefulEncoder encoder, java.lang.Exception exception)
          Receive notification of a warning.
 

Field Detail

INSTANCE

public static final EncoderMonitor INSTANCE
Use this if you don't want to recreate this as just a NOOP monitor

Method Detail

error

public void error(StatefulEncoder encoder,
                  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:
encoder - the encoder that had the error
exception - the error information encapsulated in an exception

fatalError

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

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

warning

public void warning(StatefulEncoder encoder,
                    java.lang.Exception exception)
Receive notification of a warning. The encoder 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:
encoder - the encoder that had the error
exception - the warning information encapsulated in an exception

callbackOccured

public void callbackOccured(StatefulEncoder encoder,
                            EncoderCallback cb,
                            java.lang.Object decoded)
Monitors callbacks that deliver a fully decoded object.

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

callbackSet

public void callbackSet(StatefulEncoder encoder,
                        EncoderCallback oldcb,
                        EncoderCallback newcb)
Monitors changes to the callback.

Parameters:
encoder - the encoder 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-2006 . All Rights Reserved.