On 5/3/07, Marshall Schor (JIRA) <[email protected]> wrote:
[ https://issues.apache.org/jira/browse/UIMA-386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493575 ]Marshall Schor commented on UIMA-386: ------------------------------------- The following user code parts are places where the a class loader switch in the generators may have to occur: 1) calling process(a(J)Cas...) - for a primitive 2) same for an aggregate (calling the computeFlow method to produce a Flow object 3) Calling newCasProduced on a Flow object 4) calling the Flow object's methods (all methods have access to a CAS) 5) StatusCallbackListener method entityProcessComplete
I thought of another: When a CAS Multiplier calls getEmptyCas(). Also, we need to be sure to switch the class loader back to the application's class loader when the processing is complete and the CAS is returned to the appliation.
All of these need checks for class loader changes. Other code that might be (somewhat) factored and common is: a) selecting the right "view" to pass b) selecting if a CAS or JCas is to be passed c) setting the CAS to disallow certain operations while user code is running
Yes, it would be nice to have all this stuff in one place. Right now I think it is separately in PrimitiveAnalysisEngine_impl, FlowControllerContainer, and FlowContainer.
Because many of these may not make use of a generator, we should perhaps consider a "lazy" initialization - don't do a switch until and unless a generator is called which would need the switch.
I agree. -Adam
