org.obligate.annotations.contract.proxy.groovy
Class GroovyRulesProxy

java.lang.Object
  extended by org.obligate.annotations.contract.proxy.groovy.GroovyRulesProxy
All Implemented Interfaces:
RulesProxy

public final class GroovyRulesProxy
extends java.lang.Object
implements RulesProxy

Provides a simple proxy to the rules engine being used. This only needs a single instance across all the proxies.

Since:
18-Jan-2006
Author:
Steve Jones

Constructor Summary
GroovyRulesProxy()
           
 
Method Summary
 java.util.List<ConditionResult> evaluateRules(java.lang.String ruleName, java.util.List inputData)
          Evaluate a named rule set
 boolean isRegistered(java.lang.String ruleName)
           
 boolean registerRules(java.lang.String ruleName, java.lang.String[] conditions, java.lang.String[] paramNames)
          Method that takes the rules and registers them against the rules engine the name parameter is the key to getting those things back so it needs to be unique (probably method signature)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyRulesProxy

public GroovyRulesProxy()
                 throws javax.rules.ConfigurationException,
                        java.rmi.RemoteException,
                        java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException
java.rmi.RemoteException
javax.rules.ConfigurationException
Method Detail

registerRules

public final boolean registerRules(java.lang.String ruleName,
                                   java.lang.String[] conditions,
                                   java.lang.String[] paramNames)
                            throws java.rmi.RemoteException,
                                   javax.rules.RuleException
Description copied from interface: RulesProxy
Method that takes the rules and registers them against the rules engine the name parameter is the key to getting those things back so it needs to be unique (probably method signature)

Specified by:
registerRules in interface RulesProxy
Parameters:
ruleName - the rules to execute
conditions - the rules to evaluate
paramNames - the parameter names to use in the rules, part of the binding
Returns:
whether the registration succeeded.
Throws:
java.rmi.RemoteException
javax.rules.admin.RuleExecutionSetCreateException
javax.rules.admin.RuleExecutionSetRegisterException
javax.rules.RuleException

isRegistered

public boolean isRegistered(java.lang.String ruleName)
Specified by:
isRegistered in interface RulesProxy
Returns:
whether the given rule set has already been registered

evaluateRules

public final java.util.List<ConditionResult> evaluateRules(java.lang.String ruleName,
                                                           java.util.List inputData)
                                                    throws javax.rules.RuleException,
                                                           java.rmi.RemoteException
Description copied from interface: RulesProxy
Evaluate a named rule set

Specified by:
evaluateRules in interface RulesProxy
Parameters:
ruleName - the rule set to execute
inputData - the data to perform the evaluation on
Returns:
whether all the rules passed
Throws:
javax.rules.RuleException
java.rmi.RemoteException