public class SynchroBuffer
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DUPLICATE_DISCARD
Discards duplicated objects.
|
static int |
DUPLICATE_OK
Allows object duplication.
|
static int |
DUPLICATE_REPLACE
Replaces duplicated objects.
|
| Constructor and Description |
|---|
SynchroBuffer()
Default constructor.
|
SynchroBuffer(long minWindowSize,
long maxWindowSize,
int windowGrowthFactor,
int duplicatePolicy)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the buffer and deallocate resources.
|
void |
disable()
Disable the listener.
|
void |
enable()
Enable the listener.
|
void |
push(java.util.Collection collection)
Push a collection of objects into the buffer.
|
void |
push(java.lang.Object object)
Push an object into the buffer.
|
void |
setSynchroBufferListener(SynchroBufferListener listener)
Set the buffer consumer listener.
|
public static final int DUPLICATE_OK
public static final int DUPLICATE_REPLACE
public static final int DUPLICATE_DISCARD
public SynchroBuffer(long minWindowSize,
long maxWindowSize,
int windowGrowthFactor,
int duplicatePolicy)
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 policypublic SynchroBuffer()
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 :
public void push(java.lang.Object object)
o - the object to pushpublic void push(java.util.Collection collection)
collection - the collection of objects to pushpublic void setSynchroBufferListener(SynchroBufferListener listener)
listener - the listenerpublic void enable()
public void disable()
public void close()