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 TypeMethodDescriptionvoidcleanUp()protected voiddoBuild()protected voiddoInit()voiddoneUoW(org.apache.camel.Exchange exchange) protected voidprotected voiddoStart()protected voiddoStop()protected ObjectextractResultBody(org.apache.camel.Exchange result) Extracts the body from the given result.org.apache.camel.CamelContextintintorg.apache.camel.Exchangeorg.apache.camel.Exchangeorg.apache.camel.Exchangereceive(org.apache.camel.Endpoint endpoint) org.apache.camel.Exchangereceive(org.apache.camel.Endpoint endpoint, long timeout) receiveBody(String endpointUri) receiveBody(String endpointUri, long timeout) <T> TreceiveBody(String endpointUri, long timeout, Class<T> type) <T> TreceiveBody(String endpointUri, Class<T> type) receiveBody(org.apache.camel.Endpoint endpoint) receiveBody(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) receiveBodyNoWait(String endpointUri) <T> TreceiveBodyNoWait(String endpointUri, Class<T> type) receiveBodyNoWait(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, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods 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:
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
- 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
- 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
- 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
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
- Specified by:
receiveBodyNoWaitin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
- Specified by:
receiveBodyNoWaitin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBody
- Specified by:
receiveBodyin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
- Specified by:
receiveBodyNoWaitin interfaceorg.apache.camel.ConsumerTemplate
-
receiveBodyNoWait
- Specified by:
receiveBodyNoWaitin interfaceorg.apache.camel.ConsumerTemplate
-
doneUoW
public void doneUoW(org.apache.camel.Exchange exchange) - Specified by:
doneUoWin 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:
doBuildin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doInit
- Overrides:
doInitin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStart
- Overrides:
doStartin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doShutdown
- Overrides:
doShutdownin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-