public class JpaConsumer
extends org.apache.camel.support.ScheduledBatchPollingConsumer
Constructor and Description |
---|
JpaConsumer(JpaEndpoint endpoint,
org.apache.camel.Processor processor) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkParameters(Method method) |
protected void |
configureParameters(javax.persistence.Query query) |
protected DeleteHandler<Object> |
createDeleteHandler() |
protected org.apache.camel.Exchange |
createExchange(Object result,
javax.persistence.EntityManager entityManager) |
protected DeleteHandler<Object> |
createPreDeleteHandler() |
protected QueryFactory |
createQueryFactory() |
protected void |
doInit() |
protected void |
doShutdown() |
protected void |
doStop() |
DeleteHandler<Object> |
getDeleteHandler() |
JpaEndpoint |
getEndpoint() |
protected String |
getEntityName(Class<?> clazz) |
javax.persistence.LockModeType |
getLockModeType() |
String |
getNamedQuery() |
String |
getNativeQuery() |
Map<String,Object> |
getParameters() |
DeleteHandler<Object> |
getPreDeleteHandler() |
String |
getQuery() |
QueryFactory |
getQueryFactory() |
Class<?> |
getResultClass() |
boolean |
isSkipLockedEntity() |
boolean |
isTransacted() |
protected boolean |
lockEntity(Object entity,
javax.persistence.EntityManager entityManager)
A strategy method to lock an object with an exclusive lock so that it can be processed
|
protected int |
poll() |
int |
processBatch(Queue<Object> exchanges) |
void |
setDeleteHandler(DeleteHandler<Object> deleteHandler) |
void |
setLockModeType(javax.persistence.LockModeType lockModeType) |
void |
setNamedQuery(String namedQuery) |
void |
setNativeQuery(String nativeQuery) |
void |
setParameters(Map<String,Object> params) |
void |
setPreDeleteHandler(DeleteHandler<Object> preDeleteHandler) |
void |
setQuery(String query) |
void |
setQueryFactory(QueryFactory queryFactory) |
void |
setResultClass(Class<?> resultClass) |
void |
setSkipLockedEntity(boolean skipLockedEntity)
Sets whether to use NOWAIT on lock and silently skip the entity.
|
void |
setTransacted(boolean transacted)
Sets whether to run in transacted mode or not.
|
deferShutdown, getMaxMessagesPerPoll, getPendingExchangesSize, isBatchAllowed, prepareShutdown, processEmptyMessage, setMaxMessagesPerPoll
afterPoll, beforePoll, doStart, doSuspend, getBackoffCounter, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isPollAllowed, isPolling, isSchedulerStarted, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, onInit, run, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay, startScheduler
createUoW, doneUoW, getAsyncProcessor, getExceptionHandler, getProcessor, getRoute, getRouteId, handleException, handleException, setExceptionHandler, setRoute, setRouteId, toString
build, doBuild, doFail, doLifecycleChange, doResume, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public JpaConsumer(JpaEndpoint endpoint, org.apache.camel.Processor processor)
protected int poll() throws Exception
poll
in class org.apache.camel.support.ScheduledPollConsumer
Exception
public JpaEndpoint getEndpoint()
getEndpoint
in interface org.apache.camel.EndpointAware
getEndpoint
in class org.apache.camel.support.DefaultConsumer
public QueryFactory getQueryFactory()
public void setQueryFactory(QueryFactory queryFactory)
public DeleteHandler<Object> getDeleteHandler()
public void setDeleteHandler(DeleteHandler<Object> deleteHandler)
public DeleteHandler<Object> getPreDeleteHandler()
public void setPreDeleteHandler(DeleteHandler<Object> preDeleteHandler)
public String getNamedQuery()
public void setNamedQuery(String namedQuery)
public javax.persistence.LockModeType getLockModeType()
public void setLockModeType(javax.persistence.LockModeType lockModeType)
public String getNativeQuery()
public void setNativeQuery(String nativeQuery)
public String getQuery()
public void setQuery(String query)
public Class<?> getResultClass()
public void setResultClass(Class<?> resultClass)
public boolean isTransacted()
public void setTransacted(boolean transacted)
public void setSkipLockedEntity(boolean skipLockedEntity)
public boolean isSkipLockedEntity()
protected boolean lockEntity(Object entity, javax.persistence.EntityManager entityManager)
entity
- the entity to be lockedentityManager
- entity managerprotected QueryFactory createQueryFactory()
protected DeleteHandler<Object> createPreDeleteHandler()
protected DeleteHandler<Object> createDeleteHandler()
protected boolean checkParameters(Method method)
protected void configureParameters(javax.persistence.Query query)
protected org.apache.camel.Exchange createExchange(Object result, javax.persistence.EntityManager entityManager)
protected void doInit() throws Exception
doInit
in class org.apache.camel.support.ScheduledPollConsumer
Exception
protected void doStop() throws Exception
doStop
in class org.apache.camel.support.ScheduledPollConsumer
Exception
Apache Camel