org.eclipse.mofscript.runtime
Class RuleExecutor

java.lang.Object
  extended by org.eclipse.mofscript.runtime.RuleExecutor
All Implemented Interfaces:
MofScriptExecuter
Direct Known Subclasses:
TraceabilityRuleExecutor

public class RuleExecutor
extends java.lang.Object
implements MofScriptExecuter

The RuleExecutor executes the rules

Author:
jol

Field Summary
protected  StatementBlock _aBlock
           
protected  ExecutionEnvironment _env
           
protected static ExecutionManager _execMgr
           
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
static java.lang.String getObjectId(java.lang.Object obj)
           
protected  java.lang.Class<?> getReturnObject(java.lang.String rule_return)
           
 TransformationRule getRule()
           
 java.lang.Object getRuleReturnValue()
           
 StatementBlock getStatementBlock()
           
 boolean isReturning()
           
 void notifyReturn(java.lang.Object returnValue)
           
 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

_aBlock

protected StatementBlock _aBlock
Constructor Detail

RuleExecutor

public RuleExecutor(TransformationRule rule,
                    ExecutionManager execMgr)
Constructor

Parameters:
rule -
execMgr -
Method Detail

getExecutionManager

public static ExecutionManager getExecutionManager()
Gets the ExecutionManager

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

getObjectId

public static java.lang.String getObjectId(java.lang.Object obj)
Parameters:
obj -
Returns:

getReturnObject

protected java.lang.Class<?> 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

getStatementBlock

public StatementBlock getStatementBlock()

notifyReturn

public void notifyReturn(java.lang.Object returnValue)

isReturning

public boolean isReturning()