|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.uima.resource.impl.CasManager_impl
public class CasManager_impl
Simple CAS Manager Implementation used in the AnalysisEngine framework. Maintains a pool of 1 CAS for each requestor.
| Constructor Summary | |
|---|---|
CasManager_impl(ResourceManager aResourceManager)
|
|
| Method Summary | |
|---|---|
void |
addMetaData(ProcessingResourceMetaData aMetaData)
Called by components when they initialize. |
CAS |
createNewCas(java.util.Properties aPerformanceTuningSettings)
Create a new CAS using the CasDefinition stored in this CAS Manager. |
void |
defineCasPool(java.lang.String aRequestorContextName,
int aMinimumSize,
java.util.Properties aPerformanceTuningSettings)
Defines a CAS pool within this CAS Manager. |
void |
defineCasPool(UimaContextAdmin aRequestorContext,
int aMinimumSize,
java.util.Properties aPerformanceTuningSettings)
Defines the CAS pool required by a particular AnalysisEngine. |
protected void |
finalize()
|
CAS |
getCas(java.lang.String aRequestorContextName)
Gets an empty CAS. |
CasDefinition |
getCasDefinition()
Gets the CasDefinition, as defined by merging all of the metadata supplied by calls CasManager.addMetaData(ProcessingResourceMetaData). |
AbstractCas |
getCasInterface(CAS cas,
java.lang.Class<? extends AbstractCas> requiredInterface)
Gets a specified interface to a CAS. |
protected int |
getCasPoolSize(java.lang.String aRequestorContextName,
int aMinimumSize)
Determines the size to use for a particular CAS Pool. |
protected java.util.Map<CAS,CasPool> |
getCasToCasPoolMap()
|
protected void |
populateCasToCasPoolAndUimaContextMaps(CasPool aCasPool,
UimaContext aUimaContext)
|
protected void |
populateCasToCasPoolMap(CasPool aCasPool)
|
protected void |
registerCasPoolMBean(java.lang.String aRequestorContextName,
CasPool pool)
Registers an MBean for the given CasPool. |
void |
releaseCas(AbstractCas aCAS)
Releases a CAS back to its owner. |
void |
setJmxInfo(java.lang.Object aMBeanServer,
java.lang.String aRootMBeanName)
Configures this CAS Manager so it can register an MBean for each of its CAS pools. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CasManager_impl(ResourceManager aResourceManager)
| Method Detail |
|---|
public void addMetaData(ProcessingResourceMetaData aMetaData)
CasManager
addMetaData in interface CasManageraMetaData - an object containing metadata for the component, including Type System, Type
Priorities, and Index Definitions needed to create the CAS.
public CasDefinition getCasDefinition()
throws ResourceInitializationException
CasManagerCasManager.addMetaData(ProcessingResourceMetaData).
getCasDefinition in interface CasManagerResourceInitializationException - if metadata could not be mergedpublic CAS getCas(java.lang.String aRequestorContextName)
CasManagerCasManager.defineCasPool(String, int, Properties) and established a CAS Pool of size > 0. The CAS
Manager maintains a separate pool for each AnalysisEngine. This method may block if the CAS
pool does not contain any free instances.
getCas in interface CasManageraRequestorContextName - the context name of the AE requesting the CAS
(AnalysisEngine.getUimaContextAdmin().getQualifiedContextName()).
public void releaseCas(AbstractCas aCAS)
CasOwneraCAS
- Specified by:
releaseCas in interface CasOwner
- Parameters:
aCAS - the CAS to release
public void defineCasPool(java.lang.String aRequestorContextName,
int aMinimumSize,
java.util.Properties aPerformanceTuningSettings)
throws ResourceInitializationException
CasManagerCasManager.defineCasPool(UimaContextAdmin, int, Properties)
should be used instead.
defineCasPool in interface CasManageraRequestorContextName - name to give to the pool. Must be unique among all pool names in this
CAS manager, and care should be taken to assure that this does not match the
qualified name of UIMA Contexts passed to CasManager.defineCasPool(UimaContextAdmin, int, Properties).
This name is later passed to the CasManager.getCas(String) method, to check out
CASes from the pool.aMinimumSize - the minimum CAS pool size requiredaPerformanceTuningSettings - settings, including initial CAS heap size, for the AE
ResourceInitializationException - if a CAS could not be created.
public void defineCasPool(UimaContextAdmin aRequestorContext,
int aMinimumSize,
java.util.Properties aPerformanceTuningSettings)
throws ResourceInitializationException
CasManager
defineCasPool in interface CasManageraRequestorContext - the UimaContext of the AE that will request the CASes
(AnalysisEngine.getUimaContextAdmin()).aMinimumSize - the minimum CAS pool size requiredaPerformanceTuningSettings - settings, including initial CAS heap size, for the AE
ResourceInitializationException - if a CAS could not be created.
public CAS createNewCas(java.util.Properties aPerformanceTuningSettings)
throws ResourceInitializationException
CasManager
createNewCas in interface CasManageraPerformanceTuningSettings - settings, including initial CAS heap size, for the AE
ResourceInitializationException - if the CAS could not be created
public AbstractCas getCasInterface(CAS cas,
java.lang.Class<? extends AbstractCas> requiredInterface)
getCasInterface in interface CasManagercas - The CASrequiredInterface - interface to get. Currently must be one of CAS or JCas.
public void setJmxInfo(java.lang.Object aMBeanServer,
java.lang.String aRootMBeanName)
CasManager
setJmxInfo in interface CasManageraMBeanServer - the JMX MBean Server to register MBeans with. If null, the
platform MBeanServer (Java 1.5+ only) will be used.aRootMBeanName - unique MBean name for the root component that owns
this CAS Manager. The names of the CAS Pool MBeans will be formed by appending
,casPoolContextName=[contextName] to the root component name, where
[contextName] is the requestorContextName for the CasPool.protected java.util.Map<CAS,CasPool> getCasToCasPoolMap()
protected void populateCasToCasPoolMap(CasPool aCasPool)
protected void populateCasToCasPoolAndUimaContextMaps(CasPool aCasPool,
UimaContext aUimaContext)
protected void registerCasPoolMBean(java.lang.String aRequestorContextName,
CasPool pool)
aRequestorContextName - context name that identifies this CasPoolpool - the CasPool
protected int getCasPoolSize(java.lang.String aRequestorContextName,
int aMinimumSize)
aRequestorContextName - the context name of the AE that will request the CASes
(AnalysisEngine.getUimaContextAdmin().getQualifiedContextName()).aMinimumSize - the minimum CAS pool size required
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||