You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Marshall Schor (JIRA)" <de...@uima.apache.org> on 2016/10/18 13:52:58 UTC

[jira] [Commented] (UIMA-2977) destroy method of shared resources never called

    [ https://issues.apache.org/jira/browse/UIMA-2977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15585507#comment-15585507 ] 

Marshall Schor commented on UIMA-2977:
--------------------------------------

The PEAR support version of this just forwards calls relating to external resources and cas pools to the parent.

I'm going to take Richard's suggestion and add a destroy() method to the ResourceManager and ResourceManager_impl and have it propagate this to the lists of External Resources it maintains, and also to the CAS Pool to do whatever cleanup might be possible there.  

A destroyed ResourceManager cannot be reused.  This will be enforced by throwing a new exception if any use is attempted after it is destroyed.

> destroy method of shared resources never called
> -----------------------------------------------
>
>                 Key: UIMA-2977
>                 URL: https://issues.apache.org/jira/browse/UIMA-2977
>             Project: UIMA
>          Issue Type: Bug
>          Components: Core Java Framework
>            Reporter: Richard Eckart de Castilho
>              Labels: Resources
>
> Apparently the ResourceManager and the resources created by the manager do not participate in the usual component life cycle. On other components, such as analysis engines or readers, the destroy() method is called when the component is disposed of. External resources never get notified when they are no longer needed. At least any resources derived from Resource (e.g. DataResource and ParametrizedDataResource) should be notified. The SharedResourceObject interface does not define any such life cycle callback.
> As a side-note: An alternative to the rather heavy-weight Resource interface of UIMA maybe be small life cycle interfaces such as the Spring InitializingBean and DisposableBean interfaces, or Java annotations marking initialization and destruction methods (e.g. @PostConstruct and @PreDestroy).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)