Class AnalysisEngineService_impl
java.lang.Object
org.apache.uima.resource.service.impl.ResourceService_impl
org.apache.uima.analysis_engine.service.impl.AnalysisEngineService_impl
Convenience base class for Analysis Engine Services. Analysis Engine services are not required to
extends this class, but it it useful for those services that communicate using binary data.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the AnalysisEngine that delivers the functionality for this service.protected CAS
getCasFromPool
(int aTimeout) Gets a CAS from the CAS Pool.protected CasPool
Gets the CAS pool used by this service.Gets the Class of resource that provides the functionality for this service.void
initialize
(ResourceSpecifier aResourceSpecifier, int aNumSimultaneousRequests, int aTimeout) An alternative form of initialize that takes the number of simultaneous requests and timeout period as explicit arguments.void
initialize
(ResourceSpecifier aResourceSpecifier, Map<String, Object> aResourceInitParams) Initialize this service.process
(ServiceDataCargo aData, ResultSpecification aResultSpec) Processes an entity.Methods inherited from class org.apache.uima.resource.service.impl.ResourceService_impl
getMetaData, getResource
-
Constructor Details
-
AnalysisEngineService_impl
public AnalysisEngineService_impl()
-
-
Method Details
-
initialize
public void initialize(ResourceSpecifier aResourceSpecifier, Map<String, Object> aResourceInitParams) throws ResourceInitializationExceptionInitialize this service. This is where the CAS pool is created.- Overrides:
initialize
in classResourceService_impl
- Parameters:
aResourceSpecifier
- specifier that describes how to create the resources that provide the functionality for this service.aResourceInitParams
- additional parameters to be passed on to the Resource Factory.- Throws:
ResourceInitializationException
- -- See Also:
-
initialize
public void initialize(ResourceSpecifier aResourceSpecifier, int aNumSimultaneousRequests, int aTimeout) throws ResourceInitializationException An alternative form of initialize that takes the number of simultaneous requests and timeout period as explicit arguments.- Parameters:
aResourceSpecifier
- -aNumSimultaneousRequests
- -aTimeout
- -- Throws:
ResourceInitializationException
- -
-
process
public ServiceDataCargo process(ServiceDataCargo aData, ResultSpecification aResultSpec) throws ResourceServiceException Processes an entity.- Parameters:
aData
- data to be processedaResultSpec
- specifies which results the Analysis Engine should produce- Returns:
- the results of analysis
- Throws:
ResourceServiceException
- -
-
getAnalysisEngine
Gets the AnalysisEngine that delivers the functionality for this service.- Returns:
- the AnalysisEngine
-
getResourceClass
Description copied from class:ResourceService_impl
Gets the Class of resource that provides the functionality for this service. This information is used in theResourceService_impl.initialize(ResourceSpecifier,Map)
method in order to create the Resource object. Subclasses may override this method to specify which resource class is to be created.- Overrides:
getResourceClass
in classResourceService_impl
- Returns:
- the Resource Class for this service
- See Also:
-
getCasPool
Gets the CAS pool used by this service.- Returns:
- the CAS pool
-
getCasFromPool
Gets a CAS from the CAS Pool. Throws an exception if the timeout period elapses.- Parameters:
aTimeout
- maximum time to wait in milliseconds- Returns:
- a CAS that has been checked-out of the pool
- Throws:
ResourceServiceException
- if a CAS is not available within the timeout period.
-