public class AnalysisEnginePool extends Object
Constructor and Description |
---|
AnalysisEnginePool(String aName,
int aNumInstances,
ResourceSpecifier aResourceSpecifier)
Creates a new AnalysisEnginePool.
|
AnalysisEnginePool(String aName,
int aNumInstances,
ResourceSpecifier aResourceSpecifier,
Map<String,Object> aResourceInitParams)
Creates a new AnalysisEnginePool.
|
Modifier and Type | Method and Description |
---|---|
void |
batchProcessComplete()
Calls batchProcessComplete on all AEs in pool.
|
void |
collectionProcessComplete()
Calls collectionProcessComplete on all AEs in pool.
|
void |
destroy()
Destroys all AnalysisEngines in this pool.
|
AnalysisEngine |
getAnalysisEngine()
Checks out an AnalysisEngine from the pool.
|
AnalysisEngine |
getAnalysisEngine(long aTimeout)
Checks out an AnalysisEngine from the pool.
|
AnalysisEngineMetaData |
getMetaData()
Gets metadata for AnalysisEngines in this pool.
|
protected Class<AnalysisEngine> |
getResourceClass()
Gets the class of Resource contained in this pool - by default this is
AnalysisEngine , but subclasses may override. |
int |
getSize()
Returns the size of this pool - the total number of AnalysisEngine instances it would contain
if no instances were checked out.
|
void |
reconfigure() |
void |
releaseAnalysisEngine(AnalysisEngine aAE)
Checks in an AnalysisEngine to the pool.
|
void |
setLogger(Logger aLogger)
Sets logger for all AnalysisEngines in pool.
|
void |
setResultSpecification(ResultSpecification aResultSpec) |
public AnalysisEnginePool(String aName, int aNumInstances, ResourceSpecifier aResourceSpecifier) throws ResourceInitializationException
aName
- the pool nameaNumInstances
- the number of Resource instances in the poolaResourceSpecifier
- specifier that describes how to create the Resource instances for the poolResourceInitializationException
- if the Resource instances could not be createdpublic AnalysisEnginePool(String aName, int aNumInstances, ResourceSpecifier aResourceSpecifier, Map<String,Object> aResourceInitParams) throws ResourceInitializationException
aName
- the pool nameaNumInstances
- the number of Resource instances in the poolaResourceSpecifier
- specifier that describes how to create the Resource instances for the poolaResourceInitParams
- additional parameters to be passed to
Resource.initialize(ResourceSpecifier,Map)
methods. May be null if there are
no parameters.ResourceInitializationException
- if the Resource instances could not be createdpublic AnalysisEngine getAnalysisEngine()
null
if none are
available (in which case the client may wait on this object in order to be notified
when an instance becomes available).public void releaseAnalysisEngine(AnalysisEngine aAE)
aAE
- the resource to releasepublic AnalysisEngine getAnalysisEngine(long aTimeout)
aTimeout
- the time to wait in milliseconds. A value of <=0 will wait forever.null
if none are
available (in which case the client may wait on this object in order to be notified
when an instance becomes available).public void destroy()
public AnalysisEngineMetaData getMetaData()
public void setResultSpecification(ResultSpecification aResultSpec)
public void reconfigure() throws ResourceConfigurationException
ResourceConfigurationException
- -ConfigurableResource.reconfigure()
public void batchProcessComplete() throws AnalysisEngineProcessException
AnalysisEngineProcessException
- -public void collectionProcessComplete() throws AnalysisEngineProcessException
AnalysisEngineProcessException
- -public int getSize()
public void setLogger(Logger aLogger)
aLogger
- -protected Class<AnalysisEngine> getResourceClass()
AnalysisEngine
, but subclasses may override.Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.