Top Description Fields Constructors Methods
net.sf.ehcache.distribution

public Class RMICacheReplicatorFactory

extends CacheEventListenerFactory
Class Inheritance
Imports
net.sf.ehcache.event.CacheEventListener, .CacheEventListenerFactory, net.sf.ehcache.util.PropertyUtil, java.util.Properties, org.slf4j.Logger, .LoggerFactory

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
"/>
Author
Greg Luck
Version
$Id: RMICacheReplicatorFactory.java 10789 2018-04-26 02:08:13Z adahanne $

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
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.

protected static final int
DEFAULT_ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZE

A default for the maximum number of operations in an RMI message.

private static final Logger
private static final int
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final CacheEventListener

Returns:

a constructed CacheEventListener
createCacheEventListener
(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 "/>

properties
)

Implements abstract net.sf.ehcache.event.CacheEventListenerFactory.createCacheEventListener.

Create a CacheEventListener which is also a CacheReplicator.
protected int
extractMaximumBatchSize(Properties properties)

Extracts the value of maximumBatchSize.

protected boolean
extractReplicateAsynchronously(Properties properties)

Extracts the value of replicateAsynchronously from the properties

protected boolean
extractReplicatePuts(Properties properties)

Extracts the value of replicatePuts from the properties

protected boolean
extractReplicatePutsViaCopy(Properties properties)

Extracts the value of replicatePutsViaCopy from the properties

protected boolean
extractReplicateRemovals(Properties properties)

Extracts the value of replicateRemovals from the properties

protected boolean
extractReplicateUpdates(Properties properties)

Extracts the value of replicateUpdates from the properties

protected boolean
extractReplicateUpdatesViaCopy(Properties properties)

Extracts the value of replicateUpdatesViaCopy from the properties

protected int
extractReplicationIntervalMilis(Properties properties)

Extracts the value of asynchronousReplicationIntervalMillis.

Field Detail

ASYNCHRONOUS_REPLICATION_INTERVAL_MILLISback to summary
private static final String ASYNCHRONOUS_REPLICATION_INTERVAL_MILLIS
ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZEback to summary
private static final String ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZE
DEFAULT_ASYNCHRONOUS_REPLICATION_INTERVAL_MILLISback to summary
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.

DEFAULT_ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZEback to summary
protected static final int DEFAULT_ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZE

A default for the maximum number of operations in an RMI message.

LOGback to summary
private static final Logger LOG
MINIMUM_REASONABLE_INTERVALback to summary
private static final int MINIMUM_REASONABLE_INTERVAL
REPLICATE_ASYNCHRONOUSLYback to summary
private static final String REPLICATE_ASYNCHRONOUSLY
REPLICATE_PUTSback to summary
private static final String REPLICATE_PUTS
REPLICATE_PUTS_VIA_COPYback to summary
private static final String REPLICATE_PUTS_VIA_COPY
REPLICATE_REMOVALSback to summary
private static final String REPLICATE_REMOVALS
REPLICATE_UPDATESback to summary
private static final String REPLICATE_UPDATES
REPLICATE_UPDATES_VIA_COPYback to summary
private static final String REPLICATE_UPDATES_VIA_COPY

Constructor Detail

RMICacheReplicatorFactoryback to summary
public RMICacheReplicatorFactory()

Method Detail

createCacheEventListenerback to summary
public final CacheEventListener createCacheEventListener(Properties properties)

Implements abstract net.sf.ehcache.event.CacheEventListenerFactory.createCacheEventListener.

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
Parameters
properties: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:CacheEventListener

a constructed CacheEventListener

extractMaximumBatchSizeback to summary
protected int extractMaximumBatchSize(Properties properties)

Extracts the value of maximumBatchSize. Sets it to 1024 if either not set or there is a problem parsing the number

extractReplicateAsynchronouslyback to summary
protected boolean extractReplicateAsynchronously(Properties properties)

Extracts the value of replicateAsynchronously from the properties

extractReplicatePutsback to summary
protected boolean extractReplicatePuts(Properties properties)

Extracts the value of replicatePuts from the properties

extractReplicatePutsViaCopyback to summary
protected boolean extractReplicatePutsViaCopy(Properties properties)

Extracts the value of replicatePutsViaCopy from the properties

extractReplicateRemovalsback to summary
protected boolean extractReplicateRemovals(Properties properties)

Extracts the value of replicateRemovals from the properties

extractReplicateUpdatesback to summary
protected boolean extractReplicateUpdates(Properties properties)

Extracts the value of replicateUpdates from the properties

extractReplicateUpdatesViaCopyback to summary
protected boolean extractReplicateUpdatesViaCopy(Properties properties)

Extracts the value of replicateUpdatesViaCopy from the properties

extractReplicationIntervalMilisback to summary
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