Package org.apache.camel.impl.engine
Class DefaultConsumerTemplate
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.impl.engine.DefaultConsumerTemplate
-
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.ConsumerTemplate,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
public class DefaultConsumerTemplate extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.ConsumerTemplateDefault implementation ofConsumerTemplate.
-
-
Constructor Summary
Constructors Constructor Description DefaultConsumerTemplate(org.apache.camel.CamelContext camelContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()protected voiddoBuild()protected voiddoInit()voiddoneUoW(org.apache.camel.Exchange exchange)protected voiddoShutdown()protected voiddoStart()protected voiddoStop()protected ObjectextractResultBody(org.apache.camel.Exchange result)Extracts the body from the given result.org.apache.camel.CamelContextgetCamelContext()intgetCurrentCacheSize()intgetMaximumCacheSize()org.apache.camel.Exchangereceive(String endpointUri)org.apache.camel.Exchangereceive(String endpointUri, long timeout)org.apache.camel.Exchangereceive(org.apache.camel.Endpoint endpoint)org.apache.camel.Exchangereceive(org.apache.camel.Endpoint endpoint, long timeout)ObjectreceiveBody(String endpointUri)ObjectreceiveBody(String endpointUri, long timeout)<T> TreceiveBody(String endpointUri, long timeout, Class<T> type)<T> TreceiveBody(String endpointUri, Class<T> type)ObjectreceiveBody(org.apache.camel.Endpoint endpoint)ObjectreceiveBody(org.apache.camel.Endpoint endpoint, long timeout)<T> TreceiveBody(org.apache.camel.Endpoint endpoint, long timeout, Class<T> type)<T> TreceiveBody(org.apache.camel.Endpoint endpoint, Class<T> type)ObjectreceiveBodyNoWait(String endpointUri)<T> TreceiveBodyNoWait(String endpointUri, Class<T> type)ObjectreceiveBodyNoWait(org.apache.camel.Endpoint endpoint)<T> TreceiveBodyNoWait(org.apache.camel.Endpoint endpoint, Class<T> type)org.apache.camel.ExchangereceiveNoWait(String endpointUri)org.apache.camel.ExchangereceiveNoWait(org.apache.camel.Endpoint endpoint)protected org.apache.camel.EndpointresolveMandatoryEndpoint(String endpointUri)voidsetMaximumCacheSize(int maximumCacheSize)-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doFail, doLifecycleChange, doResume, 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
-
-
-
-
Method Detail
-
getMaximumCacheSize
public int getMaximumCacheSize()
- Specified by:
getMaximumCacheSizein interfaceorg.apache.camel.ConsumerTemplate
-
setMaximumCacheSize
public void setMaximumCacheSize(int maximumCacheSize)
- Specified by:
setMaximumCacheSizein interfaceorg.apache.camel.ConsumerTemplate
-
getCurrentCacheSize
public int getCurrentCacheSize()
- Specified by:
getCurrentCacheSizein interfaceorg.apache.camel.ConsumerTemplate
-
cleanUp
public void cleanUp()
- Specified by:
cleanUpin interfaceorg.apache.camel.ConsumerTemplate
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()
- Specified by:
getCamelContextin interfaceorg.apache.camel.ConsumerTemplate
-
receive
public org.apache.camel.Exchange receive(String endpointUri)
- Specified by:
receivein interfaceorg.apache.camel.ConsumerTemplate
-
receive
public org.apache.camel.Exchange receive(org.apache.camel.Endpoint endpoint)
- Specified by:
receivein interfaceorg.apache.camel.ConsumerTemplate
-
receive
public org.apache.camel.Exchange receive(String endpointUri, long timeout)
- Specified by:
receivein interfaceorg.apache.camel.ConsumerTemplate
-
receive
public org.apache.camel.Exchange receive(org.apache.camel.Endpoint endpoint, long timeout)- Specified by:
receivein interfaceorg.apache.camel.ConsumerTemplate
-
receiveNoWait
public org.apache.camel.Exchange receiveNoWait(String endpointUri)
- Specified by:
receiveNoWaitin interfaceorg.apache.camel.ConsumerTemplate
-
receiveNoWait
public org.apache.camel.Exchange receiveNoWait(org.apache.camel.Endpoint endpoint)
- Specified by:
receiveNoWaitin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public Object receiveBody(String endpointUri)
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public Object receiveBody(org.apache.camel.Endpoint endpoint)
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public Object receiveBody(String endpointUri, long timeout)
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public Object receiveBody(org.apache.camel.Endpoint endpoint, long timeout)
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
public Object receiveBodyNoWait(String endpointUri)
- Specified by:
receiveBodyNoWaitin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
public Object receiveBodyNoWait(org.apache.camel.Endpoint endpoint)
- Specified by:
receiveBodyNoWaitin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public <T> T receiveBody(String endpointUri, Class<T> type)
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public <T> T receiveBody(org.apache.camel.Endpoint endpoint, Class<T> type)- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public <T> T receiveBody(String endpointUri, long timeout, Class<T> type)
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public <T> T receiveBody(org.apache.camel.Endpoint endpoint, long timeout, Class<T> type)- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
public <T> T receiveBodyNoWait(String endpointUri, Class<T> type)
- Specified by:
receiveBodyNoWaitin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
public <T> T receiveBodyNoWait(org.apache.camel.Endpoint endpoint, Class<T> type)- Specified by:
receiveBodyNoWaitin interfaceorg.apache.camel.ConsumerTemplate
-
doneUoW
public void doneUoW(org.apache.camel.Exchange exchange)
- Specified by:
doneUoWin interfaceorg.apache.camel.ConsumerTemplate
-
resolveMandatoryEndpoint
protected org.apache.camel.Endpoint resolveMandatoryEndpoint(String endpointUri)
-
extractResultBody
protected Object extractResultBody(org.apache.camel.Exchange result)
Extracts the body from the given result. If the exchange pattern is provided it will try to honor it and retrieve the body from either IN or OUT according to the pattern.- Parameters:
result- the result- Returns:
- the result, can be null.
-
doBuild
protected void doBuild() throws Exception- Overrides:
doBuildin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doInit
protected void doInit() throws Exception- Overrides:
doInitin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStart
protected void doStart() throws Exception- Overrides:
doStartin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStop
protected void doStop() throws Exception- Overrides:
doStopin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
-