wt.services.applicationcontext
Class WildCardServiceProvider

java.lang.Object
  extended bywt.services.applicationcontext.WildCardServiceProvider
All Implemented Interfaces:
ApplicationContextServiceProvider, Externalizable, Serializable

public class WildCardServiceProvider
extends Object
implements ApplicationContextServiceProvider, Externalizable

This service provider will attempt to construct a new instance of any requested service. It just uses the service name as the service class name.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  Hashtable service
           
 
Fields inherited from interface wt.services.applicationcontext.ApplicationContextServiceProvider
SERVICE, WILD_CARD
 
Constructor Summary
WildCardServiceProvider()
           
 
Method Summary
 Object getService(ApplicationContextChild contextChild, Object requestor, Class serviceClass, Object selector)
          

Supported API: false
 Object getService(ApplicationContextChild contextChild, Object requestor, String serviceName, Object selector)
          

Supported API: false
 String getServiceImplementationName(ApplicationContextChild contextChild, Object requestor, String serviceName, Object selector)
          

Supported API: false
 Map getServiceImplementationNameMap(ApplicationContextChild contextChild, ACRequestor requestor, String serviceName, Object selector)
          Return the name of the service implementation.
 Map getServiceImplementationNameMap(ApplicationContextChild contextChild, Object[] requestors, String serviceName, Object selector)
          Return the name of the service implementation.
 Map getServiceMap(ApplicationContextChild contextChild, ACRequestor requestor, Class serviceClass, Object selector)
          Return a service based on context, requestor and logical service type.
 Map getServiceMap(ApplicationContextChild contextChild, ACRequestor requestor, String serviceName, Object selector)
          Return an instance of a service based on context, requestor and logical service name.
 Map getServiceMap(ApplicationContextChild contextChild, Object[] requestors, Class serviceClass, Object selector)
          Return a service based on context, requestor and logical service type.
 Map getServiceMap(ApplicationContextChild contextChild, Object[] requestors, String serviceName, Object selector)
          Return an instance of a service based on context, requestor and logical service name.
 String[] getServiceNames()
          

Supported API: false
 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.
 Enumeration getServiceSelectors(String serviceName, String requestorName)
          

Supported API: false
protected  Object manufactureService(Class serviceClass)
          

Supported API: false
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

service

private Hashtable service

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values
Constructor Detail

WildCardServiceProvider

public WildCardServiceProvider()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

getServiceNames

public String[] getServiceNames()


Supported API: false

Specified by:
getServiceNames in interface ApplicationContextServiceProvider
Returns:
String[]

getService

public Object getService(ApplicationContextChild contextChild,
                         Object requestor,
                         String serviceName,
                         Object selector)
                  throws ServiceNotFoundException,
                         UnableToCreateServiceException


Supported API: false

Specified by:
getService in interface ApplicationContextServiceProvider
Parameters:
contextChild -
requestor -
serviceName -
selector -
Returns:
Object
Throws:
ServiceNotFoundException
UnableToCreateServiceException

getService

public Object getService(ApplicationContextChild contextChild,
                         Object requestor,
                         Class serviceClass,
                         Object selector)
                  throws ServiceNotFoundException,
                         UnableToCreateServiceException


Supported API: false

Specified by:
getService in interface ApplicationContextServiceProvider
Parameters:
contextChild -
requestor -
serviceClass -
selector -
Returns:
Object
Throws:
ServiceNotFoundException
UnableToCreateServiceException

getServiceMap

public Map getServiceMap(ApplicationContextChild contextChild,
                         Object[] requestors,
                         String serviceName,
                         Object selector)
                  throws UnableToCreateServiceException
Return an instance of a service based on context, requestor and logical service name.

Supported API: false

Specified by:
getServiceMap in interface ApplicationContextServiceProvider
Parameters:
contextChild - The context in which the service is being requested.
requestors - The target of the service request.
serviceName - The name of the requested service.
selector - An optional selector to further identify the service.
Returns:
Map
Throws:
UnableToCreateServiceException

getServiceMap

public Map getServiceMap(ApplicationContextChild contextChild,
                         Object[] requestors,
                         Class serviceClass,
                         Object selector)
                  throws UnableToCreateServiceException
Return a service based on context, requestor and logical service type.

Supported API: false

Specified by:
getServiceMap in interface ApplicationContextServiceProvider
Parameters:
contextChild - The service context in which the getService request was initiated.
requestors - The object on who's behalf the service request is being made.
serviceClass - The logical service class being requested.
selector - An optional selector to further identify the service.
Returns:
Map
Throws:
UnableToCreateServiceException

getServiceSelectors

public Enumeration getServiceSelectors(String serviceName,
                                       String requestorName)


Supported API: false

Parameters:
serviceName -
requestorName -
Returns:
Enumeration

getServiceImplementationName

public String getServiceImplementationName(ApplicationContextChild contextChild,
                                           Object requestor,
                                           String serviceName,
                                           Object selector)


Supported API: false

Specified by:
getServiceImplementationName in interface ApplicationContextServiceProvider
Parameters:
contextChild -
requestor -
serviceName -
selector -
Returns:
String

getServiceImplementationNameMap

public Map getServiceImplementationNameMap(ApplicationContextChild contextChild,
                                           Object[] requestors,
                                           String serviceName,
                                           Object selector)
Return the name of the service implementation. Usuall this is the fully qualified class name, but it may be any string (implying that a service can't be instantiated.

Supported API: false

Specified by:
getServiceImplementationNameMap in interface ApplicationContextServiceProvider
Parameters:
contextChild - The context in which the service request was initiated. May be used to determine which service implementation should be returned.
requestors - The requestor or target of the service. Used to determine which service implementation should be returned.
serviceName - The logical name of the desired service.
selector - An optional selector to further identify the service.
Returns:
Map

manufactureService

protected Object manufactureService(Class serviceClass)
                             throws IllegalAccessException,
                                    InstantiationException


Supported API: false

Parameters:
serviceClass -
Returns:
Object
Throws:
IllegalAccessException
InstantiationException

getServiceMap

public Map getServiceMap(ApplicationContextChild contextChild,
                         ACRequestor requestor,
                         String serviceName,
                         Object selector)
                  throws UnableToCreateServiceException
Return an instance of a service based on context, requestor and logical service name.

Supported API: false

Specified by:
getServiceMap in interface ApplicationContextServiceProvider
Parameters:
contextChild - The context in which the service is being requested.
requestor -
serviceName - The name of the requested service.
selector - An optional selector to further identify the service.
Returns:
Map
Throws:
UnableToCreateServiceException

getServiceMap

public Map getServiceMap(ApplicationContextChild contextChild,
                         ACRequestor requestor,
                         Class serviceClass,
                         Object selector)
                  throws UnableToCreateServiceException
Return a service based on context, requestor and logical service type.

Supported API: false

Specified by:
getServiceMap in interface ApplicationContextServiceProvider
Parameters:
contextChild - The service context in which the getService request was initiated.
requestor -
serviceClass - The logical service class being requested.
selector - An optional selector to further identify the service.
Returns:
Map
Throws:
UnableToCreateServiceException

getServiceImplementationNameMap

public Map getServiceImplementationNameMap(ApplicationContextChild contextChild,
                                           ACRequestor requestor,
                                           String serviceName,
                                           Object selector)
Return the name of the service implementation. Usuall this is the fully qualified class name, but it may be any string (implying that a service can't be instantiated.

Supported API: false

Specified by:
getServiceImplementationNameMap in interface ApplicationContextServiceProvider
Parameters:
contextChild - The context in which the service request was initiated. May be used to determine which service implementation should be returned.
requestor -
serviceName - The logical name of the desired service.
selector - An optional selector to further identify the service.
Returns:
Map

getServiceSelectors

public 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. An application can determine which selectors are available for a service within a certain context.

Supported API: false

Specified by:
getServiceSelectors in interface ApplicationContextServiceProvider
Parameters:
contextChild -
serviceName -
requestor -
Returns:
Enumeration