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 and Description |
---|
ReliableIndicationHandler(CIMEventDispatcher pDispatcher,
long pIdentiferLifetime)
Constructs a
ReliableIndicationHandler instance that uses
the specified event dispatcher and sequence identifier lifetime to handle
reliable indications. |
Modifier and Type | Method and Description |
---|---|
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.
|
public ReliableIndicationHandler(CIMEventDispatcher pDispatcher, long pIdentiferLifetime)
ReliableIndicationHandler
instance that uses
the specified event dispatcher and sequence identifier lifetime to handle
reliable indications.pDispatcher
- CIMEventDispatcher
that does the actual
indication dispatching.pIdentiferLifetime
- Sequence identifier lifetime.protected boolean areAllEmpty()
true
if both the indication delivery queue and
sequence identifier cache are empty, false
otherwise.protected void processAll()
public void handleIndication(CIMInstance pIndication, CIMProperty<?> pSeqCtxProp, CIMProperty<?> pSeqNumProp, java.lang.String pId, java.net.InetAddress pInetAddress)
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.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.