public class ReplicatedHazelcastAggregationRepository extends HazelcastAggregationRepository
RecoverableAggregationRepository and
OptimisticLockingAggregationRepository. Defaults to thread-safe (non-optimistic) locking and recoverable
strategy. Hazelcast settings are given to an end-user and can be controlled with repositoryName and
persistentRespositoryName, both are IMap <String, Exchange>. However
ReplicatedHazelcastAggregationRepository can run it's own Hazelcast instance, but obviously no benefits of Hazelcast
clustering are gained this way. If the ReplicatedHazelcastAggregationRepository uses it's own local
HazelcastInstance it will DESTROY this instance on HazelcastAggregationRepository.doStop(). You should control
HazelcastInstance lifecycle yourself whenever you instantiate
ReplicatedHazelcastAggregationRepository passing a reference to the instance.| Modifier and Type | Field and Description |
|---|---|
protected Map<String,org.apache.camel.support.DefaultExchangeHolder> |
replicatedCache |
protected Map<String,org.apache.camel.support.DefaultExchangeHolder> |
replicatedPersistedCache |
allowSerializedHeaders, cache, COMPLETED_SUFFIX, deadLetterChannel, hzInstance, mapName, maximumRedeliveries, optimistic, persistedCache, persistenceMapName, recoveryInterval, useLocalHzInstance, useRecovery| Constructor and Description |
|---|
ReplicatedHazelcastAggregationRepository(String repositoryName)
Creates new
ReplicatedHazelcastAggregationRepository that defaults to non-optimistic locking with
recoverable behavior and a local Hazelcast instance. |
ReplicatedHazelcastAggregationRepository(String repositoryName,
boolean optimistic)
Creates new
ReplicatedHazelcastAggregationRepository with recoverable behavior and a local Hazelcast
instance. |
ReplicatedHazelcastAggregationRepository(String repositoryName,
boolean optimistic,
com.hazelcast.core.HazelcastInstance hzInstance)
Creates new
ReplicatedHazelcastAggregationRepository with recoverable behavior. |
ReplicatedHazelcastAggregationRepository(String repositoryName,
com.hazelcast.core.HazelcastInstance hzInstanse)
Creates new
ReplicatedHazelcastAggregationRepository that defaults to non-optimistic locking with
recoverable behavior. |
ReplicatedHazelcastAggregationRepository(String repositoryName,
String persistentRepositoryName)
Creates new
ReplicatedHazelcastAggregationRepository that defaults to non-optimistic locking with
recoverable behavior and a local Hazelcast instance. |
ReplicatedHazelcastAggregationRepository(String repositoryName,
String persistentRepositoryName,
boolean optimistic)
Creates new
ReplicatedHazelcastAggregationRepository with recoverable behavior and a local Hazelcast
instance. |
ReplicatedHazelcastAggregationRepository(String repositoryName,
String persistentRepositoryName,
boolean optimistic,
com.hazelcast.core.HazelcastInstance hzInstance)
Creates new
ReplicatedHazelcastAggregationRepository with recoverable behavior. |
ReplicatedHazelcastAggregationRepository(String repositoryName,
String persistentRepositoryName,
com.hazelcast.core.HazelcastInstance hzInstanse)
Creates new
ReplicatedHazelcastAggregationRepository that defaults to non-optimistic locking with
recoverable behavior. |
| Modifier and Type | Method and Description |
|---|---|
org.apache.camel.Exchange |
add(org.apache.camel.CamelContext camelContext,
String key,
org.apache.camel.Exchange exchange) |
org.apache.camel.Exchange |
add(org.apache.camel.CamelContext camelContext,
String key,
org.apache.camel.Exchange oldExchange,
org.apache.camel.Exchange newExchange) |
void |
confirm(org.apache.camel.CamelContext camelContext,
String exchangeId) |
boolean |
containsKey(Object key)
Checks if the key in question is in the repository.
|
protected void |
doStart() |
org.apache.camel.Exchange |
get(org.apache.camel.CamelContext camelContext,
String key) |
Set<String> |
getKeys() |
org.apache.camel.Exchange |
recover(org.apache.camel.CamelContext camelContext,
String exchangeId) |
void |
remove(org.apache.camel.CamelContext camelContext,
String key,
org.apache.camel.Exchange exchange)
This method performs transactional operation on removing the
exchange from the operational storage and
moving it into the persistent one if the HazelcastAggregationRepository runs in recoverable mode and
optimistic is false. |
Set<String> |
scan(org.apache.camel.CamelContext camelContext) |
doStop, getDeadLetterUri, getMaximumRedeliveries, getPersistentRepositoryName, getRecoveryIntervalInMillis, isAllowSerializedHeaders, isUseRecovery, setAllowSerializedHeaders, setDeadLetterUri, setMaximumRedeliveries, setRecoveryInterval, setRecoveryInterval, setUseRecovery, unmarshallExchangebuild, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected Map<String,org.apache.camel.support.DefaultExchangeHolder> replicatedCache
public ReplicatedHazelcastAggregationRepository(String repositoryName)
ReplicatedHazelcastAggregationRepository that defaults to non-optimistic locking with
recoverable behavior and a local Hazelcast instance. Recoverable repository name defaults to
repositoryName + "-compeleted".repositoryName - IMap repository name;public ReplicatedHazelcastAggregationRepository(String repositoryName, String persistentRepositoryName)
ReplicatedHazelcastAggregationRepository that defaults to non-optimistic locking with
recoverable behavior and a local Hazelcast instance.repositoryName - IMap repository name;persistentRepositoryName - IMap recoverable repository name;public ReplicatedHazelcastAggregationRepository(String repositoryName, boolean optimistic)
ReplicatedHazelcastAggregationRepository with recoverable behavior and a local Hazelcast
instance. Recoverable repository name defaults to repositoryName + "-compeleted".repositoryName - IMap repository name;optimistic - whether to use optimistic locking manner.public ReplicatedHazelcastAggregationRepository(String repositoryName, String persistentRepositoryName, boolean optimistic)
ReplicatedHazelcastAggregationRepository with recoverable behavior and a local Hazelcast
instance.repositoryName - IMap repository name;persistentRepositoryName - IMap recoverable repository name;optimistic - whether to use optimistic locking manner.public ReplicatedHazelcastAggregationRepository(String repositoryName, com.hazelcast.core.HazelcastInstance hzInstanse)
ReplicatedHazelcastAggregationRepository that defaults to non-optimistic locking with
recoverable behavior. Recoverable repository name defaults to repositoryName + "-compeleted".repositoryName - IMap repository name;hzInstanse - externally configured HazelcastInstance.public ReplicatedHazelcastAggregationRepository(String repositoryName, String persistentRepositoryName, com.hazelcast.core.HazelcastInstance hzInstanse)
ReplicatedHazelcastAggregationRepository that defaults to non-optimistic locking with
recoverable behavior.repositoryName - IMap repository name;persistentRepositoryName - IMap recoverable repository name;hzInstanse - externally configured HazelcastInstance.public ReplicatedHazelcastAggregationRepository(String repositoryName, boolean optimistic, com.hazelcast.core.HazelcastInstance hzInstance)
ReplicatedHazelcastAggregationRepository with recoverable behavior. Recoverable repository
name defaults to repositoryName + "-compeleted".repositoryName - IMap repository name;optimistic - whether to use optimistic locking manner;hzInstance - externally configured HazelcastInstance.public ReplicatedHazelcastAggregationRepository(String repositoryName, String persistentRepositoryName, boolean optimistic, com.hazelcast.core.HazelcastInstance hzInstance)
ReplicatedHazelcastAggregationRepository with recoverable behavior.repositoryName - IMap repository name;optimistic - whether to use optimistic locking manner;persistentRepositoryName - IMap recoverable repository name;hzInstance - externally configured HazelcastInstance.public org.apache.camel.Exchange add(org.apache.camel.CamelContext camelContext,
String key,
org.apache.camel.Exchange oldExchange,
org.apache.camel.Exchange newExchange)
throws org.apache.camel.spi.OptimisticLockingAggregationRepository.OptimisticLockingException
add in interface org.apache.camel.spi.OptimisticLockingAggregationRepositoryadd in class HazelcastAggregationRepositoryorg.apache.camel.spi.OptimisticLockingAggregationRepository.OptimisticLockingExceptionpublic org.apache.camel.Exchange add(org.apache.camel.CamelContext camelContext,
String key,
org.apache.camel.Exchange exchange)
add in interface org.apache.camel.spi.AggregationRepositoryadd in class HazelcastAggregationRepositorypublic Set<String> scan(org.apache.camel.CamelContext camelContext)
scan in interface org.apache.camel.spi.RecoverableAggregationRepositoryscan in class HazelcastAggregationRepositorypublic org.apache.camel.Exchange recover(org.apache.camel.CamelContext camelContext,
String exchangeId)
recover in interface org.apache.camel.spi.RecoverableAggregationRepositoryrecover in class HazelcastAggregationRepositorypublic org.apache.camel.Exchange get(org.apache.camel.CamelContext camelContext,
String key)
get in interface org.apache.camel.spi.AggregationRepositoryget in class HazelcastAggregationRepositorypublic boolean containsKey(Object key)
containsKey in class HazelcastAggregationRepositorykey - Object - key in questionpublic void remove(org.apache.camel.CamelContext camelContext,
String key,
org.apache.camel.Exchange exchange)
exchange from the operational storage and
moving it into the persistent one if the HazelcastAggregationRepository runs in recoverable mode and
optimistic is false. It will act at your own risk otherwise.remove in interface org.apache.camel.spi.AggregationRepositoryremove in interface org.apache.camel.spi.OptimisticLockingAggregationRepositoryremove in class HazelcastAggregationRepositorycamelContext - the current CamelContextkey - the correlation keyexchange - the exchange to removepublic void confirm(org.apache.camel.CamelContext camelContext,
String exchangeId)
confirm in interface org.apache.camel.spi.AggregationRepositoryconfirm in class HazelcastAggregationRepositorypublic Set<String> getKeys()
getKeys in interface org.apache.camel.spi.AggregationRepositorygetKeys in class HazelcastAggregationRepositoryprotected void doStart()
throws Exception
doStart in class HazelcastAggregationRepositoryExceptionApache Camel