|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.ServiceSupport
org.apache.camel.processor.idempotent.MemoryIdempotentRepository
@ManagedResource(value="MemoryIdempotentRepository") public class MemoryIdempotentRepository
A memory based implementation of IdempotentRepository.
Map to avoid this class being a
memory leak.
| Constructor Summary | |
|---|---|
MemoryIdempotentRepository()
|
|
MemoryIdempotentRepository(Map<String,Object> set)
|
|
| Method Summary | |
|---|---|
boolean |
add(String key)
Adds the key to the repository. |
boolean |
confirm(String key)
Confirms the key, after the exchange has been processed successfully. |
boolean |
contains(String key)
Returns true if this repository contains the specified element. |
protected void |
doStart()
|
protected void |
doStop()
|
Map<String,Object> |
getCache()
|
int |
getCacheSize()
|
static IdempotentRepository<String> |
memoryIdempotentRepository()
Creates a new memory based repository using a LRUCache
with a default of 1000 entries in the cache. |
static IdempotentRepository<String> |
memoryIdempotentRepository(int cacheSize)
Creates a new memory based repository using a LRUCache. |
static IdempotentRepository<String> |
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)
Removes the key from the repository. |
void |
setCacheSize(int cacheSize)
|
| Methods inherited from class org.apache.camel.impl.ServiceSupport |
|---|
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Constructor Detail |
|---|
public MemoryIdempotentRepository()
public MemoryIdempotentRepository(Map<String,Object> set)
| Method Detail |
|---|
public static IdempotentRepository<String> memoryIdempotentRepository()
LRUCache
with a default of 1000 entries in the cache.
public static IdempotentRepository<String> memoryIdempotentRepository(int cacheSize)
LRUCache.
cacheSize - the cache sizepublic static IdempotentRepository<String> 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)
IdempotentRepository
add in interface IdempotentRepository<String>key - the key of the message for duplicate test
@ManagedOperation(description="Does the store contain the given key") public boolean contains(String key)
IdempotentRepository
contains in interface IdempotentRepository<String>key - the key of the message
@ManagedOperation(description="Remove the key from the store") public boolean remove(String key)
IdempotentRepository
remove in interface IdempotentRepository<String>key - the key of the message for duplicate test
public boolean confirm(String key)
IdempotentRepository
confirm in interface IdempotentRepository<String>key - the key of the message for duplicate test
public Map<String,Object> getCache()
@ManagedAttribute(description="The current cache size") public int getCacheSize()
public void setCacheSize(int cacheSize)
protected void doStart()
throws Exception
doStart in class ServiceSupportException
protected void doStop()
throws Exception
doStop in class ServiceSupportException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||