[rules-users] Drools and Java EE

ljnelson ljnelson at gmail.com
Wed Aug 25 13:55:13 EDT 2010


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] <ml-node+1336588-44342161-10124 at n3.nabble.com<ml-node%2B1336588-44342161-10124 at n3.nabble.com>
> 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<http://drools-java-rules-engine.46999.n3.nabble.com/Drools-and-Java-EE-tp1323225p1323225.html?by-user=t>
>
> > Sent from the Drools - User mailing list archive at Nabble.com.
> > _______________________________________________
> > rules-users mailing list
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=1336588&i=0>
> > https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> _______________________________________________
> rules-users mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=1336588&i=1>
> 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<http://drools-java-rules-engine.46999.n3.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=1323225&code=bGpuZWxzb25AZ21haWwuY29tfDEzMjMyMjV8ODk5ODM2NTky>.
>
>
>

-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-and-Java-EE-tp1323225p1336777.html
Sent from the Drools - User mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100825/6c997cd7/attachment.html 


More information about the rules-users mailing list