Refactored the use of the name parameters to be arguments

This PR refactors the use of the term parameters to arguments to be
consistent with how the component is utilized within Spring Cloud Data
Flow.
This commit is contained in:
Michael Minella
2016-06-08 13:04:58 -05:00
parent 7f53c7d9f7
commit 77fdfbdbc0
19 changed files with 101 additions and 102 deletions

View File

@@ -215,19 +215,19 @@ public class DeployerPartitionHandler implements PartitionHandler, EnvironmentAw
private void launchWorker(StepExecution workerStepExecution) {
//TODO: Refactor these to be passed as command line args once SCD-20 is complete
// https://github.com/spring-cloud/spring-cloud-deployer/issues/20
Map<String, String> parameters = getParameters(this.taskExecution.getParameters());
parameters.put(SPRING_CLOUD_TASK_JOB_EXECUTION_ID,
Map<String, String> arguments = getArguments(this.taskExecution.getArguments());
arguments.put(SPRING_CLOUD_TASK_JOB_EXECUTION_ID,
String.valueOf(workerStepExecution.getJobExecution().getId()));
parameters.put(SPRING_CLOUD_TASK_STEP_EXECUTION_ID,
arguments.put(SPRING_CLOUD_TASK_STEP_EXECUTION_ID,
String.valueOf(workerStepExecution.getId()));
parameters.put(SPRING_CLOUD_TASK_STEP_NAME, this.stepName);
arguments.put(SPRING_CLOUD_TASK_STEP_NAME, this.stepName);
AppDefinition definition =
new AppDefinition(String.format("%s:%s:%s",
taskExecution.getTaskName(),
workerStepExecution.getJobExecution().getJobInstance().getJobName(),
workerStepExecution.getStepName()),
parameters);
arguments);
Map<String, String> environmentProperties = new HashMap<>(this.environmentProperties.size());
environmentProperties.putAll(getCurrentEnvironmentProperties());
@@ -295,15 +295,15 @@ public class DeployerPartitionHandler implements PartitionHandler, EnvironmentAw
return status.equals(BatchStatus.COMPLETED) || status.isGreaterThan(BatchStatus.STARTED);
}
private Map<String, String> getParameters(List<String> parameters) {
Map<String, String> parameterMap = new HashMap<>(parameters.size());
private Map<String, String> getArguments(List<String> arguments) {
Map<String, String> argumentMap = new HashMap<>(arguments.size());
for (String parameter : parameters) {
String[] pieces = parameter.split("=");
parameterMap.put(pieces[0], pieces[1]);
for (String argument : arguments) {
String[] pieces = argument.split("=");
argumentMap.put(pieces[0], pieces[1]);
}
return parameterMap;
return argumentMap;
}
@Override

View File

@@ -231,7 +231,7 @@ public class TaskLifecycleListener implements ApplicationListener<ApplicationEve
return new TaskExecution(taskExecution.getExecutionId(),
taskExecution.getExitCode(), taskExecution.getTaskName(), startTime,
endTime,taskExecution.getExitMessage(),
Collections.unmodifiableList(taskExecution.getParameters()));
Collections.unmodifiableList(taskExecution.getArguments()));
}
@Override

View File

@@ -55,30 +55,30 @@ public class TaskExecution {
private Date endTime;
/**
* Message returned from the task or stacktrace.parameters.
* Message returned from the task or stacktrace.
*/
private String exitMessage;
/**
* The parameters that were used for this task execution.
* The arguments that were used for this task execution.
*/
private List<String> parameters;
private List<String> arguments;
public TaskExecution() {
parameters = new ArrayList<>();
arguments = new ArrayList<>();
}
public TaskExecution(long executionId, Integer exitCode, String taskName,
Date startTime, Date endTime,
String exitMessage, List<String> parameters) {
String exitMessage, List<String> arguments) {
Assert.notNull(parameters, "parameters must not be null");
Assert.notNull(arguments, "arguments must not be null");
Assert.notNull(startTime, "startTime must not be null");
this.executionId = executionId;
this.exitCode = exitCode;
this.taskName = taskName;
this.exitMessage = exitMessage;
this.parameters = new ArrayList<>(parameters);
this.arguments = new ArrayList<>(arguments);
this.startTime = (Date)startTime.clone();
this.endTime = (endTime != null) ? (Date)endTime.clone() : null;
}
@@ -127,12 +127,12 @@ public class TaskExecution {
this.exitMessage = exitMessage;
}
public List<String> getParameters() {
return parameters;
public List<String> getArguments() {
return arguments;
}
public void setParameters(List<String> parameters) {
this.parameters = new ArrayList<> (parameters);
public void setArguments(List<String> arguments) {
this.arguments = new ArrayList<> (arguments);
}
@Override
@@ -144,7 +144,7 @@ public class TaskExecution {
", startTime=" + startTime +
", endTime=" + endTime +
", exitMessage='" + exitMessage + '\'' +
", parameters=" + parameters +
", arguments=" + arguments +
'}';
}
}

View File

@@ -47,11 +47,11 @@ public interface TaskRepository {
*
* @param taskName the name that associated with the task execution.
* @param startTime the time task began.
* @param parameters list of key/value pairs that configure the task.
* @param arguments list of key/value pairs that configure the task.
* @return the initial {@link TaskExecution}
*/
@Transactional
TaskExecution createTaskExecution(String taskName,
Date startTime,List<String> parameters);
Date startTime,List<String> arguments);
}

View File

@@ -71,7 +71,7 @@ public class JdbcTaskExecutionDao implements TaskExecutionDao {
+ "(TASK_EXECUTION_ID, START_TIME, TASK_NAME, LAST_UPDATED)"
+ "values (?, ?, ?, ?)";
private static final String CREATE_TASK_PARAMETER = "INSERT into "
private static final String CREATE_TASK_ARGUMENT = "INSERT into "
+ "%PREFIX%EXECUTION_PARAMS(TASK_EXECUTION_ID, TASK_PARAM ) values (?, ?)";
private static final String CHECK_TASK_EXECUTION_EXISTS = "SELECT COUNT(*) FROM "
@@ -86,7 +86,7 @@ public class JdbcTaskExecutionDao implements TaskExecutionDao {
+ "EXIT_MESSAGE, LAST_UPDATED "
+ "from %PREFIX%EXECUTION where TASK_EXECUTION_ID = ?";
private static final String FIND_PARAMS_FROM_ID = "SELECT TASK_EXECUTION_ID, "
private static final String FIND_ARGUMENT_FROM_ID = "SELECT TASK_EXECUTION_ID, "
+ "TASK_PARAM from %PREFIX%EXECUTION_PARAMS where TASK_EXECUTION_ID = ?";
private static final String TASK_EXECUTION_COUNT = "SELECT COUNT(*) FROM " +
@@ -126,17 +126,17 @@ public class JdbcTaskExecutionDao implements TaskExecutionDao {
@Override
public TaskExecution createTaskExecution(String taskName,
Date startTime, List<String> parameters) {
Date startTime, List<String> arguments) {
long taskExecutionId = getNextExecutionId();
TaskExecution taskExecution = new TaskExecution(taskExecutionId, null, taskName,
startTime, null, null, parameters);
startTime, null, null, arguments);
Object[] queryParameters = new Object[]{ taskExecutionId, startTime, taskName, new Date()};
jdbcTemplate.update(
getQuery(SAVE_TASK_EXECUTION),
queryParameters,
new int[]{ Types.BIGINT, Types.TIMESTAMP, Types.VARCHAR, Types.TIMESTAMP });
insertTaskParameters(taskExecutionId, parameters);
insertTaskArguments(taskExecutionId, arguments);
return taskExecution;
}
@@ -175,7 +175,7 @@ public class JdbcTaskExecutionDao implements TaskExecutionDao {
try {
TaskExecution taskExecution = jdbcTemplate.queryForObject(getQuery(GET_EXECUTION_BY_ID),
new TaskExecutionRowMapper(), executionId);
taskExecution.setParameters(getTaskParameters(executionId));
taskExecution.setArguments(getTaskArguments(executionId));
return taskExecution;
}
catch (EmptyResultDataAccessException e) {
@@ -321,15 +321,15 @@ public class JdbcTaskExecutionDao implements TaskExecutionDao {
}
/**
* Convenience method that inserts all parameters from the provided
* task parameters.
* Convenience method that inserts all arguments from the provided
* task arguments.
*
* @param executionId The executionId to which the params are associated.
* @param taskParameters The parameters to be stored.
* @param executionId The executionId to which the arguments are associated.
* @param taskArguments The arguments to be stored.
*/
private void insertTaskParameters(long executionId, List<String> taskParameters) {
for (String param : taskParameters) {
insertParameter(executionId, param);
private void insertTaskArguments(long executionId, List<String> taskArguments) {
for (String args : taskArguments) {
insertArgument(executionId, args);
}
}
@@ -337,13 +337,13 @@ public class JdbcTaskExecutionDao implements TaskExecutionDao {
* Convenience method that inserts an individual records into the
* TASK_EXECUTION_PARAMS table.
*/
private void insertParameter(long executionId, String param) {
private void insertArgument(long executionId, String param) {
int[] argTypes = new int[]{ Types.BIGINT, Types.VARCHAR };
Object[] args = new Object[]{ executionId, param };
jdbcTemplate.update(getQuery(CREATE_TASK_PARAMETER), args, argTypes);
jdbcTemplate.update(getQuery(CREATE_TASK_ARGUMENT), args, argTypes);
}
private List<String> getTaskParameters(long executionId){
private List<String> getTaskArguments(long executionId){
final List<String> params= new ArrayList<>();
RowCallbackHandler handler = new RowCallbackHandler() {
@Override
@@ -352,7 +352,7 @@ public class JdbcTaskExecutionDao implements TaskExecutionDao {
}
};
jdbcTemplate.query(getQuery(FIND_PARAMS_FROM_ID), new Object[] { executionId },
jdbcTemplate.query(getQuery(FIND_ARGUMENT_FROM_ID), new Object[] { executionId },
handler);
return params;
}
@@ -374,7 +374,7 @@ public class JdbcTaskExecutionDao implements TaskExecutionDao {
rs.getTimestamp("START_TIME"),
rs.getTimestamp("END_TIME"),
rs.getString("EXIT_MESSAGE"),
getTaskParameters(id));
getTaskArguments(id));
}
private Integer getNullableExitCode(ResultSet rs) throws SQLException {

View File

@@ -53,10 +53,10 @@ public class MapTaskExecutionDao implements TaskExecutionDao {
@Override
public TaskExecution createTaskExecution(String taskName,
Date startTime, List<String> parameters) {
Date startTime, List<String> arguments) {
long taskExecutionId = getNextExecutionId();
TaskExecution taskExecution = new TaskExecution(taskExecutionId, null, taskName,
startTime, null, null, parameters);
startTime, null, null, arguments);
taskExecutions.put(taskExecutionId, taskExecution);
return taskExecution;
}

View File

@@ -36,11 +36,11 @@ public interface TaskExecutionDao {
*
* @param taskName the name that associated with the task execution.
* @param startTime the time task began.
* @param parameters list of key/value pairs that configure the task.
* @param arguments list of key/value pairs that configure the task.
* @return A fully qualified {@link TaskExecution} instance.
*/
TaskExecution createTaskExecution( String taskName,
Date startTime, List<String> parameters);
Date startTime, List<String> arguments);
/**
* Update and existing {@link TaskExecution}.

View File

@@ -71,11 +71,11 @@ public class SimpleTaskRepository implements TaskRepository {
@Override
public TaskExecution createTaskExecution(String taskName,
Date startTime,List<String> parameters) {
Date startTime,List<String> arguments) {
initialize();
validateCreateInformation(startTime, taskName);
TaskExecution taskExecution =
taskExecutionDao.createTaskExecution(taskName, startTime, parameters);
taskExecutionDao.createTaskExecution(taskName, startTime, arguments);
logger.debug("Creating: " + taskExecution.toString());
return taskExecution;
}

View File

@@ -135,7 +135,7 @@ public class TaskLifecycleListenerTests {
assertTrue(taskExecutionsByName.iterator().hasNext());
TaskExecution taskExecution = taskExecutionsByName.iterator().next();
assertEquals(numberOfParams, taskExecution.getParameters().size());
assertEquals(numberOfParams, taskExecution.getArguments().size());
assertEquals(exitCode, taskExecution.getExitCode());
if(exception != null) {

View File

@@ -57,9 +57,9 @@ public class JdbcTaskExecutionDaoTests {
@Test
@DirtiesContext
public void saveTaskExecution() {
TaskExecution expectedTaskExecution = TestVerifierUtils.createSampleTaskExecutionNoParam();
TaskExecution expectedTaskExecution = TestVerifierUtils.createSampleTaskExecutionNoArg();
expectedTaskExecution = dao.createTaskExecution(expectedTaskExecution.getTaskName(), expectedTaskExecution.getStartTime(),
expectedTaskExecution.getParameters());
expectedTaskExecution.getArguments());
TestVerifierUtils.verifyTaskExecution(expectedTaskExecution,
TestDBUtils.getTaskExecutionFromDB(dataSource, expectedTaskExecution.getExecutionId()));
@@ -68,9 +68,9 @@ public class JdbcTaskExecutionDaoTests {
@Test
@DirtiesContext
public void completeTaskExecution() {
TaskExecution expectedTaskExecution = TestVerifierUtils.endSampleTaskExecutionNoParam();
TaskExecution expectedTaskExecution = TestVerifierUtils.endSampleTaskExecutionNoArg();
expectedTaskExecution = dao.createTaskExecution(expectedTaskExecution.getTaskName(),
expectedTaskExecution.getStartTime(), expectedTaskExecution.getParameters());
expectedTaskExecution.getStartTime(), expectedTaskExecution.getArguments());
dao.completeTaskExecution(expectedTaskExecution.getExecutionId(),
expectedTaskExecution.getExitCode(), expectedTaskExecution.getEndTime(),
expectedTaskExecution.getExitMessage());
@@ -83,7 +83,7 @@ public class JdbcTaskExecutionDaoTests {
public void completeTaskExecutionWithNoCreate() {
JdbcTaskExecutionDao dao = new JdbcTaskExecutionDao(dataSource);
TaskExecution expectedTaskExecution = TestVerifierUtils.endSampleTaskExecutionNoParam();
TaskExecution expectedTaskExecution = TestVerifierUtils.endSampleTaskExecutionNoArg();
dao.completeTaskExecution(expectedTaskExecution.getExecutionId(),
expectedTaskExecution.getExitCode(), expectedTaskExecution.getEndTime(),
expectedTaskExecution.getExitMessage());

View File

@@ -34,9 +34,9 @@ public class MapTaskExecutionDaoTests {
@Test
public void saveTaskExecution(){
MapTaskExecutionDao dao = new MapTaskExecutionDao();
TaskExecution expectedTaskExecution = TestVerifierUtils.createSampleTaskExecutionNoParam();
TaskExecution expectedTaskExecution = TestVerifierUtils.createSampleTaskExecutionNoArg();
expectedTaskExecution = dao.createTaskExecution(expectedTaskExecution.getTaskName(),
expectedTaskExecution.getStartTime(), expectedTaskExecution.getParameters());
expectedTaskExecution.getStartTime(), expectedTaskExecution.getArguments());
Map<Long, TaskExecution> taskExecutionMap = dao.getTaskExecutions();
assertNotNull("taskExecutionMap must not be null", taskExecutionMap);
TestVerifierUtils.verifyTaskExecution(expectedTaskExecution,
@@ -46,9 +46,9 @@ public class MapTaskExecutionDaoTests {
@Test
public void completeTaskExecution(){
MapTaskExecutionDao dao = new MapTaskExecutionDao();
TaskExecution expectedTaskExecution = TestVerifierUtils.createSampleTaskExecutionNoParam();
TaskExecution expectedTaskExecution = TestVerifierUtils.createSampleTaskExecutionNoArg();
expectedTaskExecution = dao.createTaskExecution(expectedTaskExecution.getTaskName(),
expectedTaskExecution.getStartTime(), expectedTaskExecution.getParameters());
expectedTaskExecution.getStartTime(), expectedTaskExecution.getArguments());
dao.completeTaskExecution(expectedTaskExecution.getExecutionId(),
expectedTaskExecution.getExitCode(), expectedTaskExecution.getEndTime(),
expectedTaskExecution.getExitMessage());

View File

@@ -308,7 +308,7 @@ public class SimpleTaskExplorerTests {
private TaskExecution createAndSaveTaskExecution(int i) {
TaskExecution taskExecution = TestVerifierUtils.createSampleTaskExecution(i);
taskExecution = this.taskRepository.createTaskExecution(taskExecution.getTaskName(),
taskExecution.getStartTime(), taskExecution.getParameters());
taskExecution.getStartTime(), taskExecution.getArguments());
return taskExecution;
}

View File

@@ -37,9 +37,9 @@ public class TaskExecutionCreator {
* @return the taskExecution created.
*/
public static TaskExecution createAndStoreTaskExecutionNoParams(TaskRepository taskRepository) {
TaskExecution expectedTaskExecution = TestVerifierUtils.createSampleTaskExecutionNoParam();
TaskExecution expectedTaskExecution = TestVerifierUtils.createSampleTaskExecutionNoArg();
expectedTaskExecution = taskRepository.createTaskExecution(expectedTaskExecution.getTaskName(),
expectedTaskExecution.getStartTime(), expectedTaskExecution.getParameters());
expectedTaskExecution.getStartTime(), expectedTaskExecution.getArguments());
return expectedTaskExecution;
}
@@ -50,13 +50,13 @@ public class TaskExecutionCreator {
* @return the taskExecution created.
*/
public static TaskExecution createAndStoreTaskExecutionWithParams(TaskRepository taskRepository) {
TaskExecution expectedTaskExecution = TestVerifierUtils.createSampleTaskExecutionNoParam();
TaskExecution expectedTaskExecution = TestVerifierUtils.createSampleTaskExecutionNoArg();
List<String> params = new ArrayList<String>();
params.add(UUID.randomUUID().toString());
params.add(UUID.randomUUID().toString());
expectedTaskExecution.setParameters(params);
expectedTaskExecution.setArguments(params);
expectedTaskExecution = taskRepository.createTaskExecution(expectedTaskExecution.getTaskName(),
expectedTaskExecution.getStartTime(), expectedTaskExecution.getParameters());
expectedTaskExecution.getStartTime(), expectedTaskExecution.getArguments());
return expectedTaskExecution;
}

View File

@@ -16,10 +16,6 @@
package org.springframework.cloud.task.util;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
@@ -28,7 +24,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import javax.sql.DataSource;
import org.springframework.batch.item.database.Order;
@@ -44,6 +39,10 @@ import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.MetaDataAccessException;
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
/**
* Provides a suite of tools that allow tests the ability to retrieve results from a
* relational database.
@@ -168,10 +167,10 @@ public class TestDBUtils {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
List<Map<String, Object>> rows = jdbcTemplate.queryForList(sql);
List<String> params = new ArrayList<>();
List<String> arguments = new ArrayList<>();
for (Map row : rows) {
params.add((String) row.get("TASK_PARAM"));
arguments.add((String) row.get("TASK_PARAM"));
}
taskExecution.setParameters(params);
taskExecution.setArguments(arguments);
}
}

View File

@@ -47,7 +47,7 @@ import static org.mockito.Mockito.when;
*/
public class TestVerifierUtils {
public static final int PARAM_SIZE = 5;
public static final int ARG_SIZE = 5;
/**
* Creates a mock {@link Appender} to be added to the root logger.
@@ -79,11 +79,11 @@ public class TestVerifierUtils {
}
/**
* Creates a fully populated TaskExecution (except params) for testing.
* Creates a fully populated TaskExecution (except args) for testing.
*
* @return
*/
public static TaskExecution createSampleTaskExecutionNoParam() {
public static TaskExecution createSampleTaskExecutionNoArg() {
Random randomGenerator = new Random();
Date startTime = new Date();
long executionId = randomGenerator.nextLong();
@@ -94,11 +94,11 @@ public class TestVerifierUtils {
}
/**
* Creates a fully populated TaskExecution (except params) for testing.
* Creates a fully populated TaskExecution (except args) for testing.
*
* @return
*/
public static TaskExecution endSampleTaskExecutionNoParam() {
public static TaskExecution endSampleTaskExecutionNoArg() {
Random randomGenerator = new Random();
int exitCode = randomGenerator.nextInt();
Date startTime = new Date();
@@ -120,12 +120,12 @@ public class TestVerifierUtils {
Random randomGenerator = new Random();
Date startTime = new Date();
String taskName = UUID.randomUUID().toString();
List<String> params = new ArrayList<>(PARAM_SIZE);
for (int i = 0 ; i < PARAM_SIZE ; i++){
params.add(UUID.randomUUID().toString());
List<String> args = new ArrayList<>(ARG_SIZE);
for (int i = 0; i < ARG_SIZE; i++){
args.add(UUID.randomUUID().toString());
}
return new TaskExecution(executionId, null, taskName,
startTime, null, null, params);
startTime, null, null, args);
}
/**
@@ -153,22 +153,22 @@ public class TestVerifierUtils {
assertEquals("exitMessage must be equal",
expectedTaskExecution.getExitMessage(),
actualTaskExecution.getExitMessage());
if (expectedTaskExecution.getParameters() != null) {
assertNotNull("parameters should not be null",
actualTaskExecution.getParameters());
assertEquals("parameters result set count should match expected count",
expectedTaskExecution.getParameters().size(),
actualTaskExecution.getParameters().size());
if (expectedTaskExecution.getArguments() != null) {
assertNotNull("arguments should not be null",
actualTaskExecution.getArguments());
assertEquals("arguments result set count should match expected count",
expectedTaskExecution.getArguments().size(),
actualTaskExecution.getArguments().size());
}
else {
assertNull("parameters should be null", actualTaskExecution.getParameters());
assertNull("arguments should be null", actualTaskExecution.getArguments());
}
Set<String> params = new HashSet<String>();
for (String param : expectedTaskExecution.getParameters()) {
params.add(param);
Set<String> args = new HashSet<String>();
for (String param : expectedTaskExecution.getArguments()) {
args.add(param);
}
for (String param : actualTaskExecution.getParameters()) {
assertTrue("param must exist in the repository", params.contains(param));
for (String arg : actualTaskExecution.getArguments()) {
assertTrue("arg must exist in the repository", args.contains(arg));
}
}

View File

@@ -83,7 +83,7 @@ assumed to be 0.
of the task (as indicated via an `ApplicationFailedEvent`), the stack trace for that
exception will be stored here.
|`parameters`
|`arguments`
|A `List` of the string command line arguments as they were passed into the executable boot
application.
|===

View File

@@ -272,17 +272,17 @@ $ mvn clean spring-boot:run
2016-01-25 11:08:10.185 INFO 12943 --- [ main] com.example.SampleTask : No active profile set, falling back to default profiles: default
2016-01-25 11:08:10.226 INFO 12943 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2a2c3676: startup date [Mon Jan 25 11:08:10 CST 2016]; root of context hierarchy
2016-01-25 11:08:11.051 INFO 12943 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2016-01-25 11:08:11.065 INFO 12943 --- [ main] o.s.c.t.r.support.SimpleTaskRepository : Creating: TaskExecution{executionId=0, externalExecutionID='null', exitCode=0, taskName='application', startTime=Mon Jan 25 11:08:11 CST 2016, endTime=null, statusCode='null', exitMessage='null', parameters=[]}
2016-01-25 11:08:11.065 INFO 12943 --- [ main] o.s.c.t.r.support.SimpleTaskRepository : Creating: TaskExecution{executionId=0, externalExecutionID='null', exitCode=0, taskName='application', startTime=Mon Jan 25 11:08:11 CST 2016, endTime=null, statusCode='null', exitMessage='null', arguments=[]}
Hello World!
2016-01-25 11:08:11.071 INFO 12943 --- [ main] com.example.SampleTask : Started SampleTask in 1.095 seconds (JVM running for 3.826)
2016-01-25 11:08:11.220 INFO 12943 --- [ Thread-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@2a2c3676: startup date [Mon Jan 25 11:08:10 CST 2016]; root of context hierarchy
2016-01-25 11:08:11.222 INFO 12943 --- [ Thread-1] o.s.c.t.r.support.SimpleTaskRepository : Updating: TaskExecution{executionId=0, externalExecutionID='null', exitCode=0, taskName='application', startTime=Mon Jan 25 11:08:11 CST 2016, endTime=Mon Jan 25 11:08:11 CST 2016, statusCode='null', exitMessage='null', parameters=[]}
2016-01-25 11:08:11.222 INFO 12943 --- [ Thread-1] o.s.c.t.r.support.SimpleTaskRepository : Updating: TaskExecution{executionId=0, externalExecutionID='null', exitCode=0, taskName='application', startTime=Mon Jan 25 11:08:11 CST 2016, endTime=Mon Jan 25 11:08:11 CST 2016, statusCode='null', exitMessage='null', arguments=[]}
2016-01-25 11:08:11.222 INFO 12943 --- [ Thread-1] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
----
If you notice, there are three lines of interest in the above output:
* `SimpleTaskRepository` logged out the creation of the entry in the `TaskRepository`.
* The execution of our `CommandLineRunner`, demonstrated by the "Helo World!" output.
* `SimpleTaskREpository` logging the completion of the task in the `TaskRepository`.
* The execution of our `CommandLineRunner`, demonstrated by the "Hello World!" output.
* `SimpleTaskRepository` logging the completion of the task in the `TaskRepository`.

View File

@@ -16,7 +16,7 @@ by executing the following build in the timestamp-task module:
$ ./mvnw clean install
----
== The parameters offered by the TaskProcessor are as follows:
== The arguments offered by the TaskProcessor are as follows:
* *group* establishes the group for the task maven coordinates. Default is `io.spring`.
* *artifact* establishes the artifact for the task maven coordinates. Default is `timestamp-task`.
* *classifiers* establishes the classifier for the task maven coordinates. Default is null.

View File

@@ -62,7 +62,7 @@ public class TaskLaunchRequest implements Serializable{
}
/**
* Returns an unmodifiable list of parameters that will be used for the task execution
* Returns an unmodifiable list of arguments that will be used for the task execution
*/
public List<String> getCommandlineArguments() {
return Collections.unmodifiableList(commandlineArguments);