policyMgmt
Class Policy

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--policyMgmt.Policy

public class Policy
extends java.lang.Thread

Base class for Policies. A Policy registers a set of Rules. The Policy's thread cares about Event processing, evaluation of Rule Conditions, and execution of Rule Actions where the Conditions evaluate to true.


Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Policy()
          Construct a Policy.
Policy(java.lang.String[] args)
          Construct a Policy.
 
Method Summary
 java.util.Enumeration getRules()
          Return an Enumeration of all the Rules in this Policy.
 void newEvent(Event event)
          Notify this Policy that an Event was raised.
 void process(Event evt)
          Evaluate all rules of this Policy upon a given Event.
 void registerDriver(Driver drv)
          Register a Driver for this Policy.
 void registerRule(java.lang.Object trigger, Rule rule)
          Register a Rule and associate it to an Event, upon which the evaluation of this Rule is enforced.
 void run()
          Main loop of the policy.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Policy

public Policy()
Construct a Policy. (to be overwritten by specific Policies)

Policy

public Policy(java.lang.String[] args)
Construct a Policy. (to be overwritten by specific Policies)
Parameters:
args - command line arguments (ignored)
Method Detail

getRules

public java.util.Enumeration getRules()
Return an Enumeration of all the Rules in this Policy.
Returns:
Enumeration of all Rules

registerRule

public void registerRule(java.lang.Object trigger,
                         Rule rule)
Register a Rule and associate it to an Event, upon which the evaluation of this Rule is enforced.
Parameters:
trigger - Object that triggers the rule, usually an EventGenerator
rule - the Rule toi be registered

registerDriver

public void registerDriver(Driver drv)
Register a Driver for this Policy.
Parameters:
drv - the Driver to be registered

process

public void process(Event evt)
Evaluate all rules of this Policy upon a given Event.
Parameters:
evt - the triggering Event

newEvent

public void newEvent(Event event)
Notify this Policy that an Event was raised. This method is typically called by an EventGenerator.

run

public void run()
Main loop of the policy.
Overrides:
run in class java.lang.Thread