Class SpringBatchEndpoint

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @UriEndpoint(firstVersion="2.10.0",
                 scheme="spring-batch",
                 title="Spring Batch",
                 syntax="spring-batch:jobName",
                 producerOnly=true,
                 category={SPRING,BATCH,SCHEDULING})
    public class SpringBatchEndpoint
    extends org.apache.camel.support.DefaultEndpoint
    Send messages to Spring Batch for further processing.
    • 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
      SpringBatchEndpoint​(String endpointUri, org.apache.camel.Component component, org.springframework.batch.core.launch.JobLauncher jobLauncher, org.springframework.batch.core.launch.JobLauncher defaultResolvedJobLauncher, Map<String,​org.springframework.batch.core.launch.JobLauncher> allResolvedJobLaunchers, String jobName, org.springframework.batch.core.configuration.JobRegistry jobRegistry)  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      org.apache.camel.Consumer createConsumer​(org.apache.camel.Processor processor)  
      org.apache.camel.Producer createProducer()  
      protected void doInit()  
      org.springframework.batch.core.launch.JobLauncher getJobLauncher()  
      String getJobLauncherRef()
      Deprecated.
      String getJobName()  
      org.springframework.batch.core.configuration.JobRegistry getJobRegistry()  
      boolean isJobFromHeader()  
      void setJobFromHeader​(boolean jobFromHeader)
      Explicitly defines if the jobName should be taken from the headers instead of the URI.
      void setJobLauncher​(org.springframework.batch.core.launch.JobLauncher jobLauncher)
      Explicitly specifies a JobLauncher to be used.
      void setJobLauncherRef​(String jobLauncherRef)
      Deprecated.
      void setJobName​(String jobName)
      The name of the Spring Batch job located in the registry.
      void setJobRegistry​(org.springframework.batch.core.configuration.JobRegistry jobRegistry)
      Explicitly specifies a JobRegistry to be used.
      • Methods inherited from class org.apache.camel.support.DefaultEndpoint

        configureConsumer, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, 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.Endpoint

        getEndpointBaseUri, isSingletonProducer
      • 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

      • SpringBatchEndpoint

        public SpringBatchEndpoint​(String endpointUri,
                                   org.apache.camel.Component component,
                                   org.springframework.batch.core.launch.JobLauncher jobLauncher,
                                   org.springframework.batch.core.launch.JobLauncher defaultResolvedJobLauncher,
                                   Map<String,​org.springframework.batch.core.launch.JobLauncher> allResolvedJobLaunchers,
                                   String jobName,
                                   org.springframework.batch.core.configuration.JobRegistry jobRegistry)
    • Method Detail

      • createProducer

        public org.apache.camel.Producer createProducer()
                                                 throws Exception
        Throws:
        Exception
      • createConsumer

        public org.apache.camel.Consumer createConsumer​(org.apache.camel.Processor processor)
                                                 throws Exception
        Throws:
        Exception
      • doInit

        protected void doInit()
                       throws Exception
        Overrides:
        doInit in class org.apache.camel.support.DefaultEndpoint
        Throws:
        Exception
      • getJobName

        public String getJobName()
      • setJobName

        public void setJobName​(String jobName)
        The name of the Spring Batch job located in the registry.
      • setJobLauncherRef

        @Deprecated
        public void setJobLauncherRef​(String jobLauncherRef)
        Deprecated.
        Explicitly specifies a JobLauncher to be used looked up from the registry.
      • getJobLauncher

        public org.springframework.batch.core.launch.JobLauncher getJobLauncher()
      • setJobLauncher

        public void setJobLauncher​(org.springframework.batch.core.launch.JobLauncher jobLauncher)
        Explicitly specifies a JobLauncher to be used.
      • setJobFromHeader

        public void setJobFromHeader​(boolean jobFromHeader)
        Explicitly defines if the jobName should be taken from the headers instead of the URI.
      • isJobFromHeader

        public boolean isJobFromHeader()
      • getJobRegistry

        public org.springframework.batch.core.configuration.JobRegistry getJobRegistry()
      • setJobRegistry

        public void setJobRegistry​(org.springframework.batch.core.configuration.JobRegistry jobRegistry)
        Explicitly specifies a JobRegistry to be used.