Package org.oddjob.arooa.registry
Interface Services
- All Known Subinterfaces:
ConductorService,OddjobServices
- All Known Implementing Classes:
OddjobPanel,OddjobServicesBean,SimpleConductorService
public interface Services
A Lookup for services. Looking up services is a two step
process. First get the name of the service, then use the
name to get the service. This is to allow services to be
accessed directly in configuration using the mapped property
syntax my-component.services(executor-service).
The Service name can be anything but so that it can be used
in configuration it is advisable that it doesn't contain
any of reserved characters .[]()
An optional flavour can be specified which may affect
the service provided. For instance
serviceNameFor(ExecutorService.class, "pooled")
might return "executor-service;pooled", which can the be passed
to the @{link getService(String) method.
Implementations should document what services they provide and there names.
- Author:
- rob
-
Method Summary
Modifier and TypeMethodDescriptiongetService(String serviceName) Provide the service for the given name.serviceNameFor(Class<?> theClass, String flavour) If these services can provide a service of the given class then a name that identifies the service is provided.
-
Method Details
-
serviceNameFor
If these services can provide a service of the given class then a name that identifies the service is provided.- Parameters:
theClass- The type of service.flavour- An optional flavour. May be null.- Returns:
- A service name, or null if none can be provided.
-
getService
Provide the service for the given name.- Parameters:
serviceName-- Returns:
- A service for the name.
- Throws:
IllegalArgumentException- If no service for the name can be provided.
-