org.apache.camel.processor.idempotent.jpa
Class JpaMessageIdRepository

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.processor.idempotent.jpa.JpaMessageIdRepository
All Implemented Interfaces:
Service, ShutdownableService, IdempotentRepository<String>

@ManagedResource(value="JpaMessageIdRepository")
public class JpaMessageIdRepository
extends ServiceSupport
implements IdempotentRepository<String>

Version:

Field Summary
protected static String QUERY_STRING
           
 
Constructor Summary
JpaMessageIdRepository(org.springframework.orm.jpa.JpaTemplate template, String processorName)
           
JpaMessageIdRepository(org.springframework.orm.jpa.JpaTemplate template, org.springframework.transaction.support.TransactionTemplate transactionTemplate, String processorName)
           
 
Method Summary
 boolean add(String messageId)
          Adds the key to the repository.
 boolean confirm(String s)
          Confirms the key, after the exchange has been processed successfully.
 boolean contains(String messageId)
          Returns true if this repository contains the specified element.
protected  void doStart()
           
protected  void doStop()
           
 String getProcessorName()
           
static JpaMessageIdRepository jpaMessageIdRepository(org.springframework.orm.jpa.JpaTemplate jpaTemplate, String processorName)
           
static JpaMessageIdRepository jpaMessageIdRepository(String persistenceUnit, String processorName)
           
 boolean remove(String messageId)
          Removes the key from the repository.
 
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
 

Field Detail

QUERY_STRING

protected static final String QUERY_STRING
Constructor Detail

JpaMessageIdRepository

public JpaMessageIdRepository(org.springframework.orm.jpa.JpaTemplate template,
                              String processorName)

JpaMessageIdRepository

public JpaMessageIdRepository(org.springframework.orm.jpa.JpaTemplate template,
                              org.springframework.transaction.support.TransactionTemplate transactionTemplate,
                              String processorName)
Method Detail

jpaMessageIdRepository

public static JpaMessageIdRepository jpaMessageIdRepository(String persistenceUnit,
                                                            String processorName)

jpaMessageIdRepository

public static JpaMessageIdRepository jpaMessageIdRepository(org.springframework.orm.jpa.JpaTemplate jpaTemplate,
                                                            String processorName)

add

@ManagedOperation(description="Adds the key to the store")
public boolean add(String messageId)
Description copied from interface: IdempotentRepository
Adds the key to the repository.

Specified by:
add in interface IdempotentRepository<String>
Parameters:
messageId - the key of the message for duplicate test
Returns:
true if this repository did not already contain the specified element

contains

@ManagedOperation(description="Does the store contain the given key")
public boolean contains(String messageId)
Description copied from interface: IdempotentRepository
Returns true if this repository contains the specified element.

This operation is used if the option eager has been enabled.

Specified by:
contains in interface IdempotentRepository<String>
Parameters:
messageId - the key of the message
Returns:
true if this repository contains the specified element

remove

@ManagedOperation(description="Remove the key from the store")
public boolean remove(String messageId)
Description copied from interface: IdempotentRepository
Removes the key from the repository.

Is usually invoked if the exchange failed.

Specified by:
remove in interface IdempotentRepository<String>
Parameters:
messageId - the key of the message for duplicate test
Returns:
true if the key was removed

confirm

public boolean confirm(String s)
Description copied from interface: IdempotentRepository
Confirms the key, after the exchange has been processed successfully.

This operation is used if the option eager has been enabled.

Specified by:
confirm in interface IdempotentRepository<String>
Parameters:
s - the key of the message for duplicate test
Returns:
true if the key was confirmed

getProcessorName

@ManagedAttribute(description="The processor name")
public String getProcessorName()

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class ServiceSupport
Throws:
Exception


Apache CAMEL