Class ServicesJob

All Implemented Interfaces:
Runnable, ArooaContextAware, ArooaSessionAware, ServiceProvider, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resettable, Stateful

public class ServicesJob extends SimpleJob implements ServiceProvider
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.
  • Constructor Details

    • ServicesJob

      public ServicesJob()
  • Method Details

    • 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:
      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
      Returns:
      The services. May be null.
      Reference 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)}
       
    • setRegisteredServices

      public void setRegisteredServices(int index, ServicesJob.ServiceDefinition serviceDef)