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.ConsumerTemplate
Default 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 void
cleanUp()
protected void
doInit()
void
doneUoW(org.apache.camel.Exchange exchange)
protected void
doShutdown()
protected void
doStart()
protected void
doStop()
protected Object
extractResultBody(org.apache.camel.Exchange result)
Extracts the body from the given result.org.apache.camel.CamelContext
getCamelContext()
int
getCurrentCacheSize()
int
getMaximumCacheSize()
org.apache.camel.Exchange
receive(String endpointUri)
org.apache.camel.Exchange
receive(String endpointUri, long timeout)
org.apache.camel.Exchange
receive(org.apache.camel.Endpoint endpoint)
org.apache.camel.Exchange
receive(org.apache.camel.Endpoint endpoint, long timeout)
Object
receiveBody(String endpointUri)
Object
receiveBody(String endpointUri, long timeout)
<T> T
receiveBody(String endpointUri, long timeout, Class<T> type)
<T> T
receiveBody(String endpointUri, Class<T> type)
Object
receiveBody(org.apache.camel.Endpoint endpoint)
Object
receiveBody(org.apache.camel.Endpoint endpoint, long timeout)
<T> T
receiveBody(org.apache.camel.Endpoint endpoint, long timeout, Class<T> type)
<T> T
receiveBody(org.apache.camel.Endpoint endpoint, Class<T> type)
Object
receiveBodyNoWait(String endpointUri)
<T> T
receiveBodyNoWait(String endpointUri, Class<T> type)
Object
receiveBodyNoWait(org.apache.camel.Endpoint endpoint)
<T> T
receiveBodyNoWait(org.apache.camel.Endpoint endpoint, Class<T> type)
org.apache.camel.Exchange
receiveNoWait(String endpointUri)
org.apache.camel.Exchange
receiveNoWait(org.apache.camel.Endpoint endpoint)
protected org.apache.camel.Endpoint
resolveMandatoryEndpoint(String endpointUri)
void
setMaximumCacheSize(int maximumCacheSize)
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, 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:
getMaximumCacheSize
in interfaceorg.apache.camel.ConsumerTemplate
-
setMaximumCacheSize
public void setMaximumCacheSize(int maximumCacheSize)
- Specified by:
setMaximumCacheSize
in interfaceorg.apache.camel.ConsumerTemplate
-
getCurrentCacheSize
public int getCurrentCacheSize()
- Specified by:
getCurrentCacheSize
in interfaceorg.apache.camel.ConsumerTemplate
-
cleanUp
public void cleanUp()
- Specified by:
cleanUp
in interfaceorg.apache.camel.ConsumerTemplate
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()
- Specified by:
getCamelContext
in interfaceorg.apache.camel.ConsumerTemplate
-
receive
public org.apache.camel.Exchange receive(String endpointUri)
- Specified by:
receive
in interfaceorg.apache.camel.ConsumerTemplate
-
receive
public org.apache.camel.Exchange receive(org.apache.camel.Endpoint endpoint)
- Specified by:
receive
in interfaceorg.apache.camel.ConsumerTemplate
-
receive
public org.apache.camel.Exchange receive(String endpointUri, long timeout)
- Specified by:
receive
in interfaceorg.apache.camel.ConsumerTemplate
-
receive
public org.apache.camel.Exchange receive(org.apache.camel.Endpoint endpoint, long timeout)
- Specified by:
receive
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveNoWait
public org.apache.camel.Exchange receiveNoWait(String endpointUri)
- Specified by:
receiveNoWait
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveNoWait
public org.apache.camel.Exchange receiveNoWait(org.apache.camel.Endpoint endpoint)
- Specified by:
receiveNoWait
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public Object receiveBody(String endpointUri)
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public Object receiveBody(org.apache.camel.Endpoint endpoint)
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public Object receiveBody(String endpointUri, long timeout)
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public Object receiveBody(org.apache.camel.Endpoint endpoint, long timeout)
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
public Object receiveBodyNoWait(String endpointUri)
- Specified by:
receiveBodyNoWait
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
public Object receiveBodyNoWait(org.apache.camel.Endpoint endpoint)
- Specified by:
receiveBodyNoWait
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public <T> T receiveBody(String endpointUri, Class<T> type)
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public <T> T receiveBody(org.apache.camel.Endpoint endpoint, Class<T> type)
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public <T> T receiveBody(String endpointUri, long timeout, Class<T> type)
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
public <T> T receiveBody(org.apache.camel.Endpoint endpoint, long timeout, Class<T> type)
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
public <T> T receiveBodyNoWait(String endpointUri, Class<T> type)
- Specified by:
receiveBodyNoWait
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
public <T> T receiveBodyNoWait(org.apache.camel.Endpoint endpoint, Class<T> type)
- Specified by:
receiveBodyNoWait
in interfaceorg.apache.camel.ConsumerTemplate
-
doneUoW
public void doneUoW(org.apache.camel.Exchange exchange)
- Specified by:
doneUoW
in 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.
-
doInit
protected void doInit() throws Exception
- Overrides:
doInit
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
-