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

Marshall Schor commented on UIMA-5153:
--------------------------------------

The external resources that extend Resource_ImplBase were not calling 
super.initialize(...).  The super method was designed with the non-external 
resource initialization in mind, in that it creates a UIMA Context 
(corresponding to a aggregate hierarchy level).  I think the thought for 
external resources was that they don't really belong to a particular UIMA 
Context because they're shared.

Yet, a UIMA Context object is the way the external resource would get access to 
the Resource Manager. 

I changed the impl of the 3 classes that currently implement kinds of external 
resources:
* ConfigurableDataResource_impl
* DataResource_impl
* FileLanguageResource_impl
So that they now call super.initialize(...).  I changed the shared impl of 
initialize in Resource_implBase to skip the part where it sets up a new UIMA 
context.  And I changed the call in Resource_impleBase for the part where it's 
configuring the external resources to pass along both the resource manager and 
the UIMA Context (which has a ref to the resource manager) (probably only need 
the 2nd). 

So the external Resources should now have access to the UIMA Context in which 
they were defined (the first one, in case of multiple definitions).

> maybe change subclasses of Resource_impl to call super methods
> --------------------------------------------------------------
>
>                 Key: UIMA-5153
>                 URL: https://issues.apache.org/jira/browse/UIMA-5153
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Core Java Framework
>            Reporter: Marshall Schor
>            Priority: Minor
>
> Richard pointed out (3 years ago) that the subclass of Resource_impl, 
> ConfigurableDataResource_impl's initialize method doesn't call 
> super.initialize(), so its mUimaContextAdmin is never initialized, hence any 
> getResourceManager() call returns null.  
> Investigate this and other subclasses of Reousrce_impl to see if super 
> methods should be called.  
> Investigate if other methods also need a super call



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

Reply via email to