org.apache.directory.shared.asn1.codec.stateful
Class DecoderStack.ChainingCallback

java.lang.Object
  extended byorg.apache.directory.shared.asn1.codec.stateful.DecoderStack.ChainingCallback
All Implemented Interfaces:
DecoderCallback
Enclosing class:
DecoderStack

class DecoderStack.ChainingCallback
extends java.lang.Object
implements DecoderCallback

A callback used to chain decoders.

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

Field Summary
private  StatefulDecoder sink
          the source decoder calling this callback
private  StatefulDecoder src
          the sink decoder recieving the src's decoded object
 
Constructor Summary
(package private) DecoderStack.ChainingCallback(StatefulDecoder src, StatefulDecoder sink)
          Creates a callback that chains the output of a src decoder to the input of a sink decoder.
 
Method Summary
 void decodeOccurred(StatefulDecoder decoder, java.lang.Object decoded)
          Calls the DecoderStack.decode(Object) method of the sink if the decoder argument is the source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sink

private StatefulDecoder sink
the source decoder calling this callback


src

private StatefulDecoder src
the sink decoder recieving the src's decoded object

Constructor Detail

DecoderStack.ChainingCallback

DecoderStack.ChainingCallback(StatefulDecoder src,
                              StatefulDecoder sink)
Creates a callback that chains the output of a src decoder to the input of a sink decoder. No side-effects occur like setting the callback of the src so this ChainingCallback must be set explicity as the src decoders callback.

Parameters:
src - the source decoder calling this callback
sink - the sink decoder recieving the src's decoded object
Method Detail

decodeOccurred

public void decodeOccurred(StatefulDecoder decoder,
                           java.lang.Object decoded)
Calls the DecoderStack.decode(Object) method of the sink if the decoder argument is the source. Any failures that occur during the sink's decode operation are reported to the monitor first then rethrown as runtime exceptions with the root cause set to the faulting exception.

Specified by:
decodeOccurred in interface DecoderCallback
Parameters:
decoder - the stateful decoder driving the callback
decoded - the object that was decoded
See Also:
(org.apache.directory.shared.asn1.codec.stateful.StatefulDecoder, java.lang.Object)


Copyright © 2003-2006 . All Rights Reserved.