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

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

public class DecoderMonitorAdapter
extends java.lang.Object
implements DecoderMonitor

A do nothing decoder monitor adapter. At a bare minimum warning, error and fatal exceptions are reported to the console when using this adapter to prevent exceptions from being completely ignored.

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

Constructor Summary
DecoderMonitorAdapter()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecoderMonitorAdapter

public DecoderMonitorAdapter()
Method Detail

error

public void error(StatefulDecoder decoder,
                  java.lang.Exception exception)
Description copied from interface: DecoderMonitor
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 DecoderMonitor
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)
Description copied from interface: DecoderMonitor
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.

Specified by:
fatalError in interface DecoderMonitor
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)
Description copied from interface: DecoderMonitor
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.

Specified by:
warning in interface DecoderMonitor
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)
Description copied from interface: DecoderMonitor
Monitors callbacks that deliver a fully decoded object.

Specified by:
callbackOccured in interface DecoderMonitor
Parameters:
decoder - the stateful decoder driving the callback
decoded - the object that was decoded

callbackSet

public void callbackSet(StatefulDecoder decoder,
                        DecoderCallback oldcb,
                        DecoderCallback newcb)
Description copied from interface: DecoderMonitor
Monitors changes to the callback.

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