org.oddjob.framework
Class ServicesJob
java.lang.Object
org.oddjob.framework.BaseComponent
org.oddjob.framework.BasePrimary
org.oddjob.framework.SimpleJob
org.oddjob.framework.ServicesJob
- All Implemented Interfaces:
- Runnable, ArooaContextAware, ArooaSessionAware, ServiceProvider, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful
public class ServicesJob
- extends SimpleJob
- implements ServiceProvider
Description
Allows objects to be registered that will
automatically be injected into subsequent components that
are configured for automatic dependency injection.
Example
The Development guide has numerous examples using this job.- Author:
- rob
Methods inherited from class org.oddjob.framework.SimpleJob |
fireDestroyedState, force, getStateChanger, hardReset, onDestroy, onStop, run, sleep, softReset, stateHandler, stop |
Methods inherited from class org.oddjob.framework.BaseComponent |
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSession |
ServicesJob
public ServicesJob()
execute
protected int execute()
throws Throwable
- Description copied from class:
SimpleJob
- Execute this job.
- Specified by:
execute
in class SimpleJob
- Returns:
- 0 if the job is complete, anything else otherwise.
- Throws:
Exception
- If the unexpected occurs.
Throwable
onReset
protected void onReset()
- Description copied from class:
SimpleJob
- Allow sub classes to do something on reset.
- Overrides:
onReset
in class SimpleJob
getServices
public Services getServices()
- Description copied from interface:
ServiceProvider
- Provider the services.
- Specified by:
getServices
in interface ServiceProvider
Property: services
Description: Provide access to the registered services.
Services
are registered by name using object toString and then if qualified
';' and the qualifier. If this job has an id my-services and
the service has a toString of MyCafe and it is qualified with qualifier
Vegetarian then it could be referenced as:
${my-services.services.service(MyCafe;Vegetarian)}
- Returns:
- The services. May be null.
setRegisteredServices
public void setRegisteredServices(int index,
ServicesJob.ServiceDefinition serviceDef)