Public Member Functions | |
SynchroBuffer (long minWindowSize, long maxWindowSize, int windowGrowthFactor, int duplicatePolicy) | |
SynchroBuffer () | |
void | push (Object object) |
void | push (Collection collection) |
void | setSynchroBufferListener (SynchroBufferListener listener) |
void | enable () |
void | disable () |
void | close () |
Static Public Attributes | |
static final int | DUPLICATE_OK = 1 |
static final int | DUPLICATE_REPLACE = 2 |
static final int | DUPLICATE_DISCARD = 3 |
A buffering utility class.
cern.laser.util.buffer.SynchroBuffer.SynchroBuffer | ( | long | minWindowSize, | |
long | maxWindowSize, | |||
int | windowGrowthFactor, | |||
int | duplicatePolicy | |||
) |
Constructor.
minWindowSize | the buffer window min size (msec) | |
maxWindowSize | the buffer window max size (msec) | |
windowGrowthFactor | the buffer window growth factor (size = minWindowSize + msg/sec x windowGrowthFactor) | |
duplicatePolicy | the buffer object duplication policy |
cern.laser.util.buffer.SynchroBuffer.SynchroBuffer | ( | ) |
Default constructor. Initialisation is made via properties. It reads the configuration from the resource config file specified via the system property syncrobuffer.properties
. If not defined, it looks for the default config file synchrobuffer-config.properties
. System properties override the configuration loaded from the properties file. Configuration properties are :
void cern.laser.util.buffer.SynchroBuffer.close | ( | ) |
Close the buffer and deallocate resources.
Referenced by cern.laser.util.buffer.SynchroBufferAdapter.close(), cern.laser.source.alarmsysteminterface.impl.AlarmSystemInterfaceProxy.close(), and cern.laser.business.cache.AlarmCacheListenerImpl.close().
void cern.laser.util.buffer.SynchroBuffer.disable | ( | ) |
Disable the listener. Pushed object are kept in the buffer and delivered when the listener is enabled.
Referenced by cern.laser.util.buffer.SynchroBufferAdapter.disable().
void cern.laser.util.buffer.SynchroBuffer.enable | ( | ) |
Enable the listener. The listener is disabled by default.
Referenced by cern.laser.business.cache.AlarmCacheListenerImpl.AlarmCacheListenerImpl(), cern.laser.source.alarmsysteminterface.impl.AlarmSystemInterfaceProxy.AlarmSystemInterfaceProxy(), and cern.laser.util.buffer.SynchroBufferAdapter.enable().
void cern.laser.util.buffer.SynchroBuffer.push | ( | Collection | collection | ) |
Push a collection of objects into the buffer.
collection | the collection of objects to push |
References cern.laser.util.buffer.SynchroBuffer.push().
void cern.laser.util.buffer.SynchroBuffer.push | ( | Object | object | ) |
Push an object into the buffer. If the duplicate policy is DUPLICATE_DISCARD the object is discarded if the buffer already contains it. If the duplicate policy is DUPLICATE_REPLACE the object replaces any previously pushed duplicated instance. The object is appended otherwise. Equals method is used to determine duplications.
o | the object to push |
Referenced by cern.laser.business.cache.AlarmCacheListenerImpl.onAlarmChange(), cern.laser.util.buffer.SynchroBufferAdapter.push(), cern.laser.util.buffer.SynchroBuffer.push(), and cern.laser.source.alarmsysteminterface.impl.AlarmSystemInterfaceProxy.push().
void cern.laser.util.buffer.SynchroBuffer.setSynchroBufferListener | ( | SynchroBufferListener | listener | ) |
Set the buffer consumer listener.
listener | the listener |
Referenced by cern.laser.business.cache.AlarmCacheListenerImpl.AlarmCacheListenerImpl(), cern.laser.source.alarmsysteminterface.impl.AlarmSystemInterfaceProxy.AlarmSystemInterfaceProxy(), and cern.laser.util.buffer.SynchroBufferAdapter.SynchroBufferAdapter().
final int cern.laser.util.buffer.SynchroBuffer.DUPLICATE_DISCARD = 3 [static] |
Discards duplicated objects.
final int cern.laser.util.buffer.SynchroBuffer.DUPLICATE_OK = 1 [static] |
Allows object duplication.
final int cern.laser.util.buffer.SynchroBuffer.DUPLICATE_REPLACE = 2 [static] |
Replaces duplicated objects.