|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Method Summary | |
---|---|
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. |
Method Detail |
---|
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.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |