001 /**
002 * Property of Hammurapi Group
003 */
004 package com.hammurapi.reasoning.spi;
005
006 import com.hammurapi.reasoning.ReasoningException;
007
008 /**
009 * Stateful rules shall implement this interface.
010 * @author Pavel
011 */
012 public interface Rule {
013
014 /**
015 * Rule container invokes this method when session reset() method is invoked.
016 * Rule shall reset its internal state upon invocation of this method.
017 */
018 void reset() throws ReasoningException;
019
020 /**
021 * This method is invoked after rule is created and configured.
022 * @throws ReasoningException
023 */
024 void init() throws ReasoningException;
025
026 /**
027 * Releases resource held by the rule.
028 * @throws ReasoningException
029 */
030 void release() throws ReasoningException;
031
032 }