wt.services.applicationcontext.implementation
Class WTServiceProviderFromProperties

java.lang.Object
  extended bywt.services.applicationcontext.implementation.WTServiceProvider
      extended bywt.services.applicationcontext.implementation.WTServiceProviderFromProperties
All Implemented Interfaces:
ApplicationContextServiceProvider, Serializable

public class WTServiceProviderFromProperties
extends WTServiceProvider
implements Serializable

Extends WTServiceProvider functionality to load service information from property files. File service.properties in the test directory under applicationcontext is an example of a properties file which can be loaded by instances of WTServiceProviderFromProperties.

The format of each service entry is as follows:

wt.services/svc/<ContextName>/<ServiceName>/<Requestor>/<Selector> | null/<SearchOrderNumber>=<ServiceImplementationName>

The format of a resource entry is as follows:

wt.services/rsc/<ContextName>/<ResourceName>/<Requestor>/<Selector> | null/<SearchOrderNumber>=<ResourceName>

The property files that are loaded are identified by the properties wt.services.applicationcontext.WTServiceProviderFromProperties.defaultPropertyFiles and wt.services.applicationcontext.WTServiceProviderFromProperties.customPropertyFiles found in the standard Windchill properties file.

defaultPropertyFiles should not be changed by customizers. Instead use the customPropertyFiles to specify any new or overriding properties in a seperate file(s). Files are specified in a comma seperated list (no spaces) and loaded in the order in which they are specified. If two or more properties have the same key the last one to be loaded will "override" the previous ones.

To see if any properties have been overriden run the main rountine of this class.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static String ENTRY_SEPARATOR
          Each wt.services entry in the properties is parsed using this delimiter.
private static String RESOURCE
           
static String SERVICE_PREFIX
          Each entry in the properties should have this prefix.
static String TOKEN_CONTEXT_NAME
          Constant used to identify the service context name token which is parsed from the service property entry.
static String TOKEN_IMPLEMENTATION_NAME
          Constant used to identify the service implementation name token which is parsed from the service property entry.
static String TOKEN_PRIORITY
          Constant used to identify the search ordertoken which is parsed from the service property entry.
static String TOKEN_REQUESTOR_NAME
          Constant used to identify the service requstor token which is parsed from the service property entry.
static String TOKEN_SELECTOR
          Constant used to identify the service selector token which is parsed from the service property entry.
static String TOKEN_SERVICE_NAME
          Constant used to identify the logical service name token which is parsed from the service property entry.
static String TOKEN_SERVICE_TYPE
          Constant used to identify the service type token which is parsed from the service property entry.
private static boolean VERBOSE
           
 
Fields inherited from class wt.services.applicationcontext.implementation.WTServiceProvider
 
Fields inherited from interface wt.services.applicationcontext.ApplicationContextServiceProvider
SERVICE, WILD_CARD
 
Constructor Summary
WTServiceProviderFromProperties(Properties properties)
          Construct a service provider using the passed properties.
 
Method Summary
static void main(String[] args)
          Lists all current service entries available to WTServiceProviderFromProperties.
protected  WTServiceInfo parseServiceInfo(String s)
           
protected  void parseServiceInfos(Properties properties)
           
 
Methods inherited from class wt.services.applicationcontext.implementation.WTServiceProvider
addServiceInfo, createInfoKey, createInfoKeyWOSelector, getAllClasses, getAllSuperClasses, getService, getService, getServiceImplementation, getServiceImplementationName, getServiceImplementationNameMap, getServiceImplementationNameMap, getServiceInfos, getServiceInfosForRequestor, getServiceInfosWOSelector, getServiceMap, getServiceMap, getServiceMap, getServiceMap, getServiceNames, getServiceSelectors, getSingletonImplementation, printOn, setServiceInfosWOSelector
 
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_PREFIX

public static final String SERVICE_PREFIX
Each entry in the properties should have this prefix.

Supported API: false

See Also:
Constant Field Values

ENTRY_SEPARATOR

public static final String ENTRY_SEPARATOR
Each wt.services entry in the properties is parsed using this delimiter.

Supported API: false

See Also:
Constant Field Values

TOKEN_SERVICE_TYPE

public static final String TOKEN_SERVICE_TYPE
Constant used to identify the service type token which is parsed from the service property entry.

Supported API: false

See Also:
Constant Field Values

TOKEN_CONTEXT_NAME

public static final String TOKEN_CONTEXT_NAME
Constant used to identify the service context name token which is parsed from the service property entry.

Supported API: false

See Also:
Constant Field Values

TOKEN_SERVICE_NAME

public static final String TOKEN_SERVICE_NAME
Constant used to identify the logical service name token which is parsed from the service property entry.

Supported API: false

See Also:
Constant Field Values

TOKEN_SELECTOR

public static final String TOKEN_SELECTOR
Constant used to identify the service selector token which is parsed from the service property entry.

Supported API: false

See Also:
Constant Field Values

TOKEN_PRIORITY

public static final String TOKEN_PRIORITY
Constant used to identify the search ordertoken which is parsed from the service property entry.

Supported API: false

See Also:
Constant Field Values

TOKEN_REQUESTOR_NAME

public static final String TOKEN_REQUESTOR_NAME
Constant used to identify the service requstor token which is parsed from the service property entry.

Supported API: false

See Also:
Constant Field Values

TOKEN_IMPLEMENTATION_NAME

public static final String TOKEN_IMPLEMENTATION_NAME
Constant used to identify the service implementation name token which is parsed from the service property entry.

Supported API: false

See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE
Constructor Detail

WTServiceProviderFromProperties

public WTServiceProviderFromProperties(Properties properties)
                                throws UnableToParseServiceException
Construct a service provider using the passed properties.

Supported API: false

Parameters:
properties -
Throws:
UnableToParseServiceException
Method Detail

parseServiceInfos

protected void parseServiceInfos(Properties properties)
                          throws UnableToParseServiceException
Throws:
UnableToParseServiceException

parseServiceInfo

protected WTServiceInfo parseServiceInfo(String s)
                                  throws UnableToParseServiceException
Throws:
UnableToParseServiceException

main

public static void main(String[] args)
Lists all current service entries available to WTServiceProviderFromProperties. Optionally a filter string can be specified on the command line to show only entries that begin with the filter string.