|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.drools.io.RuleBaseLoader
public final class RuleBaseLoader
Convenience methods for loading a RuleBase, as well as lower level calls
for building up a rule base from RuleSets.
Note that the loadXXX static helper methods work directly off DRL, building/compiling behind the scenes.
The addXXX methods generally work with pre compiled rules binaries (DDJ's as they are known).
The RuleBaseLoader provides convenience methods for loading
RuleBase s from streams. RuleBaseLoader is
thread-safe and as such may be used to build multiple RuleBase s
simultaneously by multiple threads.
RuleSet,
RuleBase,
RuleSetReader,
RuleBaseBuilder,
SerializableRuleBaseProxy| Constructor Summary | |
|---|---|
RuleBaseLoader()
Default constructor |
|
RuleBaseLoader(ConflictResolver resolver)
Default constructor |
|
| Method Summary | |
|---|---|
void |
addFromByteArray(byte[] bytes)
Creates a JarInputStream and defines each .class in custom classLoader The RuleSet is serialised out using the custom classLoader Loads a ruleset from the DDJ bytes. |
void |
addFromByteArray(byte[][] bytes)
This will add multiple rulesets. |
void |
addFromRuleSet(RuleSet ruleSet)
|
void |
addFromRuleSet(RuleSet[] ruleSets)
|
void |
addFromRuleSetLoader(RuleSetLoader ruleSetLoader)
Adds to the rulebase from a RuleSetLoader instance. |
void |
addFromRuleSetLoader(RuleSetLoader[] ruleSetLoaders)
Loads a RuleBase using several URLs, using the DefaultConflictResolver. |
void |
addFromUrl(java.net.URL url)
Loads a RuleBase from a URL using the given ConflictResolver The URL must be to a DDJ compiled resource, or a conf file pointing to the DDJ compiled rules. |
void |
addFromUrl(java.net.URL[] urls)
Loads a RuleBase from several URLS, merging them and using the specified ConflictResolver. |
RuleBase |
buildRuleBase()
This will return a rulebase based on the added rulesets. |
static RuleBase |
loadFromInputStream(java.io.InputStream in)
Loads a RuleBase from an InputStream using the default ConflictResolver This is a convenience method and calls public static RuleBase loadFromInputStream(InputStream in, ConflictResolver resolver) passing the DefaultConflictResolver |
static RuleBase |
loadFromInputStream(java.io.InputStream[] ins)
Loads a RuleBase from an InputStream using the default ConflictResolver This is a convenience method and calls public static RuleBase loadFromInputStream(InputStream[] ins, ConflictResolver resolver) passing the DefaultConflictResolver |
static RuleBase |
loadFromInputStream(java.io.InputStream[] ins,
ConflictResolver resolver)
Loads a RuleBase from an InputStream using the default ConflictResolver |
static RuleBase |
loadFromInputStream(java.io.InputStream in,
ConflictResolver resolver)
Loads a RuleBase from an InputStream using the default ConflictResolver |
static RuleBase |
loadFromReader(java.io.Reader in)
Loads a RuleBase from a Reader using the default ConflictResolver This is a convenience method and calls public static RuleBase loadFromReader(Reader in, ConflictResolver resolver) passing the DefaultConflictResolver |
static RuleBase |
loadFromReader(java.io.Reader[] ins)
Loads a RuleBase from a Reader using the default ConflictResolver This is a convenience method and calls public static RuleBase loadFromReader(Reader[] ins, ConflictResolver resolver) passing the DefaultConflictResolver |
static RuleBase |
loadFromReader(java.io.Reader[] ins,
ConflictResolver resolver)
Loads a RuleBase from a Reader using the given ConflictResolver |
static RuleBase |
loadFromReader(java.io.Reader in,
ConflictResolver resolver)
Loads a RuleBase from a Reader using the given ConflictResolver |
static RuleBase |
loadFromUrl(java.net.URL url)
Loads a RuleBase from a URL using the default ConflictResolver This is a convenience method and calls public static RuleBase loadFromUrl(URL url, ConflictResolver resolver) passing the DefaultConflictResolver |
static RuleBase |
loadFromUrl(java.net.URL[] urls)
Loads a RuleBase using several URLs, using the DefaultConflictResolver. |
static RuleBase |
loadFromUrl(java.net.URL[] urls,
ConflictResolver resolver)
Loads a RuleBase from several URLS, merging them and using the specified ConflictResolver |
static RuleBase |
loadFromUrl(java.net.URL url,
ConflictResolver resolver)
Loads a RuleBase from a URL using the given ConflictResolver |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RuleBaseLoader()
public RuleBaseLoader(ConflictResolver resolver)
| Method Detail |
|---|
public void addFromRuleSetLoader(RuleSetLoader[] ruleSetLoaders)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
urls -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public void addFromRuleSetLoader(RuleSetLoader ruleSetLoader)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public void addFromUrl(java.net.URL[] urls)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
urls - resolver -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public void addFromUrl(java.net.URL url)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
url - resolver -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public void addFromByteArray(byte[][] bytes)
throws IntegrationException,
java.io.IOException,
org.xml.sax.SAXException
bytes -
IntegrationException
java.io.IOException
org.xml.sax.SAXException
public void addFromByteArray(byte[] bytes)
throws java.io.IOException,
IntegrationException,
org.xml.sax.SAXException
bytes -
java.io.IOException
IntegrationException
org.xml.sax.SAXException
public void addFromRuleSet(RuleSet ruleSet)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public void addFromRuleSet(RuleSet[] ruleSets)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
org.xml.sax.SAXException
java.io.IOException
IntegrationExceptionpublic RuleBase buildRuleBase()
public static RuleBase loadFromUrl(java.net.URL url)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
url - A URL to the DRL to compile and load.
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public static RuleBase loadFromUrl(java.net.URL url,
ConflictResolver resolver)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
url - resolver -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public static RuleBase loadFromUrl(java.net.URL[] urls)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
urls -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public static RuleBase loadFromUrl(java.net.URL[] urls,
ConflictResolver resolver)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
urls - resolver -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public static RuleBase loadFromInputStream(java.io.InputStream in)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
in -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public static RuleBase loadFromInputStream(java.io.InputStream in,
ConflictResolver resolver)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
in - resolver -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public static RuleBase loadFromInputStream(java.io.InputStream[] ins)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
ins -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public static RuleBase loadFromInputStream(java.io.InputStream[] ins,
ConflictResolver resolver)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
ins - resolver -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public static RuleBase loadFromReader(java.io.Reader in)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
in -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public static RuleBase loadFromReader(java.io.Reader in,
ConflictResolver resolver)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
in - resolver -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public static RuleBase loadFromReader(java.io.Reader[] ins)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
ins -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
public static RuleBase loadFromReader(java.io.Reader[] ins,
ConflictResolver resolver)
throws org.xml.sax.SAXException,
java.io.IOException,
IntegrationException
ins - resolver -
org.xml.sax.SAXException
java.io.IOException
IntegrationException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||