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 of
ConsumerTemplate
.-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanUp()
protected void
doBuild()
protected void
doInit()
void
doneUoW
(org.apache.camel.Exchange exchange) protected void
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
int
int
org.apache.camel.Exchange
org.apache.camel.Exchange
org.apache.camel.Exchange
receive
(org.apache.camel.Endpoint endpoint) org.apache.camel.Exchange
receive
(org.apache.camel.Endpoint endpoint, long timeout) receiveBody
(String endpointUri) receiveBody
(String endpointUri, long timeout) <T> T
receiveBody
(String endpointUri, long timeout, Class<T> type) <T> T
receiveBody
(String endpointUri, Class<T> type) receiveBody
(org.apache.camel.Endpoint endpoint) 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) receiveBodyNoWait
(String endpointUri) <T> T
receiveBodyNoWait
(String endpointUri, Class<T> type) 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, 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
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
DefaultConsumerTemplate
public DefaultConsumerTemplate(org.apache.camel.CamelContext camelContext)
-
-
Method Details
-
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
- 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
- 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
- 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
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
- Specified by:
receiveBodyNoWait
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
- Specified by:
receiveBodyNoWait
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBody
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
- Specified by:
receiveBodyNoWait
in interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
- 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
-
extractResultBody
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
- Overrides:
doBuild
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doInit
- Overrides:
doInit
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStart
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStop
- Overrides:
doStop
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doShutdown
- Overrides:
doShutdown
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-