[rules-users] Hot Deployment
Nico Schlebusch
nicos at zieto.co.za
Mon Apr 7 17:29:23 EDT 2008
Hi Brian,
>> The goal here is to monitor the directory above for any changes to
the files or additional files that show up. Any help would be
appreciated.
If you want to monitor a local dir try using the "dir" property instead
of "url". In your case you would then have something like:
Properties prop = new Properties();
prop.setProperty("dir",
"c:/svn/code/sleuth/src/net/intellidata/sleuth/description/rules/");
prop.setProperty("poll", "300"); // poll every 300 seconds
for hot deployment.
I'm not sure if you would need these properties.
prop.setProperty("newInstance", "true");
prop.setProperty("localCacheDir", ".");
Have a look at Section 7.1.1. Deployment using the RuleAgent of the
online manual at
http://downloads.jboss.com/drools/docs/4.0.6.19326.GA/html/index.html
Regards,
Nico
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Brian Trezise
Sent: 07 April 2008 10:19 PM
To: paulb at firstpartners.net; 'Rules Users List'
Subject: RE: [rules-users] Hot Deployment
Ok... I put that in but I'm having trouble getting it to recognize the
uri I'm passing in... I'm passing in
"file:///c:/svn/code/sleuth/src/net/intellidata/sleuth/description/rules
/" and I'm getting the following exception:
RuleAgent(default) INFO (Mon Apr 07 13:14:40 MDT 2008): Configuring with
newInstance=true, secondsToRefresh=300
RuleAgent(default) INFO (Mon Apr 07 13:14:40 MDT 2008): Configuring
package provider : URLScanner monitoring URLs:
file:/c:/svn/code/sleuth/src/net/intellidata/sleuth/description/rules/
with local cache dir of .
java.lang.ClassCastException:
sun.net.www.protocol.file.FileURLConnection
at
org.drools.agent.HttpClientImpl.checkLastUpdated(HttpClientImpl.java:26)
at
org.drools.agent.URLScanner.hasChanged(URLScanner.java:141)
at
org.drools.agent.URLScanner.getChangeSet(URLScanner.java:108)
at
org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:88)
at
org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:330)
at
org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:298)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:284)
at org.drools.agent.RuleAgent.init(RuleAgent.java:208)
at
org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:176)
at
org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:148)
at
net.intellidata.sleuth.description.rules.DescriptionRuleLoader.loadRules
(DescriptionRuleLoader.java:48)
at
net.intellidata.sleuth.description.rules.DescriptionRuleLoaderTest.testD
escriptionRuleLoader(DescriptionRuleLoaderTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at
junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUn
it3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja
va:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:196)
The goal here is to monitor the directory above for any changes to the
files or additional files that show up. Any help would be appreciated.
___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
3173 s. uravan way
aurora, colorado 80013
T: 720.524.4864
brian.trezise at intellidata.net
From: Paul Browne [mailto:paulb at firstpartners.net]
Sent: Friday, April 04, 2008 3:56 PM
To: Brian.Trezise at intellidata.net; Rules Users List
Subject: Re: [rules-users] Hot Deployment
Brian,
I'm guessing that you mean the RuleAgent Class. The Javadoc on this
class gives more info.
Code sample (assuming that you have the BRMS setup as per the doc).
You'll need to change to whatever settings are appropriate for your
BRMS.
Properties prop = new Properties();
prop.setProperty("url",uri);
prop.setProperty("newInstance", "true");
prop.setProperty("localCacheDir", ".");
prop.setProperty("poll", "300"); // poll every 300 seconds
for hot deployment.
//Get a new RuleBase using these properties
RuleAgent agent = RuleAgent.newRuleAgent(prop);
RuleBase rb = agent.getRuleBase();
Then use the RuleBase as normal
Paul
Brian Trezise wrote:
In the What's New? Section of the Drools 4.0 documentation there is a
reference in 1.1.2 to a "Rules Engine Agent for hot deployment and BRMS
integration". This would be ideal for the application I am currently
developing. However, this is the only mention of this agent anywhere in
the documentation. Does anybody know anything about this, how to use
it, any documentation about it?
Thanks,
___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
3173 s. uravan way
aurora, colorado 80013
T: 720.524.4864
brian.trezise at intellidata.net
________________________________
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080407/207442a9/attachment.html
More information about the rules-users
mailing list