org.drools.semantics.java
Class JavaBlockConsequence

java.lang.Object
  extended by org.drools.semantics.java.JavaBlockConsequence
All Implemented Interfaces:
java.io.Serializable, SemanticComponent, SemanticConsequence, SemanticInvokeable, SemanticRule, Consequence, RuleComponent
Direct Known Subclasses:
GroovyBlockConsequence

public class JavaBlockConsequence
extends java.lang.Object
implements java.io.Serializable, Consequence, SemanticConsequence

Java block semantics Consequence.

See Also:
Serialized Form

Field Summary
protected  java.lang.String thrownException
           
 
Constructor Summary
JavaBlockConsequence(java.lang.String name, java.lang.String block, Rule rule)
          Construct.
 
Method Summary
 java.lang.String getName()
          Returns the name of the component
 SemanticRuleCompiler getSemanticRuleCompiler()
           
 java.lang.String getSemanticType()
           
 java.lang.String getText()
           
 java.lang.String getThrownException()
           
 Declaration[] getTupleMembers()
           
 void invoke(Tuple tuple)
          Execute the consequence for the supplied matching Tuple.
 boolean isExceptionThrown()
           
 void setInvoker(Invoker invoker)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

thrownException

protected final java.lang.String thrownException
See Also:
Constant Field Values
Constructor Detail

JavaBlockConsequence

public JavaBlockConsequence(java.lang.String name,
                            java.lang.String block,
                            Rule rule)
                     throws java.lang.Exception
Construct.

Parameters:
block - The statement block.
rule - The rule.
Throws:
java.lang.Exception
Method Detail

getSemanticType

public java.lang.String getSemanticType()
Specified by:
getSemanticType in interface SemanticComponent

isExceptionThrown

public boolean isExceptionThrown()
Specified by:
isExceptionThrown in interface SemanticInvokeable

getThrownException

public java.lang.String getThrownException()
Specified by:
getThrownException in interface SemanticInvokeable

getName

public java.lang.String getName()
Description copied from interface: SemanticComponent
Returns the name of the component

Specified by:
getName in interface SemanticComponent

getText

public java.lang.String getText()
Specified by:
getText in interface SemanticConsequence

getSemanticRuleCompiler

public SemanticRuleCompiler getSemanticRuleCompiler()
Specified by:
getSemanticRuleCompiler in interface SemanticRule

getTupleMembers

public Declaration[] getTupleMembers()

setInvoker

public void setInvoker(Invoker invoker)
Specified by:
setInvoker in interface SemanticInvokeable

invoke

public void invoke(Tuple tuple)
            throws ConsequenceException
Execute the consequence for the supplied matching Tuple.

Specified by:
invoke in interface Consequence
Parameters:
tuple - The matching tuple.
workingMemory - The working memory session.
Throws:
ConsequenceException - If an error occurs while attempting to invoke the consequence.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object