wt.rule.impl
Class RuleApplierFactory

java.lang.Object
  extended bywt.rule.impl.RuleApplierFactory
All Implemented Interfaces:
ApplicationContextChild

class RuleApplierFactory
extends Object
implements ApplicationContextChild

This factory class supplies RuleAppliers that can be used to apply a rule to a particular object. The appropriate RuleApplier is selected based on the RuleType to be applied and the type of object that the rule is to be applied to.

Implementations of the RuleApplier interface should not be created directly. Instead, an instance of this factory class should be used to obtain a delegate instance.

This factory class uses information in the services.properties file to determine the appropriate delegate to return. See getApplier(java.lang.Object, wt.rule.RuleType) for more information.

Supported API: false

Extendable: false


Field Summary
private  ApplicationContext applicationContext
           
private static String CLASSNAME
           
private static String RESOURCE
           
private static String SERVICE_NAME
           
 
Fields inherited from interface wt.services.applicationcontext.ApplicationContextChild
APPLICATION_CONTEXT
 
Constructor Summary
RuleApplierFactory()
          Create a RuleApplierFactory.
 
Method Summary
private  ApplicationContextServices getApplContextServices()
          Get the application context cast as an ApplicationContextServices.
 ApplicationContext getApplicationContext()
          Gets the object for the association that plays role: applicationContext.
 RuleApplier getApplier(Object requestor, RuleType ruleType)
          Returns an applier that can be used to apply a rule of the specified ruleType to the specified requestor type.
 void setApplicationContext(ApplicationContext a_ApplicationContext)
          Sets the object for the association that plays role: applicationContext.
 
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

applicationContext

private ApplicationContext applicationContext

SERVICE_NAME

private static final String SERVICE_NAME
Constructor Detail

RuleApplierFactory

public RuleApplierFactory()
Create a RuleApplierFactory.

Supported API: false

Method Detail

getApplier

public RuleApplier getApplier(Object requestor,
                              RuleType ruleType)
Returns an applier that can be used to apply a rule of the specified ruleType to the specified requestor type.

The returned applier is determined based on information in the services.properties file. An entry in the services.properties file looks like this:

 wt.services/svc/<ContextName>/<ServiceName>/<Selector>/<Requestor>/<Order>
 

An entry for a RuleApplier uses the following values:

   <ServiceName> ==> wt.rule.RuleApplier
   <Selector>    ==> RuleType
   <Requestor>   ==> requestor type
 

Parameters:
requestor - the type of object to apply rules to (cannot be null)
ruleType - the type of rule to be applied (cannot be null)
Returns:
RuleApplier

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

getApplContextServices

private ApplicationContextServices getApplContextServices()
Get the application context cast as an ApplicationContextServices.