Add some Javadocs
This commit is contained in:
@@ -1,39 +1,78 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.execution.bootstrap;
|
||||
|
||||
import org.springframework.batch.core.configuration.NoSuchJobConfigurationException;
|
||||
import org.springframework.batch.core.runtime.JobIdentifier;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Lucas Ward
|
||||
*/
|
||||
|
||||
public interface JobLauncher {
|
||||
|
||||
public ExitStatus run() throws NoSuchJobConfigurationException;
|
||||
|
||||
public ExitStatus run(String jobName) throws NoSuchJobConfigurationException;
|
||||
|
||||
public ExitStatus run(JobIdentifier jobIdentifier) throws NoSuchJobConfigurationException;
|
||||
|
||||
public void stop();
|
||||
|
||||
public boolean isRunning();
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.execution.bootstrap;
|
||||
|
||||
import org.springframework.batch.core.configuration.NoSuchJobConfigurationException;
|
||||
import org.springframework.batch.core.runtime.JobIdentifier;
|
||||
import org.springframework.batch.execution.JobExecutorFacade;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
|
||||
/**
|
||||
* Simple interface for controlling a job for a single job configuration, and
|
||||
* also possibly ad-hoc executions, based on different runtime identifiers.
|
||||
* Implementations should concentrate on managing jobs and delegate the
|
||||
* launching to a {@link JobExecutorFacade}.
|
||||
*
|
||||
* @author Lucas Ward
|
||||
* @author Dave Syer
|
||||
*/
|
||||
|
||||
public interface JobLauncher {
|
||||
|
||||
/**
|
||||
* Start a job execution with default name and other runtime information
|
||||
* generated on the fly.<br/>
|
||||
*
|
||||
* @return the exit code from the job if it returns synchronously.
|
||||
*
|
||||
*/
|
||||
public ExitStatus run() throws NoSuchJobConfigurationException;
|
||||
|
||||
/**
|
||||
* Start a job execution with the given name and other runtime information
|
||||
* generated on the fly.
|
||||
*
|
||||
* @param name
|
||||
* the name to assign to the job
|
||||
* @return the exit code from the job if it returns synchronously.
|
||||
* @throws NoSuchJobConfigurationException
|
||||
*/
|
||||
public ExitStatus run(String jobName)
|
||||
throws NoSuchJobConfigurationException;
|
||||
|
||||
/**
|
||||
* Start a job execution with the given runtime information.
|
||||
*
|
||||
* @return the exit code from the job if it returns synchronously.
|
||||
* @throws NoSuchJobConfigurationException
|
||||
*/
|
||||
public ExitStatus run(JobIdentifier jobIdentifier)
|
||||
throws NoSuchJobConfigurationException;
|
||||
|
||||
/**
|
||||
* Stop the current job executions if there are any. If not, no action will
|
||||
* be taken.
|
||||
*
|
||||
* @see org.springframework.context.Lifecycle#stop()
|
||||
*/
|
||||
public void stop();
|
||||
|
||||
/**
|
||||
* Return whether or not a job execution is currently running.
|
||||
*/
|
||||
public boolean isRunning();
|
||||
|
||||
}
|
||||
|
||||
@@ -158,15 +158,34 @@ public class SimpleJobLauncher implements JobLauncher {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The facade to which job launching will be delegated.
|
||||
*
|
||||
* @param jobExecutorFacade a {@link JobExecutorFacade}.
|
||||
*/
|
||||
public void setJobExecutorFacade(JobExecutorFacade jobExecutorFacade) {
|
||||
this.jobExecutorFacade = jobExecutorFacade;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Public setter for injecting {@link JobIdentifierFactory}. When a job is
|
||||
* launched by name the factory needs to be used to create a new identifier
|
||||
* for it. Defaults to a {@link ScheduledJobIdentifierFactory}.
|
||||
*
|
||||
* @param jobIdentifierFactory
|
||||
* the {@link JobIdentifierFactory} to use when constructing
|
||||
* identifiers for jobs.
|
||||
*/
|
||||
public void setJobIdentifierFactory(
|
||||
JobIdentifierFactory jobIdentifierFactory) {
|
||||
this.jobIdentifierFactory = jobIdentifierFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Public setter for the default job configuration name to launch if none is specified.
|
||||
*
|
||||
* @param jobConfigurationName the name of a {@link JobConfiguration} in the registry.
|
||||
*/
|
||||
public void setJobConfigurationName(String jobConfigurationName) {
|
||||
this.jobConfigurationName = jobConfigurationName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user