Class ReliableIndicationHandler
- java.lang.Object
-
- 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. ThehandleIndication
,areAllEmpty
andprocessAll
methods need to be synchronized because they are the entry points intoReliableIndicationHandler
- 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
Constructors Constructor Description ReliableIndicationHandler(CIMEventDispatcher pDispatcher, long pIdentiferLifetime)
Constructs aReliableIndicationHandler
instance that uses the specified event dispatcher and sequence identifier lifetime to handle reliable indications.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
areAllEmpty()
Determines if both the indication delivery queue and sequence identifier cache are empty.void
handleIndication(CIMInstance pIndication, java.lang.String pId, java.net.InetAddress pInetAddress)
Main worker routine forReliableIndicationHandler
.protected void
processAll()
Processes both the indication delivery queue and sequence identifier cache.
-
-
-
Constructor Detail
-
ReliableIndicationHandler
public ReliableIndicationHandler(CIMEventDispatcher pDispatcher, long pIdentiferLifetime)
Constructs aReliableIndicationHandler
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, java.lang.String pId, java.net.InetAddress pInetAddress)
Main worker routine forReliableIndicationHandler
. The indication is either sent directly to theCIMEventDispatcher
or placed in the indication delivery queue to be dispatched later. All reliable indications are placed in the sequence identifier cache.- Parameters:
pIndication
- Indication.pId
- Indication destination URL.pInetAddress
- Indication server IP.
-
-