org.apache.uima.analysis_engine.service.impl
Class AnalysisEngineService_impl

java.lang.Object
  extended by org.apache.uima.resource.service.impl.ResourceService_impl
      extended by org.apache.uima.analysis_engine.service.impl.AnalysisEngineService_impl

public class AnalysisEngineService_impl
extends ResourceService_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
AnalysisEngineService_impl()
           
 
Method Summary
 AnalysisEngine getAnalysisEngine()
          Gets the AnalysisEngine that delivers the functionality for this service.
protected  CAS getCasFromPool(int aTimeout)
          Gets a CAS from the CAS Pool.
protected  CasPool getCasPool()
          Gets the CAS pool used by this service.
protected  java.lang.Class<? extends Resource> getResourceClass()
          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, java.util.Map<java.lang.String,java.lang.Object> aResourceInitParams)
          Initialize this service.
 ServiceDataCargo process(ServiceDataCargo aData, ResultSpecification aResultSpec)
          Processes an entity.
 
Methods inherited from class org.apache.uima.resource.service.impl.ResourceService_impl
getMetaData, getResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnalysisEngineService_impl

public AnalysisEngineService_impl()
Method Detail

initialize

public void initialize(ResourceSpecifier aResourceSpecifier,
                       java.util.Map<java.lang.String,java.lang.Object> aResourceInitParams)
                throws ResourceInitializationException
Initialize this service. This is where the CAS pool is created.

Overrides:
initialize in class ResourceService_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:
org.apache.uima.resource.service.impl.ResourceService_impl#initialize(org.apache.uima.resource.ResourceSpecifier, int, java.util.Map, int)

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.

Throws:
ResourceInitializationException

process

public ServiceDataCargo process(ServiceDataCargo aData,
                                ResultSpecification aResultSpec)
                         throws ResourceServiceException
Processes an entity.

Parameters:
aData - data to be processed
aResultSpec - specifies which results the Analysis Engine should produce
Returns:
the results of analysis
Throws:
ResourceServiceException

getAnalysisEngine

public AnalysisEngine getAnalysisEngine()
Gets the AnalysisEngine that delivers the functionality for this service.

Returns:
the AnalysisEngine

getResourceClass

protected java.lang.Class<? extends Resource> getResourceClass()
Description copied from class: ResourceService_impl
Gets the Class of resource that provides the functionality for this service. This information is used in the ResourceService_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 class ResourceService_impl
Returns:
the Resource Class for this service
See Also:
ResourceService_impl.getResourceClass()

getCasPool

protected CasPool getCasPool()
Gets the CAS pool used by this service.

Returns:
the CAS pool

getCasFromPool

protected CAS getCasFromPool(int aTimeout)
                      throws ResourceServiceException
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.


Copyright © 2011. All Rights Reserved.