|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An application context which provides access to services. Access to
services is provided by keeping a map from logical service types to ApplicationContextServiceProvider
objects. Each ApplicationContextServiceProvider is registered to manufacture
one or more services. Manufacturing instances of logical services is
delegated to the providers.
Supported API: false
Extendable: false
Field Summary | |
static String |
SERVICE
Label for the attribute. |
Fields inherited from interface wt.services.applicationcontext.ApplicationContextChild |
APPLICATION_CONTEXT |
Method Summary | |
boolean |
addAllServices(ApplicationContextServiceProvider serviceProvider)
Create map entries for all service classes which the passed service provider can manufacture. |
boolean |
addService(String serviceName,
ApplicationContextServiceProvider serviceProvider)
Add an entry which maps the serviceClass argument to the serviceProvider object. |
ApplicationContextServices |
getApplicationContextServices()
Conveniance operation used to cast getApplicationContext to ApplicationContextServices. |
Object |
getService(ApplicationContextChild contextChild,
Object requestor,
Class serviceClass,
Object selector)
Get a service based on the context, the requesting object, the selector, and the logical service class. |
Object |
getService(ApplicationContextChild contextChild,
Object requestor,
String serviceName,
Object selector)
Get a service based on the context, the requesting object, the selector, and the logical service name. |
String |
getServiceImplementationName(ApplicationContextChild childContext,
Object requestor,
String serviceName,
Object selector)
Get the name of the service implementation. |
Map |
getServiceImplementationNameMap(ApplicationContextChild childContext,
ACRequestor requestor,
String serviceName,
Object selector)
Get the name of the service implementation. |
Map |
getServiceImplementationNameMap(ApplicationContextChild childContext,
Object[] requestors,
String serviceName,
Object selector)
Get the name of the service implementation. |
Map |
getServiceMap(ApplicationContextChild contextChild,
ACRequestor requestor,
Class serviceClass,
Object selector)
Get a service based on the context, the requesting object, the selector, and the logical service class. |
Map |
getServiceMap(ApplicationContextChild contextChild,
ACRequestor requestor,
String serviceName,
Object selector)
Get a service based on the context, the requesting object, the selector, and the logical service name. |
Map |
getServiceMap(ApplicationContextChild contextChild,
Object[] requestors,
Class serviceClass,
Object selector)
Get a service based on the context, the requesting object, the selector, and the logical service class. |
Map |
getServiceMap(ApplicationContextChild contextChild,
Object[] requestors,
String serviceName,
Object selector)
Get a service based on the context, the requesting object, the selector, and the logical service name. |
Object[] |
getServices(ApplicationContextChild contextChild,
Object requestor,
String serviceName,
Object selector)
Get all available services based on the context, the requesting object, the selector, and the logical service name. |
Enumeration |
getServiceSelectors(ApplicationContextChild contextChild,
String serviceName,
Object requestor)
A service selector is an optional qualifier which can be used to help identify which version of a service is desired. |
Map |
getServicesMap(ApplicationContextChild contextChild,
ACRequestor requestor,
String serviceName,
Object selector)
Get all available services based on the context, the requesting object, the selector, and the logical service name. |
Map |
getServicesMap(ApplicationContextChild contextChild,
Object[] requestors,
String serviceName,
Object selector)
Get all available services based on the context, the requesting object, the selector, and the logical service name. |
boolean |
hasService(String serviceName)
Returns true if there is a mapping from the serviceClass to a service provider. |
Methods inherited from interface wt.services.applicationcontext.ApplicationContextChild |
getApplicationContext, setApplicationContext |
Field Detail |
public static final String SERVICE
Method Detail |
public ApplicationContextServices getApplicationContextServices()
public boolean addService(String serviceName, ApplicationContextServiceProvider serviceProvider)
serviceName
- serviceProvider
-
public boolean hasService(String serviceName)
serviceName
-
public boolean addAllServices(ApplicationContextServiceProvider serviceProvider)
serviceProvider
-
public Object getService(ApplicationContextChild contextChild, Object requestor, String serviceName, Object selector) throws UnableToCreateServiceException, ServiceNotFoundException
contextChild
- The context child making the service request.requestor
- The target of the service request.serviceName
- The logical name of the service.selector
- An optional selector to further identify the service.
UnableToCreateServiceException
ServiceNotFoundException
public Object getService(ApplicationContextChild contextChild, Object requestor, Class serviceClass, Object selector) throws UnableToCreateServiceException, ServiceNotFoundException
contextChild
- requestor
- serviceClass
- selector
- An optional selector to further identify the service.
UnableToCreateServiceException
ServiceNotFoundException
public Object[] getServices(ApplicationContextChild contextChild, Object requestor, String serviceName, Object selector) throws UnableToCreateServiceException, ServiceNotFoundException
contextChild
- The context child making the service request.requestor
- The target of the service request.serviceName
- The logical name of the service.selector
- An optional selector to further identify the service.
UnableToCreateServiceException
ServiceNotFoundException
public Map getServiceMap(ApplicationContextChild contextChild, Object[] requestors, String serviceName, Object selector) throws UnableToCreateServiceException, ServiceNotFoundException
contextChild
- The context child making the service request.requestors
- The target of the service request.serviceName
- The logical name of the service.selector
- An optional selector to further identify the service.
UnableToCreateServiceException
ServiceNotFoundException
public Map getServiceMap(ApplicationContextChild contextChild, Object[] requestors, Class serviceClass, Object selector) throws UnableToCreateServiceException, ServiceNotFoundException
contextChild
- requestors
- serviceClass
- selector
- An optional selector to further identify the service.
UnableToCreateServiceException
ServiceNotFoundException
public Map getServiceMap(ApplicationContextChild contextChild, ACRequestor requestor, Class serviceClass, Object selector) throws UnableToCreateServiceException, ServiceNotFoundException
contextChild
- requestor
- serviceClass
- selector
- An optional selector to further identify the service.
UnableToCreateServiceException
ServiceNotFoundException
public Map getServiceMap(ApplicationContextChild contextChild, ACRequestor requestor, String serviceName, Object selector) throws UnableToCreateServiceException, ServiceNotFoundException
contextChild
- The context child making the service request.requestor
- serviceName
- The logical name of the service.selector
- An optional selector to further identify the service.
UnableToCreateServiceException
ServiceNotFoundException
public Map getServicesMap(ApplicationContextChild contextChild, Object[] requestors, String serviceName, Object selector) throws UnableToCreateServiceException, ServiceNotFoundException
contextChild
- The context child making the service request.requestors
- The target of the service request.serviceName
- The logical name of the service.selector
- An optional selector to further identify the service.
UnableToCreateServiceException
ServiceNotFoundException
public Map getServicesMap(ApplicationContextChild contextChild, ACRequestor requestor, String serviceName, Object selector) throws UnableToCreateServiceException, ServiceNotFoundException
contextChild
- The context child making the service request.requestor
- serviceName
- The logical name of the service.selector
- An optional selector to further identify the service.
UnableToCreateServiceException
ServiceNotFoundException
public Enumeration getServiceSelectors(ApplicationContextChild contextChild, String serviceName, Object requestor)
contextChild
- serviceName
- requestor
-
public String getServiceImplementationName(ApplicationContextChild childContext, Object requestor, String serviceName, Object selector) throws ServiceNotFoundException
childContext
- The context child requesting the service implementation name. May be used to determine which specific service implementation should be provided.requestor
- The requestor or target of the service. Used to help determine which specific service implementation should be provided.serviceName
- The logical name of the service.selector
- An optional selector to further identify the service.
ServiceNotFoundException
public Map getServiceImplementationNameMap(ApplicationContextChild childContext, Object[] requestors, String serviceName, Object selector) throws ServiceNotFoundException
childContext
- The context child requesting the service implementation name. May be used to determine which specific service implementation should be provided.requestors
- The requestor or target of the service. Used to help determine which specific service implementation should be provided.serviceName
- The logical name of the service.selector
- An optional selector to further identify the service.
ServiceNotFoundException
public Map getServiceImplementationNameMap(ApplicationContextChild childContext, ACRequestor requestor, String serviceName, Object selector) throws ServiceNotFoundException
childContext
- The context child requesting the service implementation name. May be used to determine which specific service implementation should be provided.requestor
- serviceName
- The logical name of the service.selector
- An optional selector to further identify the service.
ServiceNotFoundException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |