org.apache.camel.processor.idempotent
Class MemoryMessageIdRepository

java.lang.Object
  extended by org.apache.camel.processor.idempotent.MemoryMessageIdRepository
All Implemented Interfaces:
MessageIdRepository

public class MemoryMessageIdRepository
extends Object
implements MessageIdRepository

A memory based implementation of MessageIdRepository. Care should be taken to use a suitable underlying Map to avoid this class being a memory leak

Version:
$Revision: 35332 $

Constructor Summary
MemoryMessageIdRepository(Map set)
           
 
Method Summary
 boolean contains(String messageId)
          Returns true if this messageId has been processed before otherwise this messageId is added to the repository and false is returned.
static MessageIdRepository memoryMessageIdRepository()
          Creates a new MemoryMessageIdRepository with a memory based respository.
static MessageIdRepository memoryMessageIdRepository(int cacheSize)
          Creates a new MemoryMessageIdRepository with a memory based respository.
static MessageIdRepository memoryMessageIdRepository(Map cache)
          Creates a new MemoryMessageIdRepository using the given Map to use to store the processed Message ID objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryMessageIdRepository

public MemoryMessageIdRepository(Map set)
Method Detail

memoryMessageIdRepository

public static MessageIdRepository memoryMessageIdRepository()
Creates a new MemoryMessageIdRepository with a memory based respository. Warning this method should only really be used for testing as it will involve keeping all message IDs in RAM.


memoryMessageIdRepository

public static MessageIdRepository memoryMessageIdRepository(int cacheSize)
Creates a new MemoryMessageIdRepository with a memory based respository. Warning this method should only really be used for testing as it will involve keeping all message IDs in RAM.


memoryMessageIdRepository

public static MessageIdRepository memoryMessageIdRepository(Map cache)
Creates a new MemoryMessageIdRepository using the given Map to use to store the processed Message ID objects. Warning be cafeful of the implementation of Map you use as if you are not careful it could be a memory leak.


contains

public boolean contains(String messageId)
Description copied from interface: MessageIdRepository
Returns true if this messageId has been processed before otherwise this messageId is added to the repository and false is returned.

Specified by:
contains in interface MessageIdRepository
Parameters:
messageId - the String ID of the message
Returns:
true if the message has been processed succesfully before otherwise false


Copyright © 2008 IONA Open Source Community. All Rights Reserved.