public interface AsyncEventQueueFactory
AsyncEventQueue
.
Below example illustrates how to get the instance of factory and create the
AsyncEventQueue
.
Cache c = new CacheFactory().create(); // get AsyncEventQueueFactory from cache AsyncEventQueueFactory factory = cache.createAsyncEventQueueFactory(); // set the attributes on factory factory.setBatchSize(batchSize); factory.setBatchConflationEnabled(isConflation); factory.setMaximumQueueMemory(maxMemory); factory.setParallel(isParallel); . . // create instance of AsyncEventListener AsyncEventListener asyncEventListener = new; // create AsyncEventQueue by providing the id and instance of AsyncEventListener AsyncEventQueue asyncQueue = factory.create(asyncQueueId, asyncEventListener);
Modifier and Type | Method and Description |
---|---|
AsyncEventQueueFactory |
addGatewayEventFilter(GatewayEventFilter filter)
Removes a
GatewayEventFilter to the attributes of
AsyncEventQueue being created by factory. |
AsyncEventQueue |
create(String id,
AsyncEventListener listener)
Creates the
AsyncEventQueue . |
AsyncEventQueueFactory |
removeGatewayEventFilter(GatewayEventFilter filter)
Removes the provided
GatewayEventFilter from the attributes of
AsyncEventQueue being created by factory. |
AsyncEventQueueFactory |
setBatchConflationEnabled(boolean isConflation)
Sets whether to enable batch conflation for
AsyncEventQueue . |
AsyncEventQueueFactory |
setBatchSize(int size)
Sets the batch size for an
AsyncEventQueue 's queue. |
AsyncEventQueueFactory |
setBatchTimeInterval(int interval)
Sets the batch time interval (in milliseconds) for a
AsyncEventQueue . |
AsyncEventQueueFactory |
setDiskStoreName(String name)
Sets the disk store name for overflow or persistence.
|
AsyncEventQueueFactory |
setDiskSynchronous(boolean isSynchronous)
Sets whether or not the writing to the disk is synchronous.
|
AsyncEventQueueFactory |
setDispatcherThreads(int numThreads)
Sets the number of dispatcher thread.
|
AsyncEventQueueFactory |
setGatewayEventSubstitutionListener(GatewayEventSubstitutionFilter filter)
Sets the
GatewayEventSubstitutionFilter . |
AsyncEventQueueFactory |
setMaximumQueueMemory(int memory)
Sets the maximum amount of memory (in MB) for an
AsyncEventQueue 's queue. |
AsyncEventQueueFactory |
setOrderPolicy(Gateway.OrderPolicy policy)
Sets the order policy for multiple dispatchers.
|
AsyncEventQueueFactory |
setParallel(boolean isParallel)
Indicates whether all VMs need to distribute events to remote site.
|
AsyncEventQueueFactory |
setPersistent(boolean isPersistent)
Sets whether the
AsyncEventQueue is persistent or not. |
AsyncEventQueueFactory setDiskStoreName(String name)
name
- AsyncEventQueueFactory setMaximumQueueMemory(int memory)
AsyncEventQueue
's queue.
Default is 100 MB.memory
- The maximum amount of memory (in MB) for an
AsyncEventQueue
's queueAsyncEventQueueFactory setDiskSynchronous(boolean isSynchronous)
isSynchronous
- boolean if true indicates synchronous writesAsyncEventQueueFactory setBatchSize(int size)
AsyncEventQueue
's queue.
Default is 100.size
- The size of batches sent to its AsyncEventListener
AsyncEventQueueFactory setBatchTimeInterval(int interval)
AsyncEventQueue
.
Default is 5 ms.interval
- The maximum time interval that can elapse before a partial batch
is sent from a AsyncEventQueue
.AsyncEventQueueFactory setPersistent(boolean isPersistent)
AsyncEventQueue
is persistent or not.
Default is false.isPersistent
- Whether to enable persistence for an AsyncEventQueue
.AsyncEventQueueFactory setParallel(boolean isParallel)
isParallel
- boolean to indicate whether distribution policy is parallelAsyncEventQueueFactory setBatchConflationEnabled(boolean isConflation)
AsyncEventQueue
.
Default is false.isConflation
- Whether or not to enable batch conflation for batches sent from a
AsyncEventQueue
AsyncEventQueueFactory setDispatcherThreads(int numThreads)
numThreads
- AsyncEventQueueFactory addGatewayEventFilter(GatewayEventFilter filter)
GatewayEventFilter
to the attributes of
AsyncEventQueue being created by factory.filter
- GatewayEventFilterAsyncEventQueueFactory removeGatewayEventFilter(GatewayEventFilter filter)
GatewayEventFilter
from the attributes of
AsyncEventQueue being created by factory.filter
- AsyncEventQueueFactory setOrderPolicy(Gateway.OrderPolicy policy)
policy
- AsyncEventQueueFactory setGatewayEventSubstitutionListener(GatewayEventSubstitutionFilter filter)
GatewayEventSubstitutionFilter
.filter
- The GatewayEventSubstitutionFilter
AsyncEventQueue create(String id, AsyncEventListener listener)
AsyncEventQueue
. It accepts Id of AsyncEventQueue
and instance of AsyncEventListener. Multiple queues can be created using
Same listener instance. So, the instance of AsyncEventListener
should be thread safe in that case. The AsyncEventListener
will start receiving events when the AsyncEventQueue
is
created.id
- Id of AsyncEventQueuelistener
- AsyncEventListener
to be added to the regions that
are configured to use this queue.Copyright © 1997-2017 Pivotal Software, Inc. All rights reserved.