org.sintef.mofscript.runtime
Class RuleExecutor

java.lang.Object
  extended by org.sintef.mofscript.runtime.RuleExecutor
All Implemented Interfaces:
MofScriptExecuter

public class RuleExecutor
extends java.lang.Object
implements MofScriptExecuter

The RuleExecutor executes the rules

Author:
jol

Field Summary
protected  ExecutionEnvironment _env
           
protected static ExecutionManager _execMgr
           
protected  java.util.Hashtable _referenceCache
           
protected  TransformationRule _rule
           
protected  java.lang.Object rule_return_value
           
 
Constructor Summary
RuleExecutor(TransformationRule rule, ExecutionManager execMgr)
          Constructor
 
Method Summary
 java.lang.Object executeRule()
          pre condition: Rule is set and environment is set
protected  void finalize()
          Clears the refrence cache
 ExecutionEnvironment getExecutionEnvironment()
           
static ExecutionManager getExecutionManager()
          Gets the ExecutionManager
 java.util.Hashtable getReferenceCache()
          Gets the Hashtable of cached refrences
protected  java.lang.Object getReturnObject(java.lang.String rule_return)
           
 TransformationRule getRule()
           
 java.lang.Object getRuleReturnValue()
           
 void setExecutionEnvironment(ExecutionEnvironment env)
           
 void setRuleReturnValue(java.lang.Object value)
          Sets the rule_return_value
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rule

protected TransformationRule _rule

_env

protected ExecutionEnvironment _env

_execMgr

protected static ExecutionManager _execMgr

rule_return_value

protected java.lang.Object rule_return_value

_referenceCache

protected java.util.Hashtable _referenceCache
Constructor Detail

RuleExecutor

public RuleExecutor(TransformationRule rule,
                    ExecutionManager execMgr)
Constructor

Parameters:
rule -
execMgr -
Method Detail

getExecutionManager

public static ExecutionManager getExecutionManager()
Gets the ExecutionManager

Returns:

getReferenceCache

public java.util.Hashtable getReferenceCache()
Gets the Hashtable of cached refrences

Returns:

setExecutionEnvironment

public void setExecutionEnvironment(ExecutionEnvironment env)
Parameters:
env -

getExecutionEnvironment

public ExecutionEnvironment getExecutionEnvironment()
Returns:
the Environment

setRuleReturnValue

public void setRuleReturnValue(java.lang.Object value)
Sets the rule_return_value

Parameters:
value -

getRuleReturnValue

public java.lang.Object getRuleReturnValue()
Returns:
the rule_return_value

getRule

public TransformationRule getRule()
Returns:
the transformation rule

executeRule

public java.lang.Object executeRule()
                             throws MofScriptExecutionException
pre condition: Rule is set and environment is set

Throws:
MofScriptExecutionException

getReturnObject

protected java.lang.Object getReturnObject(java.lang.String rule_return)
Parameters:
rule_return -
Returns:
the correct type for the return object

finalize

protected void finalize()
                 throws java.lang.Throwable
Clears the refrence cache

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable