[rules-users] Drools and Java EE

Andrew Waterman awaterma at ecosur.mx
Thu Aug 26 16:04:03 EDT 2010


Hey Laird,

How do I configure the resource adaptor to load a specific resource?   I have two changesets I would like it to monitor.  Is this handled in the ra.xml?  I couldn't seem to find what it was monitoring. :)

best wishes,

Andrew

On Aug 25, 2010, at 4:24 PM, Andrew Waterman wrote:

> Huge thanks!
> 
> best,
> 
> A
> 
> On Aug 25, 2010, at 12:55 PM, ljnelson wrote:
> 
>> Have a look at http://code.google.com/p/drools-jca/.
>> 
>> This is not (clearly) released yet; have a look at the source and see what you think.
>> 
>> To build it: check it out, then, with Maven 2.2.1, run mvn clean install from the root.
>> 
>> If you have all the right repositories set up in your settings.xml, everything should complete normally.  If you don't, Maven will tell you what artifacts are missing, and a quick Google search will unveil the repositories they're hosted in.
>> 
>> Best,
>> Laird
>> 
>> On Wed, Aug 25, 2010 at 1:39 PM, Andrew Waterman-2 [via Drools - Java Rules Engine] <[hidden email]> wrote:
>> Very useful to the JEE community Laird.  I just recently started working with the KnowledgeAgent and Drools Guvnor; so I really feel the need.  Please do let us all know when your implementation is available in the trunk and/or a standalone version. :) 
>> 
>> best wishes, 
>> 
>> Andrew 
>> 
>> 
>> On Aug 24, 2010, at 9:50 PM, ljnelson wrote: 
>> 
>> > 
>> > Hello; I've made a JCA resource adapter for Drools. 
>> > 
>> > I've had to hack quite a bit to get it so that the KnowledgeAgent- and 
>> > resource-scanning-related parts don't use Threads, but, instead, use the 
>> > JCA-supplied WorkManager and BootstrapContext#createTimer() for asynchronous 
>> > operations (like resource scanning and notifying).   
>> > 
>> > Here are some changes it would sure be nice to see, that I needed to hack 
>> > around in order to make it so that a KnowledgeAgent-produced KnowledgeBase 
>> > could be shared by Java EE components in a specification compliant manner: 
>> > 
>> > 1. ResourceChangeNotifierImpl#ProcessChangetSet is an inner class that is 
>> > marked as public static, but which has a package-protected constructor.  I 
>> > have to create a new instance of this in order to create a 
>> > ResourceChangeNotifierImpl subclass that doesn't use threads.  I hope this 
>> > constructor could be made public instead.  Right now I'm calling 
>> > setAccessible(true).  Yecch. 
>> > 
>> > 2. ResourceFactory#setFactoryService(): sure do wish this were public, or 
>> > that there were another way to install a ResourceFactoryService.  I need to 
>> > do this so that the scanner and notifier are under my control (and don't use 
>> > Threads, but instead use Timers as provided by the JCA BootstrapContext 
>> > class).  It appears that I do have some control here in Drools 5.1 with the 
>> > (undocumented) ServiceRegistry interface (how do I get an instance of it? 
>> > what does it do? is it used pervasively?), but I don't know, since it's 
>> > undocumented, whether it's the preferred way to do this sort of thing or 
>> > not. 
>> > 
>> > 3. All this indirection is really quite clunky, especially given the 
>> > META-INF/services facility.  Was there a good reason this was not used?  I'm 
>> > sure there was something, because having to consult a factory for a service 
>> > to get a provider to produce an instance of something is a bit much. 
>> > 
>> > Hacking around those limitations, I was able to produce a Drools resource 
>> > adapter that vends KnowledgeBase instances as its user connection factories. 
>> > This means to use it in a spec-compliant manner, you do this in your 
>> > stateless (or stateful) session bean: 
>> > 
>> > @Resource 
>> > private KnowledgeBase kb; 
>> > 
>> > ...and you get injected a wrapper KnowledgeBase that uses the Java EE 
>> > container's JCA machinery to invoke operations on the shared KnowledgeBase. 
>> > 
>> > Is this something that would be interesting to other people?  If so I am 
>> > happy to open source it. 
>> > 
>> > Thanks for a great toolkit. 
>> > 
>> > Best,
>> > Laird 
>> > -- 
>> > View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-and-Java-EE-tp1323225p1323225.html
>> 
>> > Sent from the Drools - User mailing list archive at Nabble.com. 
>> > _______________________________________________ 
>> > rules-users mailing list 
>> > [hidden email] 
>> > https://lists.jboss.org/mailman/listinfo/rules-users
>> 
>> 
>> _______________________________________________ 
>> rules-users mailing list 
>> [hidden email] 
>> https://lists.jboss.org/mailman/listinfo/rules-users
>> 
>> 
>> View message @ http://drools-java-rules-engine.46999.n3.nabble.com/Drools-and-Java-EE-tp1323225p1336588.html 
>> To unsubscribe from Drools and Java EE, click here.
>> 
>> 
>> 
>> View this message in context: Re: Drools and Java EE
>> Sent from the Drools - User mailing list archive at Nabble.com.
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> _______________________________________________
> 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/20100826/e5d0ca63/attachment.html 


More information about the rules-users mailing list