wt.services.applicationcontext.implementation
Class DefaultServiceProvider

java.lang.Object
  extended bywt.services.applicationcontext.implementation.DefaultServiceProvider
All Implemented Interfaces:
ApplicationContextChild, Externalizable, Serializable

public final class DefaultServiceProvider
extends Object
implements ApplicationContextChild, Externalizable

A default service provider implementation that conveniently wraps WTDefaultApplicationContext to issue service objects.

Supported API: true

Extendable: false

See Also:
WTDefaultApplicationContext, Serialized Form

Field Summary
private  ApplicationContext applicationContext
           
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static DefaultServiceProvider serviceProvider
           
private static boolean VERBOSE
           
 
Fields inherited from interface wt.services.applicationcontext.ApplicationContextChild
APPLICATION_CONTEXT
 
Constructor Summary
DefaultServiceProvider()
           
 
Method Summary
 ApplicationContext getApplicationContext()
          Gets the object for the association that plays role: applicationContext.
private  ApplicationContextServices getApplicationContextServices()
           
static Object getService(Class service_class)
          Returns an implementation of a service object based upon the supplied arguments.
static Object getService(Class service_class, Object requestor)
          Returns an implementation of a service object based upon the supplied arguments.
static Object getService(Class service_class, String selector)
          Returns an implementation of a service object based upon the supplied arguments.
static Object getService(Class service_class, String selector, Object requestor)
          Returns an implementation of a service object based upon the supplied arguments.
static Object getService(String service_name)
          Returns an implementation of a service object based upon the supplied arguments.
static Object getService(String service_name, Object requestor)
          Returns an implementation of a service object based upon the supplied arguments.
static Object getService(String service_name, String selector)
          Returns an implementation of a service object based upon the supplied arguments.
static Object getService(String service_name, String selector, Object requestor)
          Returns an implementation of a service object based upon the supplied arguments.
static Map getServiceMap(Class service_class, ACRequestor requestor)
          Returns an implementation of a service object based upon the supplied arguments.
static Map getServiceMap(Class service_class, Object[] requestors)
          Returns an implementation of a service object based upon the supplied arguments.
static Map getServiceMap(Class service_class, String selector, ACRequestor requestor)
          Returns an implementation of a service object based upon the supplied arguments.
static Map getServiceMap(Class service_class, String selector, Object[] requestors)
          Returns an implementation of a service object based upon the supplied arguments.
static Map getServiceMap(String service_name, ACRequestor requestor)
          Returns an implementation of a service object based upon the supplied arguments.
static Map getServiceMap(String service_name, Object[] requestors)
          Returns an implementation of a service object based upon the supplied arguments.
static Map getServiceMap(String service_name, String selector, ACRequestor requestor)
          Returns an implementation of a service object based upon the supplied arguments.
static Map getServiceMap(String service_name, String selector, Object[] requestors)
          Returns an implementation of a service object based upon the supplied arguments.
private static void initializeServiceProvider()
           
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
 void setApplicationContext(ApplicationContext a_ApplicationContext)
          Sets the object for the association that plays role: applicationContext.
 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

serviceProvider

private static DefaultServiceProvider serviceProvider

applicationContext

private ApplicationContext applicationContext

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

VERBOSE

private static final boolean VERBOSE
Constructor Detail

DefaultServiceProvider

public DefaultServiceProvider()
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

getService

public static Object getService(Class service_class,
                                String selector,
                                Object requestor)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_class - Class of the service that is desired. This is required. In typical usage, this is a java Interface the service object returned must implement. The lookup for the particular service implementer is refined by indicating a selector and/or a target object (requestor) that is in need of the service.
selector - A selector further qualifies the request for the service. It may also be used instead of a requestor object to request the service. This latter technique is used when a simple string can indicate which variant of the service is needed, rather than supplying a java class.
requestor - An object that is the target of the request for service. The typical meaning is the the requestor object needs the service. Java inheritance using the class of the requestor to help determine which service implementation is returned. If the requestor is a Class object, inheritance based upon the class that the requestor represents is used in the determination.
Returns:
Object
Throws:
UnableToCreateServiceException

getService

public static Object getService(Class service_class,
                                String selector)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_class - Class of the service that is desired. This is required. In typical usage, this is a java Interface the service object returned must implement. The lookup for the particular service implementer is refined by indicating a selector and/or a target object (requestor) that is in need of the service.
selector - A selector further qualifies the request for the service. It may also be used instead of a requestor object to request the service. This latter technique is used when a simple string can indicate which variant of the service is needed, rather than supplying a java class.
Returns:
Object
Throws:
UnableToCreateServiceException

getService

public static Object getService(Class service_class,
                                Object requestor)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_class - Class of the service that is desired. This is required. In typical usage, this is a java Interface the service object returned must implement. The lookup for the particular service implementer is refined by indicating a selector and/or a target object (requestor) that is in need of the service.
requestor - A selector further qualifies the request for the service. It may also be used instead of a requestor object to request the service. This latter technique is used when a simple string can indicate which variant of the service is needed, rather than supplying a java class.
Returns:
Object
Throws:
UnableToCreateServiceException

getService

public static Object getService(Class service_class)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_class - Class of the service that is desired. This is required. In typical usage, this is a java Interface the service object returned must implement. The lookup for the particular service implementer is refined by indicating a selector and/or a target object (requestor) that is in need of the service.
Returns:
Object
Throws:
UnableToCreateServiceException

getService

public static Object getService(String service_name,
                                String selector,
                                Object requestor)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_name - Name of the service that is desired. This is required. The lookup for the particular service implementer can be refined by indicating a selector and/or a target object (requestor) that is in need of the service.
selector - A selector further qualifies the request for the service. It may also be used instead of a requestor object to request the service. This latter technique is used when a simple string can indicate which variant of the service is needed, rather than supplying a java class.
requestor - An object that is the target of the request for service. The typical meaning is the the requestor object needs the service. Java inheritance using the class of the requestor to help determine which service implementation is returned. If the requestor is a Class object, inheritance based upon the class that the requestor represents is used in the determination.
Returns:
Object
Throws:
UnableToCreateServiceException

getService

public static Object getService(String service_name,
                                String selector)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_name - Name of the service that is desired. This is required. The lookup for the particular service implementer can be refined by indicating a selector and/or a target object (requestor) that is in need of the service.
selector - A selector further qualifies the request for the service. It may also be used instead of a requestor object to request the service. This latter technique is used when a simple string can indicate which variant of the service is needed, rather than supplying a java class.
Returns:
Object
Throws:
UnableToCreateServiceException

getService

public static Object getService(String service_name,
                                Object requestor)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_name - Name of the service that is desired. This is required. The lookup for the particular service implementer can be refined by indicating a selector and/or a target object (requestor) that is in need of the service.
requestor - A selector further qualifies the request for the service. It may also be used instead of a requestor object to request the service. This latter technique is used when a simple string can indicate which variant of the service is needed, rather than supplying a java class.
Returns:
Object
Throws:
UnableToCreateServiceException

getService

public static Object getService(String service_name)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_name - Name of the service that is desired. This is required. The lookup for the particular service implementer can be refined by indicating a selector and/or a target object (requestor) that is in need of the service.
Returns:
Object
Throws:
UnableToCreateServiceException

getServiceMap

public static Map getServiceMap(Class service_class,
                                String selector,
                                Object[] requestors)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_class - Class of the service that is desired. This is required. In typical usage, this is a java Interface the service object returned must implement. The lookup for the particular service implementer is refined by indicating a selector and/or a target object (requestor) that is in need of the service.
selector - A selector further qualifies the request for the service. It may also be used instead of a requestor object to request the service. This latter technique is used when a simple string can indicate which variant of the service is needed, rather than supplying a java class.
requestors -
Returns:
Map
Throws:
UnableToCreateServiceException

getServiceMap

public static Map getServiceMap(Class service_class,
                                Object[] requestors)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_class - Class of the service that is desired. This is required. In typical usage, this is a java Interface the service object returned must implement. The lookup for the particular service implementer is refined by indicating a selector and/or a target object (requestor) that is in need of the service.
requestors -
Returns:
Map
Throws:
UnableToCreateServiceException

getServiceMap

public static Map getServiceMap(String service_name,
                                String selector,
                                Object[] requestors)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_name - Name of the service that is desired. This is required. The lookup for the particular service implementer can be refined by indicating a selector and/or a target object (requestor) that is in need of the service.
selector - A selector further qualifies the request for the service. It may also be used instead of a requestor object to request the service. This latter technique is used when a simple string can indicate which variant of the service is needed, rather than supplying a java class.
requestors -
Returns:
Map
Throws:
UnableToCreateServiceException

getServiceMap

public static Map getServiceMap(String service_name,
                                Object[] requestors)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_name - Name of the service that is desired. This is required. The lookup for the particular service implementer can be refined by indicating a selector and/or a target object (requestor) that is in need of the service.
requestors -
Returns:
Map
Throws:
UnableToCreateServiceException

getServiceMap

public static Map getServiceMap(Class service_class,
                                String selector,
                                ACRequestor requestor)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_class - Class of the service that is desired. This is required. In typical usage, this is a java Interface the service object returned must implement. The lookup for the particular service implementer is refined by indicating a selector and/or a target object (requestor) that is in need of the service.
selector - A selector further qualifies the request for the service. It may also be used instead of a requestor object to request the service. This latter technique is used when a simple string can indicate which variant of the service is needed, rather than supplying a java class.
requestor -
Returns:
Map
Throws:
UnableToCreateServiceException

getServiceMap

public static Map getServiceMap(Class service_class,
                                ACRequestor requestor)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_class - Class of the service that is desired. This is required. In typical usage, this is a java Interface the service object returned must implement. The lookup for the particular service implementer is refined by indicating a selector and/or a target object (requestor) that is in need of the service.
requestor -
Returns:
Map
Throws:
UnableToCreateServiceException

getServiceMap

public static Map getServiceMap(String service_name,
                                String selector,
                                ACRequestor requestor)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_name - Name of the service that is desired. This is required. The lookup for the particular service implementer can be refined by indicating a selector and/or a target object (requestor) that is in need of the service.
selector - A selector further qualifies the request for the service. It may also be used instead of a requestor object to request the service. This latter technique is used when a simple string can indicate which variant of the service is needed, rather than supplying a java class.
requestor -
Returns:
Map
Throws:
UnableToCreateServiceException

getServiceMap

public static Map getServiceMap(String service_name,
                                ACRequestor requestor)
                         throws UnableToCreateServiceException
Returns an implementation of a service object based upon the supplied arguments.

Supported API: true

Parameters:
service_name - Name of the service that is desired. This is required. The lookup for the particular service implementer can be refined by indicating a selector and/or a target object (requestor) that is in need of the service.
requestor -
Returns:
Map
Throws:
UnableToCreateServiceException

getApplicationContext

public ApplicationContext getApplicationContext()
Gets the object for the association that plays role: applicationContext.

Supported API: false

Specified by:
getApplicationContext in interface ApplicationContextChild
Returns:
ApplicationContext

setApplicationContext

public void setApplicationContext(ApplicationContext a_ApplicationContext)
                           throws WTPropertyVetoException
Sets the object for the association that plays role: applicationContext.

Supported API: false

Specified by:
setApplicationContext in interface ApplicationContextChild
Parameters:
a_ApplicationContext -
Throws:
WTPropertyVetoException

initializeServiceProvider

private static void initializeServiceProvider()

getApplicationContextServices

private ApplicationContextServices getApplicationContextServices()