[jboss-jira] [JBoss JIRA] (DROOLS-1444) KieSession to implement java.lang.AutoCloseable

Mario Fusco (JIRA) issues at jboss.org
Fri Feb 17 04:13:00 EST 2017


    [ https://issues.jboss.org/browse/DROOLS-1444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13365216#comment-13365216 ] 

Mario Fusco commented on DROOLS-1444:
-------------------------------------

Implementing AutoCloseable is only useful if you're planning to use the AutoCloseable resource in a try-with-resources block, but to be honest I don't think it will be common at all to use a KieSession in that way. Do you have a use case where you may need (or want) to do that? If so can you please paste the code snippet where you tried to do this, so I could have a better idea regarding the possible implications?

> 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
>
> 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)


More information about the jboss-jira mailing list