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
    Constructor
    Description
    DefaultConsumerTemplate(org.apache.camel.CamelContext camelContext)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
     
    protected void
     
    void
    doneUoW(org.apache.camel.Exchange exchange)
     
    protected void
     
    protected void
     
    protected void
     
    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
    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)
     
    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)
     
     
    <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
     
    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 interface org.apache.camel.ConsumerTemplate
    • setMaximumCacheSize

      public void setMaximumCacheSize(int maximumCacheSize)
      Specified by:
      setMaximumCacheSize in interface org.apache.camel.ConsumerTemplate
    • getCurrentCacheSize

      public int getCurrentCacheSize()
      Specified by:
      getCurrentCacheSize in interface org.apache.camel.ConsumerTemplate
    • cleanUp

      public void cleanUp()
      Specified by:
      cleanUp in interface org.apache.camel.ConsumerTemplate
    • getCamelContext

      public org.apache.camel.CamelContext getCamelContext()
      Specified by:
      getCamelContext in interface org.apache.camel.ConsumerTemplate
    • receive

      public org.apache.camel.Exchange receive(String endpointUri)
      Specified by:
      receive in interface org.apache.camel.ConsumerTemplate
    • receive

      public org.apache.camel.Exchange receive(org.apache.camel.Endpoint endpoint)
      Specified by:
      receive in interface org.apache.camel.ConsumerTemplate
    • receive

      public org.apache.camel.Exchange receive(String endpointUri, long timeout)
      Specified by:
      receive in interface org.apache.camel.ConsumerTemplate
    • receive

      public org.apache.camel.Exchange receive(org.apache.camel.Endpoint endpoint, long timeout)
      Specified by:
      receive in interface org.apache.camel.ConsumerTemplate
    • receiveNoWait

      public org.apache.camel.Exchange receiveNoWait(String endpointUri)
      Specified by:
      receiveNoWait in interface org.apache.camel.ConsumerTemplate
    • receiveNoWait

      public org.apache.camel.Exchange receiveNoWait(org.apache.camel.Endpoint endpoint)
      Specified by:
      receiveNoWait in interface org.apache.camel.ConsumerTemplate
    • receiveBody

      public Object receiveBody(String endpointUri)
      Specified by:
      receiveBody in interface org.apache.camel.ConsumerTemplate
    • receiveBody

      public Object receiveBody(org.apache.camel.Endpoint endpoint)
      Specified by:
      receiveBody in interface org.apache.camel.ConsumerTemplate
    • receiveBody

      public Object receiveBody(String endpointUri, long timeout)
      Specified by:
      receiveBody in interface org.apache.camel.ConsumerTemplate
    • receiveBody

      public Object receiveBody(org.apache.camel.Endpoint endpoint, long timeout)
      Specified by:
      receiveBody in interface org.apache.camel.ConsumerTemplate
    • receiveBodyNoWait

      public Object receiveBodyNoWait(String endpointUri)
      Specified by:
      receiveBodyNoWait in interface org.apache.camel.ConsumerTemplate
    • receiveBodyNoWait

      public Object receiveBodyNoWait(org.apache.camel.Endpoint endpoint)
      Specified by:
      receiveBodyNoWait in interface org.apache.camel.ConsumerTemplate
    • receiveBody

      public <T> T receiveBody(String endpointUri, Class<T> type)
      Specified by:
      receiveBody in interface org.apache.camel.ConsumerTemplate
    • receiveBody

      public <T> T receiveBody(org.apache.camel.Endpoint endpoint, Class<T> type)
      Specified by:
      receiveBody in interface org.apache.camel.ConsumerTemplate
    • receiveBody

      public <T> T receiveBody(String endpointUri, long timeout, Class<T> type)
      Specified by:
      receiveBody in interface org.apache.camel.ConsumerTemplate
    • receiveBody

      public <T> T receiveBody(org.apache.camel.Endpoint endpoint, long timeout, Class<T> type)
      Specified by:
      receiveBody in interface org.apache.camel.ConsumerTemplate
    • receiveBodyNoWait

      public <T> T receiveBodyNoWait(String endpointUri, Class<T> type)
      Specified by:
      receiveBodyNoWait in interface org.apache.camel.ConsumerTemplate
    • receiveBodyNoWait

      public <T> T receiveBodyNoWait(org.apache.camel.Endpoint endpoint, Class<T> type)
      Specified by:
      receiveBodyNoWait in interface org.apache.camel.ConsumerTemplate
    • doneUoW

      public void doneUoW(org.apache.camel.Exchange exchange)
      Specified by:
      doneUoW in interface org.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:
      doBuild in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doInit

      protected void doInit() throws Exception
      Overrides:
      doInit in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doShutdown

      protected void doShutdown() throws Exception
      Overrides:
      doShutdown in class org.apache.camel.support.service.BaseService
      Throws:
      Exception