[
https://issues.jboss.org/browse/DROOLS-1444?page=com.atlassian.jira.plugi...
]
Mario Fusco commented on DROOLS-1444:
-------------------------------------
In that example you're showing how to use try-with-resource with the StringWriter.
That makes perfectly sense to me but it is not what I was asking. I was asking for a
practical example using the KieSession because in my opinion in that case it is not that
useful and using a try-with-resource is more verbose and cumbersome than simply adding a
dispose.
I cannot add this to drools 6.x because it has to stay Java 6 compatible, but I could do
this on master (drools 7) that is Java 8 based. However I really don't see the
usefulness in doing so. Moreover your scenario seems to fit far better a
StatelessKieSession which doesn't require any dispose. Did you give it a try?
KieSession to implement java.lang.AutoCloseable
-----------------------------------------------
Key: DROOLS-1444
URL:
https://issues.jboss.org/browse/DROOLS-1444
Project: Drools
Issue Type: Enhancement
Components: core engine
Affects Versions: 6.5.0.Final
Reporter: tech meshter
Assignee: Mario Fusco
Priority: Minor
Attachments: AutocloseableSample.java
Given the new Java 7 and 8 syntax features, it would be useful that KieSession (and maybe
some other APIs that involve "disposability") to implement
java.lang.AutoCloseable. The implementation can call directly the "dispose"
method (unless I miss something) and over time dispose might become deprecated.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)