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 | |
final int | DUPLICATE_OK = 1 |
final int | DUPLICATE_REPLACE = 2 |
final int | DUPLICATE_DISCARD = 3 |
Private Member Functions | |
void | init (long minSize, long maxSize, int growthFactor, int policy) |
Thread | createCheckingThread () |
long | fire () |
boolean | isClosed () |
void | setClosed (boolean value) |
void | setFiring (boolean value) |
boolean | isFiring () |
boolean | isEmpty () |
boolean | isEnabled () |
void | setEnabled (boolean value) |
Private Attributes | |
long | minWindowSize |
long | maxWindowSize |
int | windowGrowthFactor |
int | duplicatePolicy |
Thread | checkingThread |
Boolean | closed = Boolean.FALSE |
Boolean | firing = Boolean.FALSE |
Boolean | enabled = Boolean.FALSE |
SynchroBufferListener | listener = null |
List | buffer = null |
Static Private Attributes | |
final Logger | LOGGER = Logger.getLogger(SynchroBuffer.class.getName()) |
|
Constructor.
|
|
Default constructor. Initialisation is made via properties. It reads the configuration from the resource config file specified via the system property
|
|
Close the buffer and deallocate resources. |
|
|
|
Disable the listener. Pushed object are kept in the buffer and delivered when the listener is enabled. |
|
Enable the listener. The listener is disabled by default. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Push a collection of objects into the buffer.
|
|
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.
|
|
|
|
|
|
|
|
Set the buffer consumer listener.
|
|
The buffer |
|
|
|
|
|
Discards duplicated objects. |
|
Allows object duplication. |
|
Replaces duplicated objects. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|