org.apache.directory.shared.asn1.codec.stateful
Class EncoderMonitorAdapter

java.lang.Object
  extended byorg.apache.directory.shared.asn1.codec.stateful.EncoderMonitorAdapter
All Implemented Interfaces:
EncoderMonitor

public class EncoderMonitorAdapter
extends java.lang.Object
implements EncoderMonitor

Document me.

Author:
Apache Directory Project $Rev: 434412 $

Field Summary
 
Fields inherited from interface org.apache.directory.shared.asn1.codec.stateful.EncoderMonitor
INSTANCE
 
Constructor Summary
EncoderMonitorAdapter()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncoderMonitorAdapter

public EncoderMonitorAdapter()
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.

Specified by:
error in interface EncoderMonitor
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.

Specified by:
fatalError in interface EncoderMonitor
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.

Specified by:
warning in interface EncoderMonitor
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.

Specified by:
callbackOccured in interface EncoderMonitor
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.

Specified by:
callbackSet in interface EncoderMonitor
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-2008 null. All Rights Reserved.