biz.hammurapi.rules
Class AbstractRule

java.lang.Object
  extended by biz.hammurapi.config.ComponentBase
      extended by biz.hammurapi.rules.AbstractRule
All Implemented Interfaces:
biz.hammurapi.config.Component, biz.hammurapi.config.Context, InvocationTarget, biz.hammurapi.metrics.MeasurementCollector, biz.hammurapi.metrics.MeasurementConsumer, Constants
Direct Known Subclasses:
Rule

public abstract class AbstractRule
extends biz.hammurapi.config.ComponentBase
implements InvocationTarget, Constants


Field Summary
 
Fields inherited from class biz.hammurapi.config.ComponentBase
owner
 
Fields inherited from interface biz.hammurapi.rules.Constants
COLLECTION_MANAGER, DESCRIPTION, HANDLE_MANAGER, KNOWLEDGE_COMPACTOR, NAME, NEGATOR_CLASS, OBJECT_FILTER, RETAIN_NEGATORS, RULES, URI_DIRECT, URI_PROPERTY, WORKER_REF
 
Constructor Summary
AbstractRule()
           
 
Method Summary
protected  java.util.Collection getCollection(java.lang.String collectionName, java.lang.Object lock)
          Convenience method to retrieve collection from the collection manager.
 java.lang.String getDescription()
           
 java.lang.String getName()
           
abstract  java.util.Collection getRemoveHandlers()
           
 void reset()
          Invoked in rule session reset() method.
 void setDescription(java.lang.String description)
           
 void setName(java.lang.String name)
          This method is invoked by rule container to set rule name.
 void start()
           
 void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class biz.hammurapi.config.ComponentBase
addMeasurement, get, getChild, getMeasurementConsumer, getOwner, getOwner, setMeasurementConsumer, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface biz.hammurapi.dispatch.InvocationTarget
getInvocationHandlers
 

Constructor Detail

AbstractRule

public AbstractRule()
Method Detail

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)
This method is invoked by rule container to set rule name. Rule name is used to retrieve collections from collection manager.

Parameters:
name -

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

toString

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

getRemoveHandlers

public abstract java.util.Collection getRemoveHandlers()

start

public void start()
           throws biz.hammurapi.config.ConfigurationException
Specified by:
start in interface biz.hammurapi.config.Component
Throws:
biz.hammurapi.config.ConfigurationException

stop

public void stop()
Specified by:
stop in interface biz.hammurapi.config.Component

getCollection

protected java.util.Collection getCollection(java.lang.String collectionName,
                                             java.lang.Object lock)
Convenience method to retrieve collection from the collection manager. Collections retrieved through this method are cleared in reset();

Parameters:
setName -
Returns:

reset

public void reset()
Invoked in rule session reset() method. Cleans acquired collections. Subclasses can put additional cleanup logic here.



Copyright © 2005 Hammurapi Group. All Rights Reserved.