Package org.oddjob.framework
Class ServicesJob
java.lang.Object
org.oddjob.framework.extend.BaseComponent
org.oddjob.framework.extend.BasePrimary
org.oddjob.framework.extend.SimpleJob
org.oddjob.framework.ServicesJob
- All Implemented Interfaces:
Runnable,ArooaContextAware,ArooaSessionAware,ServiceProvider,Forceable,PropertyChangeNotifier,Iconic,LogEnabled,Resettable,Stateful
- Author:
- rob
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDefinition of a service. -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intexecute()Execute this job.Provider the services.protected voidonReset()Allow sub classes to do something on reset.voidsetRegisteredServices(int index, ServicesJob.ServiceDefinition serviceDef) Methods inherited from class org.oddjob.framework.extend.SimpleJob
fireDestroyedState, force, getStateChanger, hardReset, iconHelper, isStop, onDestroy, onStop, run, sleep, softReset, stateHandler, stopMethods inherited from class org.oddjob.framework.extend.BasePrimary
configure, getName, logger, logger, loggerName, save, setName, toStringMethods inherited from class org.oddjob.framework.extend.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSessionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
-
Constructor Details
-
ServicesJob
public ServicesJob()
-
-
Method Details
-
execute
Description copied from class:SimpleJobExecute this job. -
onReset
protected void onReset()Description copied from class:SimpleJobAllow sub classes to do something on reset. -
getServices
Description copied from interface:ServiceProviderProvider the services.- Specified by:
getServicesin interfaceServiceProvider- Returns:
- The services. May be null.
- Reference Property:
- services
Description
Provide access to the registered services.Services are registered by name using object
toStringand then if qualified ';' and the qualifier. If this job has an idmy-servicesand the service has a toString ofMyCafeand it is qualified with qualifierVegetarianthen it could be referenced as:${my-services.services.service(MyCafe;Vegetarian)} -
setRegisteredServices
-