|
BEA Systems, Inc. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.bea.rfid.workflow.util.Accumulator
public class Accumulator
Plain java class for accumulating tags. This keeps track of unique tags list and sends them out to registered observers after the specified accumulation period or after the tags list has been stable for the specified stable set duration. This may also be used without specifying accumulation duration or stable set duration, in which case, it is the responsibility of the caller to get the accumulated tags and reset this as needed.
| Constructor Summary | |
|---|---|
Accumulator(long stableSetTimeout,
int stableSetCount,
Timer timer)
Constructor. |
|
| Method Summary | |
|---|---|
List |
add(List tagList)
Add unique tags from the list of ECReportGroupListMember to current
accumulated tags list, if this accumulator is in active state. |
List |
delete(List tagList)
Deletes tags from the list of ECReportGroupListMember from current
accumulated tags list, if this accumulator is in active state. |
List |
getAccumulatedTagList()
Returns the current list of accumulated tags. |
boolean |
isActive()
Returns boolean indicating if this is active or not. |
void |
registerObserver(AccumulationObserver accumulationObserver)
Registers an AccumulationObserver as the one that will be
notified with the accumulated tags when the accumulation duration or stable set
duration expires. |
void |
reset()
Clears the currently accumulated tags list and resets this accumulator to inactive state. |
void |
shutdown()
Releases any resources used by this accumulator and cancels its timer tasks. |
void |
startAccumulating()
Moves this accumulator to active state and starts accumulating. |
void |
startAccumulating(long accumulationDuration)
Moves this accumulator to active state and starts accumulating for the specified duration. |
void |
unregisterObserver()
Unregisters the existing AccumulationObserver from this. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Accumulator(long stableSetTimeout,
int stableSetCount,
Timer timer)
stableSetTimeout - time in milliseconds for which the tag list must be unchanged,
before the accumulation is considered finished. Values <= 0 means no
stable set timeout.stableSetCount - the minimum number of tags that must be present in the accumulated
tag list to activate stable set timeout. For example, if stable set count of 5
is specified and tag list of size 2 has been unchanged for the specified stable
set timeout, the accumulation is not considered finished. If stable set count of 5
is specified and tag list of size 5 or more has been unchanged for the specified
stable set timeout, that accumulation will be considered finished and observers
notified.
This parameter must be >= 0.
timer - java.util.Timer object for scheduling TimerTasks
for accumulation duration and stable set duration
IllegalArgumentException - if negative stableSetCount is passed in
or null value is passed in for timer| Method Detail |
|---|
public boolean isActive()
add and delete
methods.
public List getAccumulatedTagList()
This method should be used to get
the accumulated tags when there is no accumulation period or stable set timeout
specified. A call to reset() will finish the current accumulation.
This method may also be used to simply know the progress by getting the current accumulated tags.
public void reset()
public void startAccumulating()
reset.
This does nothing if the accumulator is already active.
public void startAccumulating(long accumulationDuration)
accumulationDuration - the duration in milliseconds for which tags must be
accumulated. This value must be >=0.
IllegalArgumentException - if the specified accumulation duration is not >=0public void registerObserver(AccumulationObserver accumulationObserver)
AccumulationObserver as the one that will be
notified with the accumulated tags when the accumulation duration or stable set
duration expires. This currently supports only one observer and hence will overwrite
the any existing observer in this accumulator.
accumulationObserver - AccumulationObserver interested in receiving
tag accumulation result when stable set or accumulation duration expirespublic void unregisterObserver()
AccumulationObserver from this.
public List add(List tagList)
ECReportGroupListMember to current
accumulated tags list, if this accumulator is in active state. The list is ignored if
the accumulator is not active. If a tag in this list already exists in the accumulated
list, that will be ignored.
The current list after the add operation is returned.
tagList - list of ECReportGroupListMember to be added to the
accumulated tags list
public List delete(List tagList)
ECReportGroupListMember from current
accumulated tags list, if this accumulator is in active state. The list is ignored if
the accumulator is not active.
The current list after the delete operation is returned.
tagList - list of ECReportGroupListMember to be removed from the
accumulated tags list
public void shutdown()
|
Documentation is available at ${DOCSWEBROOT} Copyright 2007 BEA Systems Inc. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||