aspoev.primitive
Class RuntimePrimitive

java.lang.Object
  extended byaspoev.primitive.StaticPrimitive
      extended byaspoev.primitive.RuntimePrimitive
All Implemented Interfaces:
aspoev.Executable, MemberElement, pJ.jasmine.PRI, java.io.Serializable
Direct Known Subclasses:
AroundPrimitive, ParameterizedBindingPrimitive

public class RuntimePrimitive
extends StaticPrimitive
implements pJ.jasmine.PRI, MemberElement

A Runtime Primitive is an action that is taken on an persistent instance when it is returned from the database. A runtime primitive defines 1.) whether it is applicable with respect to a given instance and 2.) what action to take on that instance. NOTE: The boolean 'active' is for use within the execution of the action statement only, ie, 'thisRule.isActive()'. In other words, RuntimePrimitive will still execute the action statement if active is false. Runtime primitives can be declared in the command line environment in the following manner: () { ... // Valid Vejal syntax } where is 'before' or 'after'. For 'around' advice, see AroundPrimitive. is a ',' delineated list of names of Bindings which the runtime primitive should operate on.

See Also:
AroundPrimitive, Binding, Serialized Form

Field Summary
protected  java.lang.String actionCode
           
protected  boolean active
           
static int AFTER
           
static int AROUND
           
static int BEFORE
           
protected  pJ.jasmine.ListOfObject bindings
           
protected  int bindType
           
protected  VariableReferenceElement thisPrimitive
           
 
Fields inherited from class aspoev.primitive.StaticPrimitive
action, effectedTypes, typeVariable
 
Fields inherited from interface pJ.jasmine.PRI
DELETECHANGE, MODIFYCHANGE, NOCHANGE
 
Constructor Summary
RuntimePrimitive()
           
RuntimePrimitive(aspoev.Executable action)
           
RuntimePrimitive(aspoev.Executable action, java.util.Collection bindingNames, int type)
           
RuntimePrimitive(aspoev.Executable action, int type)
           
RuntimePrimitive(java.lang.String statementString)
           
 
Method Summary
protected  void declareThisPrimitive()
           
 java.lang.Object execute()
          Executes this static primitive's execution block once for each associated type.
 aspoev.Executable getActionStatement()
           
 boolean isActive()
           
protected static void registerWithBinding(RuntimePrimitive primitive, java.lang.String bindingName)
           
 void registerWithBindings()
           
protected static void registerWithBindings(RuntimePrimitive rule, java.util.Collection bindingNames)
           
 void setActive()
           
 void setInactive()
           
 java.lang.String toString()
           
 
Methods inherited from class aspoev.primitive.StaticPrimitive
declarePrimitiveVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BEFORE

public static final int BEFORE
See Also:
Constant Field Values

AFTER

public static final int AFTER
See Also:
Constant Field Values

AROUND

public static final int AROUND
See Also:
Constant Field Values

active

protected transient boolean active

actionCode

protected java.lang.String actionCode

thisPrimitive

protected VariableReferenceElement thisPrimitive

bindType

protected int bindType

bindings

protected pJ.jasmine.ListOfObject bindings
Constructor Detail

RuntimePrimitive

public RuntimePrimitive(aspoev.Executable action,
                        int type)

RuntimePrimitive

public RuntimePrimitive(aspoev.Executable action,
                        java.util.Collection bindingNames,
                        int type)

RuntimePrimitive

public RuntimePrimitive(aspoev.Executable action)

RuntimePrimitive

public RuntimePrimitive(java.lang.String statementString)

RuntimePrimitive

public RuntimePrimitive()
Method Detail

registerWithBindings

public void registerWithBindings()

registerWithBindings

protected static void registerWithBindings(RuntimePrimitive rule,
                                           java.util.Collection bindingNames)

registerWithBinding

protected static void registerWithBinding(RuntimePrimitive primitive,
                                          java.lang.String bindingName)

setActive

public void setActive()

setInactive

public void setInactive()

declareThisPrimitive

protected void declareThisPrimitive()

execute

public java.lang.Object execute()
Description copied from class: StaticPrimitive
Executes this static primitive's execution block once for each associated type.

Specified by:
execute in interface aspoev.Executable
Overrides:
execute in class StaticPrimitive

getActionStatement

public aspoev.Executable getActionStatement()

isActive

public boolean isActive()

toString

public java.lang.String toString()