Class DefaultFluentProducerTemplate

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.FluentProducerTemplate, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    public class DefaultFluentProducerTemplate
    extends org.apache.camel.support.service.ServiceSupport
    implements org.apache.camel.FluentProducerTemplate
    • Field Summary

      • Fields inherited from class org.apache.camel.support.service.BaseService

        BUILDED, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTINGDOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Future<Object> asyncRequest()  
      <T> Future<T> asyncRequest​(Class<T> type)  
      Future<org.apache.camel.Exchange> asyncSend()  
      void cleanUp()  
      org.apache.camel.FluentProducerTemplate clearAll()  
      org.apache.camel.FluentProducerTemplate clearBody()  
      org.apache.camel.FluentProducerTemplate clearHeaders()  
      protected void doInit()  
      protected void doShutdown()  
      protected void doStart()  
      protected void doStop()  
      org.apache.camel.CamelContext getCamelContext()  
      int getCurrentCacheSize()  
      org.apache.camel.Endpoint getDefaultEndpoint()  
      int getMaximumCacheSize()  
      boolean isEventNotifierEnabled()  
      static org.apache.camel.FluentProducerTemplate on​(org.apache.camel.CamelContext context)
      Create the FluentProducerTemplate by setting the camel context
      Object request()  
      <T> T request​(Class<T> type)  
      org.apache.camel.Exchange send()  
      void setDefaultEndpoint​(org.apache.camel.Endpoint defaultEndpoint)  
      void setDefaultEndpointUri​(String endpointUri)  
      void setEventNotifierEnabled​(boolean eventNotifierEnabled)  
      void setMaximumCacheSize​(int maximumCacheSize)  
      org.apache.camel.FluentProducerTemplate to​(String endpointUri)  
      org.apache.camel.FluentProducerTemplate to​(org.apache.camel.Endpoint endpoint)  
      org.apache.camel.FluentProducerTemplate withBody​(Object body)  
      org.apache.camel.FluentProducerTemplate withBodyAs​(Object body, Class<?> type)  
      org.apache.camel.FluentProducerTemplate withExchange​(Supplier<org.apache.camel.Exchange> exchangeSupplier)  
      org.apache.camel.FluentProducerTemplate withExchange​(org.apache.camel.Exchange exchange)  
      org.apache.camel.FluentProducerTemplate withHeader​(String key, Object value)  
      org.apache.camel.FluentProducerTemplate withProcessor​(Supplier<org.apache.camel.Processor> processorSupplier)  
      org.apache.camel.FluentProducerTemplate withProcessor​(org.apache.camel.Processor processor)  
      org.apache.camel.FluentProducerTemplate withTemplateCustomizer​(Consumer<org.apache.camel.ProducerTemplate> templateCustomizer)  
      • 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 interface org.apache.camel.FluentProducerTemplate

        to, toF
      • 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 Detail

      • DefaultFluentProducerTemplate

        public DefaultFluentProducerTemplate​(org.apache.camel.CamelContext context)
    • Method Detail

      • getCamelContext

        public org.apache.camel.CamelContext getCamelContext()
        Specified by:
        getCamelContext in interface org.apache.camel.FluentProducerTemplate
      • getCurrentCacheSize

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

        public void cleanUp()
        Specified by:
        cleanUp in interface org.apache.camel.FluentProducerTemplate
      • setDefaultEndpointUri

        public void setDefaultEndpointUri​(String endpointUri)
        Specified by:
        setDefaultEndpointUri in interface org.apache.camel.FluentProducerTemplate
      • getDefaultEndpoint

        public org.apache.camel.Endpoint getDefaultEndpoint()
        Specified by:
        getDefaultEndpoint in interface org.apache.camel.FluentProducerTemplate
      • setDefaultEndpoint

        public void setDefaultEndpoint​(org.apache.camel.Endpoint defaultEndpoint)
        Specified by:
        setDefaultEndpoint in interface org.apache.camel.FluentProducerTemplate
      • getMaximumCacheSize

        public int getMaximumCacheSize()
        Specified by:
        getMaximumCacheSize in interface org.apache.camel.FluentProducerTemplate
      • setMaximumCacheSize

        public void setMaximumCacheSize​(int maximumCacheSize)
        Specified by:
        setMaximumCacheSize in interface org.apache.camel.FluentProducerTemplate
      • isEventNotifierEnabled

        public boolean isEventNotifierEnabled()
        Specified by:
        isEventNotifierEnabled in interface org.apache.camel.FluentProducerTemplate
      • setEventNotifierEnabled

        public void setEventNotifierEnabled​(boolean eventNotifierEnabled)
        Specified by:
        setEventNotifierEnabled in interface org.apache.camel.FluentProducerTemplate
      • clearAll

        public org.apache.camel.FluentProducerTemplate clearAll()
        Specified by:
        clearAll in interface org.apache.camel.FluentProducerTemplate
      • withHeader

        public org.apache.camel.FluentProducerTemplate withHeader​(String key,
                                                                  Object value)
        Specified by:
        withHeader in interface org.apache.camel.FluentProducerTemplate
      • clearHeaders

        public org.apache.camel.FluentProducerTemplate clearHeaders()
        Specified by:
        clearHeaders in interface org.apache.camel.FluentProducerTemplate
      • withBody

        public org.apache.camel.FluentProducerTemplate withBody​(Object body)
        Specified by:
        withBody in interface org.apache.camel.FluentProducerTemplate
      • withBodyAs

        public org.apache.camel.FluentProducerTemplate withBodyAs​(Object body,
                                                                  Class<?> type)
        Specified by:
        withBodyAs in interface org.apache.camel.FluentProducerTemplate
      • clearBody

        public org.apache.camel.FluentProducerTemplate clearBody()
        Specified by:
        clearBody in interface org.apache.camel.FluentProducerTemplate
      • withTemplateCustomizer

        public org.apache.camel.FluentProducerTemplate withTemplateCustomizer​(Consumer<org.apache.camel.ProducerTemplate> templateCustomizer)
        Specified by:
        withTemplateCustomizer in interface org.apache.camel.FluentProducerTemplate
      • withExchange

        public org.apache.camel.FluentProducerTemplate withExchange​(org.apache.camel.Exchange exchange)
        Specified by:
        withExchange in interface org.apache.camel.FluentProducerTemplate
      • withExchange

        public org.apache.camel.FluentProducerTemplate withExchange​(Supplier<org.apache.camel.Exchange> exchangeSupplier)
        Specified by:
        withExchange in interface org.apache.camel.FluentProducerTemplate
      • withProcessor

        public org.apache.camel.FluentProducerTemplate withProcessor​(org.apache.camel.Processor processor)
        Specified by:
        withProcessor in interface org.apache.camel.FluentProducerTemplate
      • withProcessor

        public org.apache.camel.FluentProducerTemplate withProcessor​(Supplier<org.apache.camel.Processor> processorSupplier)
        Specified by:
        withProcessor in interface org.apache.camel.FluentProducerTemplate
      • to

        public org.apache.camel.FluentProducerTemplate to​(String endpointUri)
        Specified by:
        to in interface org.apache.camel.FluentProducerTemplate
      • to

        public org.apache.camel.FluentProducerTemplate to​(org.apache.camel.Endpoint endpoint)
        Specified by:
        to in interface org.apache.camel.FluentProducerTemplate
      • request

        public Object request()
                       throws org.apache.camel.CamelExecutionException
        Specified by:
        request in interface org.apache.camel.FluentProducerTemplate
        Throws:
        org.apache.camel.CamelExecutionException
      • request

        public <T> T request​(Class<T> type)
                      throws org.apache.camel.CamelExecutionException
        Specified by:
        request in interface org.apache.camel.FluentProducerTemplate
        Throws:
        org.apache.camel.CamelExecutionException
      • asyncRequest

        public Future<Object> asyncRequest()
        Specified by:
        asyncRequest in interface org.apache.camel.FluentProducerTemplate
      • asyncRequest

        public <T> Future<T> asyncRequest​(Class<T> type)
        Specified by:
        asyncRequest in interface org.apache.camel.FluentProducerTemplate
      • send

        public org.apache.camel.Exchange send()
                                       throws org.apache.camel.CamelExecutionException
        Specified by:
        send in interface org.apache.camel.FluentProducerTemplate
        Throws:
        org.apache.camel.CamelExecutionException
      • asyncSend

        public Future<org.apache.camel.Exchange> asyncSend()
        Specified by:
        asyncSend in interface org.apache.camel.FluentProducerTemplate
      • on

        public static org.apache.camel.FluentProducerTemplate on​(org.apache.camel.CamelContext context)
        Create the FluentProducerTemplate by setting the camel context
        Parameters:
        context - the camel context
      • 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