The mResourceManager and mConfigurationManager initialization were changed a few
releases ago as part of the work to make this area more thread safe, in support
of multi-threaded read-only access to a shared CAS.

These variables were made "final", and the comment for RootUimaContext_impl says
(I hope it's correct :-) ) that making these final causes a memory barrier to be
inserted for them which in turn makes other access to them "safe" from other
threads without further synchronization.

The method "initializeRoot" is in a package ending with the word "impl", which
says this is an internal implementation method, not part of the exposed API.
It's public because it is defined in the UimaContextAdmin "interface" and all
interface-style methods need to be public.

I think this is left-over stuff from that earlier change in the way these two
things were initialized.  I think the method and the interface should probably
be updated to remove these two arguments.  (But that's low priority...)

-Marshall

On 3/24/2015 6:13 PM, Richard Eckart de Castilho wrote:
> Hi all,
>
> I wonder... what is the point of having a method allowing to initialize
> a UimaContext with a resource manager if in fact the code is commented out?
>
> See RootUimaContext_impl
>
>   public void initializeRoot(Logger aLogger, ResourceManager aResourceManager,
>           ConfigurationManager aConfigurationManager) {
>     mLogger = aLogger;
> //    mResourceManager = aResourceManager;
> //    mConfigurationManager = aConfigurationManager;
>     mSession = new Session_impl();
>   }
>
> Cheers,
>
> -- Richard
>

Reply via email to