public class Util extends Object
| Constructor and Description | 
|---|
| Util() | 
| Modifier and Type | Method and Description | 
|---|---|
| static CASImpl | getStartingView(CAS cas,
               boolean sofaAware,
               ComponentInfo componentInfo) | 
| static void | preserveContextHolder(Runnable userCode)Calls userCode and then restores the context holder | 
| static <T extends AbstractCas> | setupViewSwitchClassLoaders(CAS cas,
                           boolean sofaAware,
                           ComponentInfo componentInfo,
                           ResourceManager resourceManager,
                           Class<T> casInterface) | 
| static AbstractCas | setupViewSwitchClassLoadersLockCas(CAS cas,
                                  boolean sofaAware,
                                  ComponentInfo componentInfo,
                                  ResourceManager resourceManager,
                                  Class<? extends AbstractCas> casInterface) | 
| static void | withContextHolder(UimaContext context,
                 Runnable userCode)Calls userCode with specified context, then restores the context holder | 
| static void | withContextHolderX(UimaContext context,
                  org.apache.uima.internal.util.function.Runnable_withException userCode)Calls userCode with specified context, then restores the context holder | 
public static CASImpl getStartingView(CAS cas, boolean sofaAware, ComponentInfo componentInfo)
public static AbstractCas setupViewSwitchClassLoadersLockCas(CAS cas, boolean sofaAware, ComponentInfo componentInfo, ResourceManager resourceManager, Class<? extends AbstractCas> casInterface)
public static <T extends AbstractCas> T setupViewSwitchClassLoaders(CAS cas, boolean sofaAware, ComponentInfo componentInfo, ResourceManager resourceManager, Class<T> casInterface)
public static void preserveContextHolder(Runnable userCode)
userCode - run this code within the current contextpublic static void withContextHolder(UimaContext context, Runnable userCode)
context - to use while running the userCodeuserCode - the code to run.public static void withContextHolderX(UimaContext context, org.apache.uima.internal.util.function.Runnable_withException userCode) throws Exception
context - to use while running the userCodeuserCode - the code to run.Exception - -Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.