|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.services.applicationcontext.ApplicationContextServicesSupport
A basic implementation of a ApplicationContextServices.
Supported API: false
Extendable: false
Field Summary | |
private ApplicationContext |
applicationContext
|
private ApplicationContextServices |
applicationContextServices
|
private static String |
CLASSNAME
|
private ApplicationContextServices |
peer
|
private static String |
RESOURCE
|
private com.objectspace.jgl.HashMap |
serviceProviders
|
Fields inherited from interface wt.services.applicationcontext.ApplicationContextServices |
SERVICE |
Fields inherited from interface wt.services.applicationcontext.ApplicationContextChild |
APPLICATION_CONTEXT |
Constructor Summary | |
ApplicationContextServicesSupport()
Supported API: false |
|
ApplicationContextServicesSupport(ApplicationContextServices peer)
Supported API: false |
Method Summary | |
boolean |
addAllServices(ApplicationContextServiceProvider serviceProvider)
Register all the services which can be supplied by the service provider. |
boolean |
addService(String serviceName,
ApplicationContextServiceProvider serviceProvider)
Add an entry which maps the serviceClass argument to the serviceProvider object. |
ApplicationContext |
getApplicationContext()
Gets the object for the association that plays role: applicationContext. |
ApplicationContextServices |
getApplicationContextServices()
Supported API: false |
ApplicationContextServices |
getPeer()
Gets the object for the association that plays role: peer. |
Object |
getService(ApplicationContextChild childContext,
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 childContext,
Object requestor,
String serviceName,
Object selector)
Get a service based on the context, the requesting object, the selector, and the logical service name. |
private Object |
getServiceImpl(ApplicationContextChild childContext,
Object requestor,
String serviceName,
Object selector)
Tries to get the requested service in the current context from the ApplicationContextServiceProvider associated with the requested service. |
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. |
private Map |
getServiceMapImpl(ApplicationContextChild childContext,
ACRequestor requestor,
String serviceName,
Object selector)
|
private Map |
getServiceMapImpl(ApplicationContextChild childContext,
Object[] requestors,
String serviceName,
Object selector)
|
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. |
void |
setApplicationContext(ApplicationContext a_ApplicationContext)
Sets the object for the association that plays role: applicationContext. |
void |
setPeer(ApplicationContextServices a_Peer)
Sets the object for the association that plays role: peer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private ApplicationContextServices peer
private ApplicationContext applicationContext
private ApplicationContextServices applicationContextServices
private com.objectspace.jgl.HashMap serviceProviders
Constructor Detail |
public ApplicationContextServicesSupport()
public ApplicationContextServicesSupport(ApplicationContextServices peer)
peer
- Method Detail |
public ApplicationContextServices getPeer()
public void setPeer(ApplicationContextServices a_Peer) throws WTPropertyVetoException
a_Peer
-
WTPropertyVetoException
public ApplicationContextServices getApplicationContextServices()
getApplicationContextServices
in interface ApplicationContextServices
public boolean addService(String serviceName, ApplicationContextServiceProvider serviceProvider)
addService
in interface ApplicationContextServices
serviceName
- The logical service which the service provider will manufacture.serviceProvider
- The provider which will manufacture the service.
public boolean hasService(String serviceName)
hasService
in interface ApplicationContextServices
serviceName
- The logical service class being checked.
public boolean addAllServices(ApplicationContextServiceProvider serviceProvider)
addAllServices
in interface ApplicationContextServices
serviceProvider
- The provider which will supply the services.
public Object getService(ApplicationContextChild childContext, Object requestor, String serviceName, Object selector) throws UnableToCreateServiceException, ServiceNotFoundException
getService
in interface ApplicationContextServices
childContext
- requestor
- serviceName
- selector
-
UnableToCreateServiceException
ServiceNotFoundException
public Object getService(ApplicationContextChild childContext, Object requestor, Class serviceClass, Object selector) throws UnableToCreateServiceException, ServiceNotFoundException
getService
in interface ApplicationContextServices
childContext
- The context child requesting the service.requestor
- The object on who's behalf the service is being requested.serviceClass
- The logical service class.selector
-
UnableToCreateServiceException
ServiceNotFoundException
public Object[] getServices(ApplicationContextChild contextChild, Object requestor, String serviceName, Object selector) throws UnableToCreateServiceException, ServiceNotFoundException
getServices
in interface ApplicationContextServices
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
getServiceMap
in interface ApplicationContextServices
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
getServiceMap
in interface ApplicationContextServices
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
getServiceMap
in interface ApplicationContextServices
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
getServiceMap
in interface ApplicationContextServices
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
getServicesMap
in interface ApplicationContextServices
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
getServicesMap
in interface ApplicationContextServices
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 String getServiceImplementationName(ApplicationContextChild childContext, Object requestor, String serviceName, Object selector) throws ServiceNotFoundException
getServiceImplementationName
in interface ApplicationContextServices
childContext
- The context child for which the service is being requested. May be used to determine which implementation of the service should be returned.requestor
- The requestor or target of the service. Used to determine which implementation of the service should be returned.serviceName
- The logical name of the desired service.selector
-
ServiceNotFoundException
public Map getServiceImplementationNameMap(ApplicationContextChild childContext, Object[] requestors, String serviceName, Object selector) throws ServiceNotFoundException
getServiceImplementationNameMap
in interface ApplicationContextServices
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
getServiceImplementationNameMap
in interface ApplicationContextServices
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
public Enumeration getServiceSelectors(ApplicationContextChild contextChild, String serviceName, Object requestor)
getServiceSelectors
in interface ApplicationContextServices
contextChild
- serviceName
- requestor
-
private Object getServiceImpl(ApplicationContextChild childContext, Object requestor, String serviceName, Object selector)
childContext
- requestor
- serviceName
- selector
-
public ApplicationContext getApplicationContext()
getApplicationContext
in interface ApplicationContextChild
public void setApplicationContext(ApplicationContext a_ApplicationContext) throws WTPropertyVetoException
setApplicationContext
in interface ApplicationContextChild
a_ApplicationContext
-
WTPropertyVetoException
private Map getServiceMapImpl(ApplicationContextChild childContext, Object[] requestors, String serviceName, Object selector)
private Map getServiceMapImpl(ApplicationContextChild childContext, ACRequestor requestor, String serviceName, Object selector)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |