@ManagedResource(description="Memory based idempotent repository")
public class MemoryIdempotentRepository
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.IdempotentRepository
IdempotentRepository.
Care should be taken to use a suitable underlying Map to avoid this class being a memory leak.| Constructor and Description |
|---|
MemoryIdempotentRepository() |
MemoryIdempotentRepository(Map<String,Object> set) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String key) |
void |
clear() |
boolean |
confirm(String key) |
boolean |
contains(String key) |
protected void |
doStart() |
protected void |
doStop() |
Map<String,Object> |
getCache() |
int |
getCacheSize() |
static org.apache.camel.spi.IdempotentRepository |
memoryIdempotentRepository()
Creates a new memory based repository using a
LRUCache with a default of 1000 entries in the cache. |
static org.apache.camel.spi.IdempotentRepository |
memoryIdempotentRepository(int cacheSize)
Creates a new memory based repository using a
LRUCache. |
static org.apache.camel.spi.IdempotentRepository |
memoryIdempotentRepository(Map<String,Object> cache)
Creates a new memory based repository using the given
Map to use to store the processed message ids. |
boolean |
remove(String key) |
void |
setCacheSize(int cacheSize) |
build, 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, waitadd, confirm, contains, removepublic static org.apache.camel.spi.IdempotentRepository memoryIdempotentRepository()
LRUCache with a default of 1000 entries in the cache.public static org.apache.camel.spi.IdempotentRepository memoryIdempotentRepository(int cacheSize)
LRUCache.cacheSize - the cache sizepublic static org.apache.camel.spi.IdempotentRepository memoryIdempotentRepository(Map<String,Object> cache)
Map to use to store the processed message ids.
Care should be taken to use a suitable underlying Map to avoid this class being a memory leak.cache - the cache@ManagedOperation(description="Adds the key to the store") public boolean add(String key)
add in interface org.apache.camel.spi.IdempotentRepository@ManagedOperation(description="Does the store contain the given key") public boolean contains(String key)
contains in interface org.apache.camel.spi.IdempotentRepository@ManagedOperation(description="Remove the key from the store") public boolean remove(String key)
remove in interface org.apache.camel.spi.IdempotentRepositorypublic boolean confirm(String key)
confirm in interface org.apache.camel.spi.IdempotentRepository@ManagedOperation(description="Clear the store") public void clear()
clear in interface org.apache.camel.spi.IdempotentRepository@ManagedAttribute(description="The current cache size") public int getCacheSize()
public void setCacheSize(int cacheSize)
protected void doStart()
throws Exception
doStart in class org.apache.camel.support.service.BaseServiceExceptionApache Camel