org.springframework.batch.integration.launch

## Class JobLaunchingGateway

- java.lang.Object
- - org.springframework.integration.context.IntegrationObjectSupport
  - - org.springframework.integration.handler.AbstractMessageHandler
    - - org.springframework.integration.handler.AbstractReplyProducingMessageHandler
      - - org.springframework.batch.integration.launch.JobLaunchingGateway

- All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.core.Ordered, org.springframework.integration.context.Orderable, org.springframework.integration.core.MessageProducer, org.springframework.integration.history.TrackableComponent, org.springframework.integration.support.context.NamedComponent, org.springframework.messaging.MessageHandler

      public class JobLaunchingGateway
      extends org.springframework.integration.handler.AbstractReplyProducingMessageHandler

  The `JobLaunchingGateway` is used to launch Batch Jobs. Internally it delegates to a `JobLaunchingMessageHandler`.
  Since:
    1.3
  Author:
    Gunnar Hillert

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler

      `org.springframework.integration.handler.AbstractReplyProducingMessageHandler.RequestHandler`

  - ### Field Summary

    - ### Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport

      `logger`

    - ### Fields inherited from interface org.springframework.core.Ordered

      `HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JobLaunchingGateway(JobLauncher jobLauncher)` Constructor taking a `JobLauncher` as parameter.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.Object` | `handleRequestMessage(org.springframework.messaging.Message<?> requestMessage)` Launches a Batch Job using the provided request `Message`.

    - ### Methods inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler

      `doInit, doInvokeAdvisedRequestHandler, getMessagingTemplate, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setChannelResolver, setOutputChannel, setOutputChannelName, setRequiresReply, setSendTimeout, shouldCopyRequestHeaders`

    - ### Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler

      `getComponentType, getOrder, handleMessage, setOrder, setShouldTrack`

    - ### Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport

      `afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.springframework.integration.support.context.NamedComponent

      `getComponentName`

- - ### Constructor Detail

    - #### JobLaunchingGateway

          public JobLaunchingGateway(JobLauncher jobLauncher)

      Constructor taking a `JobLauncher` as parameter.
      Parameters:
        `jobLauncher` - Must not be null.

  - ### Method Detail

    - #### handleRequestMessage

          protected java.lang.Object handleRequestMessage(org.springframework.messaging.Message<?> requestMessage)

      Launches a Batch Job using the provided request `Message`. The payload of the `Message` must be an instance of `JobLaunchRequest`.
      Specified by:
        `handleRequestMessage` in class `org.springframework.integration.handler.AbstractReplyProducingMessageHandler`
      Parameters:
        `requestMessage` - must not be null.
      Returns:
        Generally a `JobExecution` will always be returned. An exception (`MessageHandlingException`) will only be thrown if there is a failure to start the job. The cause of the exception will be a `JobExecutionException`.
      Throws:
        `org.springframework.messaging.MessageHandlingException` - when a job cannot be launched