OPEN - issue BATCH-398: That old stateful / stateless thing again....

http://jira.springframework.org/browse/BATCH-398

Fix delegate job (duplicate job regsitry).
This commit is contained in:
dsyer
2008-03-01 08:35:12 +00:00
parent 6f6ea2d70e
commit f2129d4ea7
9 changed files with 66 additions and 30 deletions

View File

@@ -0,0 +1,32 @@
/*
* 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.core.repository;
import org.springframework.batch.core.domain.Job;
/**
* Strategy for creating a single job.
*
* @author Dave Syer
*
*/
public interface JobFactory {
Job createJob();
String getJobName();
}

View File

@@ -29,18 +29,18 @@ public interface JobRegistry extends JobLocator {
/**
* Registers a {@link Job} at runtime.
*
* @param jobConfiguration the {@link Job} to be registered
* @param job the {@link Job} to be registered
*
* @throws DuplicateJobException if a configuration with the
* same name has already been registered.
*/
void register(Job jobConfiguration) throws DuplicateJobException;
void register(Job job) throws DuplicateJobException;
/**
* Unregisters a previously registered {@link Job}. If it was
* not previously registered there is no error.
*
* @param jobConfiguration the {@link Job} to unregister.
* @param job the {@link Job} to unregister.
*/
void unregister(Job jobConfiguration);
void unregister(Job job);
}

View File

@@ -17,8 +17,6 @@ package org.springframework.batch.core.repository;
import java.util.Collection;
import org.springframework.batch.core.domain.Job;
/**
* A listable extension of {@link JobRegistry}.
*
@@ -28,11 +26,10 @@ import org.springframework.batch.core.domain.Job;
public interface ListableJobRegistry extends JobRegistry {
/**
* Provides the currently registered configurations. The return value is
* Provides the currently registered job names. The return value is
* unmodifiable and disconnected from the underlying registry storage.
*
* @return a collection of {@link Job} instances. Empty if none
* are registered.
* @return a collection of String. Empty if none are registered.
*/
Collection getJobConfigurations();
Collection getJobNames();
}