public interface Services
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.
Modifier and Type | Method and Description |
---|---|
Object |
getService(String serviceName)
Provide the service for the given name.
|
String |
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.
|
String serviceNameFor(Class<?> theClass, String flavour)
theClass
- The type of service.flavour
- An optional flavour. May be null.Object getService(String serviceName) throws IllegalArgumentException
serviceName
- IllegalArgumentException
- If no service for the
name can be provided.