Class ReliableIndicationHandler
java.lang.Object
org.sblim.cimclient.internal.wbem.indications.ReliableIndicationHandler
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
ConstructorsConstructorDescriptionReliableIndicationHandler
(CIMEventDispatcher pDispatcher, long pIdentiferLifetime) Constructs aReliableIndicationHandler
instance that uses the specified event dispatcher and sequence identifier lifetime to handle reliable indications. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Determines if both the indication delivery queue and sequence identifier cache are empty.void
handleIndication
(CIMInstance pIndication, String pId, InetAddress pInetAddress) Main worker routine forReliableIndicationHandler
.protected void
Processes both the indication delivery queue and sequence identifier cache.
-
Constructor Details
-
ReliableIndicationHandler
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 Details
-
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
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.
-