net.sf.ehcache.distribution

Class 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: RMICacheReplicatorFactory.java 191 2006-09-03 22:41:48Z gregluck $

Author: Greg Luck

Field Summary
protected static intDEFAULT_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.
Method Summary
CacheEventListenercreateCacheEventListener(Properties properties)
Create a CacheEventListener which is also a CacheReplicator.
protected booleanextractReplicateAsynchronously(Properties properties)
Extracts the value of replicateAsynchronously from the properties
protected booleanextractReplicatePuts(Properties properties)
Extracts the value of replicatePuts from the properties
protected booleanextractReplicateRemovals(Properties properties)
Extracts the value of replicateRemovals from the properties
protected booleanextractReplicateUpdates(Properties properties)
Extracts the value of replicateUpdates from the properties
protected booleanextractReplicateUpdatesViaCopy(Properties properties)
Extracts the value of replicateUpdatesViaCopy from the properties
protected intextractReplicationIntervalMilis(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.

Method Detail

createCacheEventListener

public final CacheEventListener createCacheEventListener(Properties properties)
Create a CacheEventListener which is also a CacheReplicator.

The defaults if properties are not specified are:

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

extractReplicateAsynchronously

protected boolean extractReplicateAsynchronously(Properties properties)
Extracts the value of replicateAsynchronously from the properties

Parameters: properties

extractReplicatePuts

protected boolean extractReplicatePuts(Properties properties)
Extracts the value of replicatePuts from the properties

Parameters: properties

extractReplicateRemovals

protected boolean extractReplicateRemovals(Properties properties)
Extracts the value of replicateRemovals from the properties

Parameters: properties

extractReplicateUpdates

protected boolean extractReplicateUpdates(Properties properties)
Extracts the value of replicateUpdates from the properties

Parameters: properties

extractReplicateUpdatesViaCopy

protected boolean extractReplicateUpdatesViaCopy(Properties properties)
Extracts the value of replicateUpdatesViaCopy from the properties

Parameters: properties

extractReplicationIntervalMilis

protected int extractReplicationIntervalMilis(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