org.apache.camel.component.jpa
Class JpaConsumer
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultConsumer
org.apache.camel.impl.ScheduledPollConsumer
org.apache.camel.component.jpa.JpaConsumer
- All Implemented Interfaces:
- Runnable, BatchConsumer, Consumer, Service, ShutdownAware, SuspendableService
public class JpaConsumer
- extends ScheduledPollConsumer
- implements BatchConsumer, ShutdownAware
- Version:
- $Revision: 893983 $
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.ServiceSupport |
addChildService, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, start, stop |
JpaConsumer
public JpaConsumer(JpaEndpoint endpoint,
Processor processor)
poll
protected void poll()
throws Exception
- Specified by:
poll
in class ScheduledPollConsumer
- Throws:
Exception
setMaxMessagesPerPoll
public void setMaxMessagesPerPoll(int maxMessagesPerPoll)
- Specified by:
setMaxMessagesPerPoll
in interface BatchConsumer
processBatch
public void processBatch(Queue<Object> exchanges)
throws Exception
- Specified by:
processBatch
in interface BatchConsumer
- Throws:
Exception
deferShutdown
public boolean deferShutdown(ShutdownRunningTask shutdownRunningTask)
- Specified by:
deferShutdown
in interface ShutdownAware
getPendingExchangesSize
public int getPendingExchangesSize()
- Specified by:
getPendingExchangesSize
in interface ShutdownAware
isBatchAllowed
public boolean isBatchAllowed()
- Specified by:
isBatchAllowed
in interface BatchConsumer
getEndpoint
public JpaEndpoint getEndpoint()
- Specified by:
getEndpoint
in interface Consumer
- Overrides:
getEndpoint
in class DefaultConsumer
getQueryFactory
public QueryFactory getQueryFactory()
setQueryFactory
public void setQueryFactory(QueryFactory queryFactory)
getDeleteHandler
public DeleteHandler<Object> getDeleteHandler()
setDeleteHandler
public void setDeleteHandler(DeleteHandler<Object> deleteHandler)
getNamedQuery
public String getNamedQuery()
setNamedQuery
public void setNamedQuery(String namedQuery)
getNativeQuery
public String getNativeQuery()
setNativeQuery
public void setNativeQuery(String nativeQuery)
getQuery
public String getQuery()
setQuery
public void setQuery(String query)
lockEntity
protected boolean lockEntity(Object entity,
EntityManager entityManager)
- A strategy method to lock an object with an exclusive lock so that it can
be processed
- Parameters:
entity
- the entity to be lockedentityManager
- entity manager
- Returns:
- true if the entity was locked
createQueryFactory
protected QueryFactory createQueryFactory()
getEntityName
protected String getEntityName(Class<?> clazz)
createDeleteHandler
protected DeleteHandler<Object> createDeleteHandler()
configureParameters
protected void configureParameters(Query query)
createExchange
protected Exchange createExchange(Object result)
Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.