org.sblim.cimclient.internal.wbem.indications
Class ReliableIndicationHandler

java.lang.Object
  extended by org.sblim.cimclient.internal.wbem.indications.ReliableIndicationHandler

public class ReliableIndicationHandler
extends java.lang.Object

ReliableIndicationHandler is responsible for determining when to dispatch reliable indications, which includes queuing unexpected indications, caching all indications for the duration of their sequence identifier lifetime, and logging missing, duplicate and out-of-order indications. This functionality is based on the changes first introduced by DSP1054 v1.1. The handleIndication, areAllEmpty and processAll methods need to be synchronized because they are the entry points into ReliableIndicationHandler - the first is the public entry point that needs to be passed each and every reliable indication, the other two are only called by the DataManager thread and hence protected. All of the private methods are only called from one of the three synchronized methods. NOTE: ReliableIndicationHandler does NOT contain any logic for handling sequence number wrapping. It was deemed unnecessary because of the performance impact to each and every indication for a VERY rare occurrence: sequence numbers are longs (signed 64-bit integers) that are are supposed to start at 0, so even if the listener handled 1,000,00 indications per second, it would take over 292,471 years for the sequence number to wrap.


Constructor Summary
ReliableIndicationHandler(CIMEventDispatcher pDispatcher, long pIdentiferLifetime)
          Constructs a ReliableIndicationHandler instance that uses the specified event dispatcher and sequence identifier lifetime to handle reliable indications.
 
Method Summary
protected  boolean areAllEmpty()
          Determines if both the indication delivery queue and sequence identifier cache are empty.
 void handleIndication(CIMInstance pIndication, CIMProperty<?> pSeqCtxProp, CIMProperty<?> pSeqNumProp, java.lang.String pId, java.net.InetAddress pInetAddress)
          Main worker routine for ReliableIndicationHandler.
protected  void processAll()
          Processes both the indication delivery queue and sequence identifier cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReliableIndicationHandler

public ReliableIndicationHandler(CIMEventDispatcher pDispatcher,
                                 long pIdentiferLifetime)
Constructs a ReliableIndicationHandler instance that uses the specified event dispatcher and sequence identifier lifetime to handle reliable indications.

Parameters:
pDispatcher - CIMEventDispatcher that does the actual indication dispatching.
pIdentiferLifetime - Sequence identifier lifetime.
Method Detail

areAllEmpty

protected boolean areAllEmpty()
Determines if both the indication delivery queue and sequence identifier cache are empty.

Returns:
true if both the indication delivery queue and sequence identifier cache are empty, false otherwise.

processAll

protected void processAll()
Processes both the indication delivery queue and sequence identifier cache.


handleIndication

public void handleIndication(CIMInstance pIndication,
                             CIMProperty<?> pSeqCtxProp,
                             CIMProperty<?> pSeqNumProp,
                             java.lang.String pId,
                             java.net.InetAddress pInetAddress)
Main worker routine for ReliableIndicationHandler. The indication is either sent directly to the CIMEventDispatcher or placed in the indication delivery queue to be dispatched later. All indications are placed in the sequence identifier cache.

Parameters:
pIndication - Reliable indication.
pSeqCtxProp - SequenceContext property.
pSeqNumProp - SequenceNumber property.
pId - Path portion of reliable indication URL.
pInetAddress - Host portion of reliable indication URL.


Copyright © 2005, 2011 IBM Corporation. All Rights Reserved.