Package net.sf.ehcache.distribution
Class RMICacheReplicatorFactory
- java.lang.Object
-
- net.sf.ehcache.event.CacheEventListenerFactory
-
- net.sf.ehcache.distribution.RMICacheReplicatorFactory
-
public class RMICacheReplicatorFactory extends CacheEventListenerFactory
Creates an RMICacheReplicator using properties. Config lines look like:<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties=" replicateAsynchronously=true, replicatePuts=true replicateUpdates=true replicateUpdatesViaCopy=true replicateRemovals=true "/>
- Version:
- $Id$
- Author:
- Greg Luck
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_ASYNCHRONOUS_REPLICATION_INTERVAL_MILLISA default for the amount of time the replication thread sleeps after it detects the replicationQueue is empty before checking again.protected static intDEFAULT_ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZEA default for the maximum number of operations in an RMI message.
-
Constructor Summary
Constructors Constructor Description RMICacheReplicatorFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheEventListenercreateCacheEventListener(java.util.Properties properties)Create aCacheEventListenerwhich is also a CacheReplicator.protected intextractMaximumBatchSize(java.util.Properties properties)Extracts the value of maximumBatchSize.protected booleanextractReplicateAsynchronously(java.util.Properties properties)Extracts the value of replicateAsynchronously from the propertiesprotected booleanextractReplicatePuts(java.util.Properties properties)Extracts the value of replicatePuts from the propertiesprotected booleanextractReplicatePutsViaCopy(java.util.Properties properties)Extracts the value of replicatePutsViaCopy from the propertiesprotected booleanextractReplicateRemovals(java.util.Properties properties)Extracts the value of replicateRemovals from the propertiesprotected booleanextractReplicateUpdates(java.util.Properties properties)Extracts the value of replicateUpdates from the propertiesprotected booleanextractReplicateUpdatesViaCopy(java.util.Properties properties)Extracts the value of replicateUpdatesViaCopy from the propertiesprotected intextractReplicationIntervalMilis(java.util.Properties properties)Extracts the value of asynchronousReplicationIntervalMillis.
-
-
-
Field Detail
-
DEFAULT_ASYNCHRONOUS_REPLICATION_INTERVAL_MILLIS
protected static final int DEFAULT_ASYNCHRONOUS_REPLICATION_INTERVAL_MILLIS
A default for the amount of time the replication thread sleeps after it detects the replicationQueue is empty before checking again.- See Also:
- Constant Field Values
-
DEFAULT_ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZE
protected static final int DEFAULT_ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZE
A default for the maximum number of operations in an RMI message.- See Also:
- Constant Field Values
-
-
Method Detail
-
createCacheEventListener
public final CacheEventListener createCacheEventListener(java.util.Properties properties)
Create aCacheEventListenerwhich is also a CacheReplicator.The defaults if properties are not specified are:
- replicatePuts=true
- replicatePutsViaCopy=true
- replicateUpdates=true
- replicateUpdatesViaCopy=true
- replicateRemovals=true;
- replicateAsynchronously=true
- asynchronousReplicationIntervalMillis=1000
- Specified by:
createCacheEventListenerin classCacheEventListenerFactory- Parameters:
properties- implementation specific properties. These are configured as comma separated name value pairs in ehcache.xml e.g.<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties=" replicateAsynchronously=true, replicatePuts=true replicateUpdates=true replicateUpdatesViaCopy=true replicateRemovals=true asynchronousReplicationIntervalMillis=1000 "/>- Returns:
- a constructed CacheEventListener
-
extractReplicationIntervalMilis
protected int extractReplicationIntervalMilis(java.util.Properties properties)
Extracts the value of asynchronousReplicationIntervalMillis. Sets it to 1000ms if either not set or there is a problem parsing the number- Parameters:
properties-
-
extractMaximumBatchSize
protected int extractMaximumBatchSize(java.util.Properties properties)
Extracts the value of maximumBatchSize. Sets it to 1024 if either not set or there is a problem parsing the number- Parameters:
properties-
-
extractReplicateAsynchronously
protected boolean extractReplicateAsynchronously(java.util.Properties properties)
Extracts the value of replicateAsynchronously from the properties- Parameters:
properties-
-
extractReplicateRemovals
protected boolean extractReplicateRemovals(java.util.Properties properties)
Extracts the value of replicateRemovals from the properties- Parameters:
properties-
-
extractReplicateUpdatesViaCopy
protected boolean extractReplicateUpdatesViaCopy(java.util.Properties properties)
Extracts the value of replicateUpdatesViaCopy from the properties- Parameters:
properties-
-
extractReplicatePutsViaCopy
protected boolean extractReplicatePutsViaCopy(java.util.Properties properties)
Extracts the value of replicatePutsViaCopy from the properties- Parameters:
properties-
-
extractReplicateUpdates
protected boolean extractReplicateUpdates(java.util.Properties properties)
Extracts the value of replicateUpdates from the properties- Parameters:
properties-
-
extractReplicatePuts
protected boolean extractReplicatePuts(java.util.Properties properties)
Extracts the value of replicatePuts from the properties- Parameters:
properties-
-
-