Package com.polarion.platform.jobs
Interface IJobUnitFactory
- All Known Implementing Classes:
GenericJobUnitFactory
public interface IJobUnitFactory
Factory for
IJobUnit
s (job implementations).- Version:
- $Revision$ $Date$
- Author:
- Stepan Roh, Polarion Software
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateJobUnit
(String name) Create job unit with given name.getJobDescriptor
(IJobUnit jobUnit) Job descriptor.getName()
Job factory name.
-
Method Details
-
getName
String getName()Job factory name.Something like job unit class name (but shorter), normally used for
IJobUnitRepository.getJobUnitFactory(String)
.- Returns:
- name (not
null
)
-
getJobDescriptor
Job descriptor.May return dynamic job descriptor if and only if given job unit is not
null
. It is not required to provide dynamic descriptor even though user wants it, however if user has given some job unit, descriptor must return it fromIJobDescriptor.getJobUnit()
.- Parameters:
jobUnit
- job unit used for dynamic configuration changes (may benull
)- Returns:
- job descriptor (not
null
) - Throws:
IllegalArgumentException
- if given jobUnit comes from another factory
-
createJobUnit
Create job unit with given name.Given label will be returned from
IJobUnit.getName()
.- Parameters:
name
- job name- Returns:
- created job unit (not
null
) - Throws:
IllegalArgumentException
- if name isnull
GenericJobException
- if for some reason creation fails
-