|
||||||||||
| 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.impl.DefaultConsumer
org.apache.camel.impl.ScheduledPollConsumer
org.apache.camel.component.jpa.JpaConsumer
public class JpaConsumer
| Field Summary |
|---|
| Fields inherited from class org.apache.camel.impl.DefaultConsumer |
|---|
log |
| Constructor Summary | |
|---|---|
JpaConsumer(JpaEndpoint endpoint,
Processor processor)
|
|
| Method Summary | |
|---|---|
protected void |
configureParameters(Query query)
|
protected DeleteHandler<Object> |
createDeleteHandler()
|
protected Exchange |
createExchange(Object result)
|
protected QueryFactory |
createQueryFactory()
|
boolean |
deferShutdown(ShutdownRunningTask shutdownRunningTask)
To defer shutdown during first phase of shutdown. |
DeleteHandler<Object> |
getDeleteHandler()
|
JpaEndpoint |
getEndpoint()
Gets the endpoint this Consumer consumes from. |
protected String |
getEntityName(Class<?> clazz)
|
String |
getNamedQuery()
|
String |
getNativeQuery()
|
int |
getPendingExchangesSize()
Gets the number of pending exchanges. |
String |
getQuery()
|
QueryFactory |
getQueryFactory()
|
boolean |
isBatchAllowed()
Whether processing the batch is still allowed. |
protected boolean |
lockEntity(Object entity,
EntityManager entityManager)
A strategy method to lock an object with an exclusive lock so that it can be processed |
protected void |
poll()
The polling method which is invoked periodically to poll this consumer |
void |
processBatch(Queue<Object> exchanges)
Processes the list of Exchange in a batch. |
void |
setDeleteHandler(DeleteHandler<Object> deleteHandler)
|
void |
setMaxMessagesPerPoll(int maxMessagesPerPoll)
Sets a maximum number of messages as a limit to poll at each polling. |
void |
setNamedQuery(String namedQuery)
|
void |
setNativeQuery(String nativeQuery)
|
void |
setQuery(String query)
|
void |
setQueryFactory(QueryFactory queryFactory)
|
| Methods inherited from class org.apache.camel.impl.ScheduledPollConsumer |
|---|
doStart, doStop, getDelay, getInitialDelay, getPollStrategy, getTimeUnit, isPollAllowed, isSuspended, isUseFixedDelay, resume, run, setDelay, setInitialDelay, setPollStrategy, setTimeUnit, setUseFixedDelay, suspend |
| Methods inherited from class org.apache.camel.impl.DefaultConsumer |
|---|
getExceptionHandler, getProcessor, handleException, setExceptionHandler, toString |
| Methods inherited from class org.apache.camel.impl.ServiceSupport |
|---|
addChildService, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Constructor Detail |
|---|
public JpaConsumer(JpaEndpoint endpoint,
Processor processor)
| Method Detail |
|---|
protected void poll()
throws Exception
ScheduledPollConsumer
poll in class ScheduledPollConsumerException - can be thrown if an exception occurred during pollingpublic void setMaxMessagesPerPoll(int maxMessagesPerPoll)
BatchConsumer
setMaxMessagesPerPoll in interface BatchConsumermaxMessagesPerPoll - maximum messages to poll.
public void processBatch(Queue<Object> exchanges)
throws Exception
BatchConsumerExchange in a batch.
Each message exchange will be processed individually but the batch
consumer will add properties with the current index and total in the batch.
The items in the Queue may actually be Holder objects that store other
data alongside the Exchange.
processBatch in interface BatchConsumerexchanges - list of items in this batch
Exception - if an internal processing error has occurred.public boolean deferShutdown(ShutdownRunningTask shutdownRunningTask)
ShutdownAwareSedaConsumer.
deferShutdown in interface ShutdownAwareshutdownRunningTask - the configured option for how to act when shutting down running tasks.
public int getPendingExchangesSize()
ShutdownAwareExchange which are pending.
For example the SedaConsumer.
Return zero to indicate no pending exchanges and therefore ready to shutdown.
getPendingExchangesSize in interface ShutdownAwarepublic boolean isBatchAllowed()
BatchConsumer
isBatchAllowed in interface BatchConsumerShutdownRunningTaskpublic JpaEndpoint getEndpoint()
ConsumerConsumer consumes from.
getEndpoint in interface ConsumergetEndpoint in class DefaultConsumerpublic QueryFactory getQueryFactory()
public void setQueryFactory(QueryFactory queryFactory)
public DeleteHandler<Object> getDeleteHandler()
public void setDeleteHandler(DeleteHandler<Object> deleteHandler)
public String getNamedQuery()
public void setNamedQuery(String namedQuery)
public String getNativeQuery()
public void setNativeQuery(String nativeQuery)
public String getQuery()
public void setQuery(String query)
protected boolean lockEntity(Object entity,
EntityManager entityManager)
entity - the entity to be lockedentityManager - entity manager
protected QueryFactory createQueryFactory()
protected String getEntityName(Class<?> clazz)
protected DeleteHandler<Object> createDeleteHandler()
protected void configureParameters(Query query)
protected Exchange createExchange(Object result)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||