Class JpaMessageIdRepository
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.processor.idempotent.jpa.JpaMessageIdRepository
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.IdempotentRepository
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@ManagedResource(description="JPA based message id repository") public class JpaMessageIdRepository extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.spi.IdempotentRepository
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
QUERY_CLEAR_STRING
protected static String
QUERY_STRING
-
Constructor Summary
Constructors Constructor Description JpaMessageIdRepository(javax.persistence.EntityManagerFactory entityManagerFactory, String processorName)
JpaMessageIdRepository(javax.persistence.EntityManagerFactory entityManagerFactory, org.springframework.transaction.support.TransactionTemplate transactionTemplate, String processorName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(String messageId)
boolean
add(org.apache.camel.Exchange exchange, String messageId)
void
clear()
boolean
confirm(String messageId)
boolean
confirm(org.apache.camel.Exchange exchange, String messageId)
boolean
contains(String messageId)
boolean
contains(org.apache.camel.Exchange exchange, String messageId)
protected void
doStart()
protected void
doStop()
String
getProcessorName()
boolean
isJoinTransaction()
boolean
isSharedEntityManager()
static JpaMessageIdRepository
jpaMessageIdRepository(String persistenceUnit, String processorName)
static JpaMessageIdRepository
jpaMessageIdRepository(javax.persistence.EntityManagerFactory entityManagerFactory, String processorName)
boolean
remove(String messageId)
boolean
remove(org.apache.camel.Exchange exchange, String messageId)
void
setJoinTransaction(boolean joinTransaction)
void
setSharedEntityManager(boolean sharedEntityManager)
-
Methods inherited from class org.apache.camel.support.service.BaseService
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, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
JpaMessageIdRepository
public JpaMessageIdRepository(javax.persistence.EntityManagerFactory entityManagerFactory, String processorName)
-
JpaMessageIdRepository
public JpaMessageIdRepository(javax.persistence.EntityManagerFactory entityManagerFactory, org.springframework.transaction.support.TransactionTemplate transactionTemplate, String processorName)
-
-
Method Detail
-
jpaMessageIdRepository
public static JpaMessageIdRepository jpaMessageIdRepository(String persistenceUnit, String processorName)
-
jpaMessageIdRepository
public static JpaMessageIdRepository jpaMessageIdRepository(javax.persistence.EntityManagerFactory entityManagerFactory, String processorName)
-
add
@ManagedOperation(description="Adds the key to the store") public boolean add(String messageId)
- Specified by:
add
in interfaceorg.apache.camel.spi.IdempotentRepository
-
add
public boolean add(org.apache.camel.Exchange exchange, String messageId)
- Specified by:
add
in interfaceorg.apache.camel.spi.IdempotentRepository
-
contains
@ManagedOperation(description="Does the store contain the given key") public boolean contains(String messageId)
- Specified by:
contains
in interfaceorg.apache.camel.spi.IdempotentRepository
-
contains
public boolean contains(org.apache.camel.Exchange exchange, String messageId)
- Specified by:
contains
in interfaceorg.apache.camel.spi.IdempotentRepository
-
remove
@ManagedOperation(description="Remove the key from the store") public boolean remove(String messageId)
- Specified by:
remove
in interfaceorg.apache.camel.spi.IdempotentRepository
-
remove
public boolean remove(org.apache.camel.Exchange exchange, String messageId)
- Specified by:
remove
in interfaceorg.apache.camel.spi.IdempotentRepository
-
confirm
public boolean confirm(String messageId)
- Specified by:
confirm
in interfaceorg.apache.camel.spi.IdempotentRepository
-
confirm
public boolean confirm(org.apache.camel.Exchange exchange, String messageId)
- Specified by:
confirm
in interfaceorg.apache.camel.spi.IdempotentRepository
-
clear
@ManagedOperation(description="Clear the store") public void clear()
- Specified by:
clear
in interfaceorg.apache.camel.spi.IdempotentRepository
-
getProcessorName
@ManagedAttribute(description="The processor name") public String getProcessorName()
-
isJoinTransaction
@ManagedAttribute(description="Whether to join existing transaction") public boolean isJoinTransaction()
-
setJoinTransaction
public void setJoinTransaction(boolean joinTransaction)
-
isSharedEntityManager
@ManagedAttribute(description="Whether to use shared EntityManager") public boolean isSharedEntityManager()
-
setSharedEntityManager
public void setSharedEntityManager(boolean sharedEntityManager)
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
-