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 |
---|---|
java.lang.Object |
getService(java.lang.String serviceName)
Provide the service for the given name.
|
java.lang.String |
serviceNameFor(java.lang.Class<?> theClass,
java.lang.String flavour)
If these services can provide a service of the given
class then a name that identifies the service is provided.
|
java.lang.String serviceNameFor(java.lang.Class<?> theClass, java.lang.String flavour)
theClass
- The type of service.flavour
- An optional flavour. May be null.java.lang.Object getService(java.lang.String serviceName) throws java.lang.IllegalArgumentException
serviceName
- java.lang.IllegalArgumentException
- If no service for the
name can be provided.