JSR94 integration into managed/nonmanaged environments
------------------------------------------------------
Key: DROOLS-444
URL: http://jira.codehaus.org/browse/DROOLS-444
Project: drools
Type: Bug
Components: jsr94
Reporter: Sascha Coenen
Priority: Trivial
I packaged Drools into a JCA1.5 compliant connector module cause that's a nice
way to bundle the libs into one deployable unit and also to do the rest of the
setup in there, like binding the RuleServiceProvider implementation into JNDI.
Doing this, I noticed that the current RuleServiceProviderImpl class doesn't
implement the Serializable or Referenceable interface and therefore cannot be
bound into a JNDI context. After having it implement Serializable everything
worked fine.
As a sidenote:
I noticed that there are links on the drools website which are supposed to lead
to JSR-94 examples (for instance Miss Manners) but instead they only contain
rule files and no JSR-94 java codes samples. As your JSR-94 implementation
passes the TCK and works pretty flawlessly, it kind of deserves more
publicity... ;) It's a bit of a pitty that the website only features the native
API.
As a very tiny sidenote:
In your sources there is a sample code snippet featuring the bootstrap
procedure for setting up Drools in JSR-94 "mode" in a non-managed environment:
RuleServiceProvider ruleServiceProvider = ruleServiceProvider = new
RuleServiceProviderImpl();
Instead of instantiating the RuleServiceProviderImpl class directly which
creates a compile-time dependency on the drools implementation, the bootstrap
should be performed like this:
// bootstrap
RuleServiceProviderManager.registerRuleServiceProvider("http://drools.org",
Class.forName("org.drools.jsr94.rules.RuleServiceProviderImpl"));
// lookup
RuleServiceProvider p =
RuleServiceProviderManager.getRuleServiceProvider("http://drools.org")
I know this is very unimportant stuff... but I felt like reporting it
nonetheless because for users wishing to employ the JSR94 wrapper of drools but
not being proficient with the spec, it might be helpful to grasp that the
JSR-94 API fully alleviates compile-time dependencies on rule-engine-specific
classes.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira