Class RMICacheReplicatorFactory

java.lang.Object
net.sf.ehcache.event.CacheEventListenerFactory
com.atlassian.cache.ehcache.replication.rmi.RMICacheReplicatorFactory

public class RMICacheReplicatorFactory extends net.sf.ehcache.event.CacheEventListenerFactory
A factory for RMI-based CacheReplicators, using properties. Config lines look like:
<cacheEventListenerFactory class="com.atlassian.cache.ehcache.RMICacheReplicatorFactory"
 properties="
 replicateAsynchronously=true,
 replicatePuts=true
 replicateUpdates=true
 replicateUpdatesViaCopy=true
 replicateRemovals=true
 "/>
This factory is a copy of the eponymous class from Ehcache, with the exception that any synchronous RMI replicators it creates do not suffer from https://jira.terracotta.org/jira/browse/EHC-683.
Since:
2.0
  • Field Details

    • 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:
    • 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:
  • Constructor Details

    • RMICacheReplicatorFactory

      public RMICacheReplicatorFactory()
  • Method Details

    • createCacheEventListener

      public net.sf.ehcache.event.CacheEventListener createCacheEventListener(Properties properties)
      Create a CacheEventListener which 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:
      createCacheEventListener in class net.sf.ehcache.event.CacheEventListenerFactory
      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