wt.rule.init
Class StandardInitRuleEvalService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.rule.init.StandardInitRuleEvalService
All Implemented Interfaces:
InitRuleEvalService, Manager, NetFactor, Serializable

public class StandardInitRuleEvalService
extends StandardManager
implements InitRuleEvalService, Serializable

Use the newStandardInitRuleEvalService static factory method(s), not the StandardInitRuleEvalService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
static class StandardInitRuleEvalService.Cache
          A cache for parsed rules.
 
Field Summary
private static CacheManager _cache
           
private static String CLASSNAME
           
private static InitRuleEvaluator EVALUATOR
          the utility that supports evaluating INIT rules
private static String EVALUATOR_DEFAULT
           
private static String EVALUATOR_PROP
           
private static String RESOURCE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardInitRuleEvalService()
           
 
Method Summary
private static void createCache()
          Create the CacheManager that this service uses to cache parsed rules.
 AttributeValues getAttributeValues(Rule rule)
          Return the attribute values specification that results from parsing the rule.
private static CacheManager getCache()
          Return the CacheManager that is used by this service.
 String getConceptualClassname()
          Deprecated.  
private  AttributeValues getParsedRule(RuleCacheKey key)
          Query the cache using the specified key.
 Object getValue(AlgoValue value, Object object, WTContainerRef container)
          Calculate the value using the specified algorithm and arguments.
 Object getValue(Attr attr, Object object)
          Get the value of the specified attribute from the specified object.
 Object getValue(String id, Object object, WTContainerRef container)
          Calculate the value for the attribute with the specified id for the specified object and container.
static StandardInitRuleEvalService newStandardInitRuleEvalService()
          Default factory for the class.
private  void putParsedRule(RuleCacheKey key, AttributeValues parsedRule)
          Put the parsed rule in the cache.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, performStartupProcess, registerEvents, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

EVALUATOR

private static final InitRuleEvaluator EVALUATOR
the utility that supports evaluating INIT rules


EVALUATOR_PROP

private static final String EVALUATOR_PROP
See Also:
Constant Field Values

EVALUATOR_DEFAULT

private static final String EVALUATOR_DEFAULT
See Also:
Constant Field Values

_cache

private static CacheManager _cache
Constructor Detail

StandardInitRuleEvalService

public StandardInitRuleEvalService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

newStandardInitRuleEvalService

public static StandardInitRuleEvalService newStandardInitRuleEvalService()
                                                                  throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardInitRuleEvalService
Throws:
WTException

getAttributeValues

public AttributeValues getAttributeValues(Rule rule)
                                   throws WTException
Return the attribute values specification that results from parsing the rule.

Supported API: false

Specified by:
getAttributeValues in interface InitRuleEvalService
Parameters:
rule -
Returns:
AttributeValues
Throws:
WTException

getValue

public Object getValue(String id,
                       Object object,
                       WTContainerRef container)
                throws WTException
Calculate the value for the attribute with the specified id for the specified object and container.

The object argument may be a type identifier or a normal object. A type identifier is one of the following:

If a type identifier is passed in, then the attribute value is calculated using default values for any attributes referenced by the INIT rule. Otherwise, attribute values from the object are used.

Supported API: false

Specified by:
getValue in interface InitRuleEvalService
Parameters:
id - the logical identifier of the attribute
object - the object to use for attribute references or a type identifier
container - the container to use for data lookups
Returns:
Object
Throws:
WTException

getValue

public Object getValue(AlgoValue value,
                       Object object,
                       WTContainerRef container)
                throws WTException
Calculate the value using the specified algorithm and arguments.

The object argument may be a type identifier or a normal object. A type identifier is one of the following:

If a type identifier is passed in, then the attribute value is calculated using default values for any attributes referenced while computing the attribute value. Otherwise, attribute values from the object are used.

Supported API: false

Specified by:
getValue in interface InitRuleEvalService
Parameters:
value - the value to be calculated
object - the object to use for attribute references or a type identifier
container - the container to use for data lookups
Returns:
Object
Throws:
WTException

getValue

public Object getValue(Attr attr,
                       Object object)
                throws WTException
Get the value of the specified attribute from the specified object.

The object argument may be a type identifier or a normal object. A type identifier is one of the following:

If a type identifier is passed in, then the default value for the attribute is returned. Otherwise, the value is obtained from the object.

Supported API: false

Specified by:
getValue in interface InitRuleEvalService
Parameters:
attr - the attribute to get
object - the object to get the value from or a type identifier
Returns:
Object
Throws:
WTException

getParsedRule

private AttributeValues getParsedRule(RuleCacheKey key)
Query the cache using the specified key.


putParsedRule

private void putParsedRule(RuleCacheKey key,
                           AttributeValues parsedRule)
Put the parsed rule in the cache.


getCache

private static CacheManager getCache()
Return the CacheManager that is used by this service.

If the cache doesn't exist, createCache is called to create the cache.


createCache

private static void createCache()
Create the CacheManager that this service uses to cache parsed rules.

A new cache is created only if one has not already been created. If a new cache is created, it is added to the RuleService to be managed.

This method is synchronized to prevent multiple caches from being created and added to the rule service.