class JobLaunchingGateway extends AbstractReplyProducingMessageHandler {

	private final JobLaunchingMessageHandler jobLaunchingMessageHandler;

	/**
	 * Constructor taking a {@link JobLauncher} as parameter.
	 * @param jobLauncher Must not be null.
	 *
	 */
	public JobLaunchingGateway(JobLauncher jobLauncher) {
		Assert.notNull(jobLauncher, "jobLauncher must not be null.");
		this.jobLaunchingMessageHandler = new JobLaunchingMessageHandler(jobLauncher);
	}

	/**
	 * Launches a Batch Job using the provided request {@link Message}. The payload of the
	 * {@link Message} <em>must</em> be an instance of {@link JobLaunchRequest}.
	 * @param requestMessage must not be null.
	 * @return Generally a {@link JobExecution} will always be returned. An exception
	 * ({@link MessageHandlingException}) will only be thrown if there is a failure to
	 * start the job. The cause of the exception will be a {@link JobExecutionException}.
	 * @throws MessageHandlingException when a job cannot be launched
	 */
	@Override
	protected Object handleRequestMessage(Message<?> requestMessage) {<FILL_FUNCTION_BODY>}

}


		Assert.notNull(requestMessage, "The provided requestMessage must not be null.");

		final Object payload = requestMessage.getPayload();

		Assert.isInstanceOf(JobLaunchRequest.class, payload, "The payload must be of type JobLaunchRequest.");

		final JobLaunchRequest jobLaunchRequest = (JobLaunchRequest) payload;

		final JobExecution jobExecution;

		try {
			jobExecution = this.jobLaunchingMessageHandler.launch(jobLaunchRequest);
		}
		catch (JobExecutionException e) {
			throw new MessageHandlingException(requestMessage, e);
		}

		return jobExecution;

	
<methods>public void <init>() ,public org.springframework.integration.IntegrationPatternType getIntegrationPatternType() ,public void setAdviceChain(List<org.aopalliance.aop.Advice>) ,public void setBeanClassLoader(java.lang.ClassLoader) ,public void setRequiresReply(boolean) <variables>private final List<org.aopalliance.aop.Advice> adviceChain,private volatile org.springframework.integration.handler.AbstractReplyProducingMessageHandler.RequestHandler advisedRequestHandler,private java.lang.ClassLoader beanClassLoader,private final java.util.concurrent.locks.Lock lock,private boolean requiresReply