Package org.apache.uima.adapter.vinci
Class VinciAnalysisEngineService_impl
java.lang.Object
org.apache.vinci.transport.VinciServableAdapter
org.apache.uima.adapter.vinci.VinciAnalysisEngineService_impl
- All Implemented Interfaces:
TransportableFactory
,VinciServable
Main class for a Vinci Analysis Engine service. This class can also be used to deploy CAS
Consumers as Vinci services.
The main method takes one argument - the path to the service deployment descriptor.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Class that handles service shutdowns (including Ctrl-C) -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate VinciServer
private boolean
private Descriptor
private AnalysisEngine
private CasPool
private int
-
Constructor Summary
ConstructorsConstructorDescriptionVinciAnalysisEngineService_impl
(String serviceConfigPath) Instantiate Analysis Engine service from a given descriptor.VinciAnalysisEngineService_impl
(String serviceConfigPath, boolean debug) Instantiate Analysis Engine service from a given descriptor - possibly in debug mode.VinciAnalysisEngineService_impl
(String serviceConfigPath, boolean debug, String instanceId) Instantiate Analysis Engine from a given descriptor, debug mode, and instance Id -
Method Summary
Modifier and TypeMethodDescriptionprivate Transportable
Analyzes a given document by a AnalysisEngine.eval
(Transportable doc) Main method called by the Vinci Service Layer.private Frame
Extracts AE metadatastatic void
Creates a new (empty) document of the desired type.private static void
Redirects all logger output for this JVM to the given output stream.protected void
start()
Starts this service and associates a ShutdownHook to handle gracefull shutdown.void
stop()
Terminate this serviceMethods inherited from class org.apache.vinci.transport.VinciServableAdapter
cleanExit
-
Field Details
-
_server
-
mAE
-
mCasPool
-
descriptor
-
debug
private boolean debug -
serviceInstanceId
private int serviceInstanceId
-
-
Constructor Details
-
VinciAnalysisEngineService_impl
public VinciAnalysisEngineService_impl(String serviceConfigPath, boolean debug, String instanceId) throws Exception Instantiate Analysis Engine from a given descriptor, debug mode, and instance Id- Parameters:
serviceConfigPath
- descriptor locationdebug
-instanceId
-- Throws:
Exception
- passthru
-
VinciAnalysisEngineService_impl
Instantiate Analysis Engine service from a given descriptor - possibly in debug mode.- Parameters:
serviceConfigPath
- descriptor locationdebug
-- Throws:
Exception
-
VinciAnalysisEngineService_impl
Instantiate Analysis Engine service from a given descriptor.- Parameters:
serviceConfigPath
- descriptor location- Throws:
Exception
-
-
Method Details
-
getMetaData
Extracts AE metadata- Returns:
- Frame containing extracted meta data
- Throws:
when
- there is a failure processingException
-
getDescriptor
-
analyze
Analyzes a given document by a AnalysisEngine. When completed this method returns a VinciFrame containing XCAS translated into a set of Vinci subFrames. Each subframe containing one annotation with all its attributes.- Parameters:
aRequestFrame
- request frame- Returns:
- VinciFrame containing XCAS translated into a set of Vinci subframes.
- Throws:
Exception
- if there is an error during processing
-
eval
Main method called by the Vinci Service Layer. All requests coming in from clients go through this method. Each request comes in as a VinciFrame and is expected to contain a valid VINCI:COMMAND. Currently, two such operations are supported: 1) Annotate - triggers document analysis 2) GetData - triggers return of the AE meta data ( descriptor)- Specified by:
eval
in interfaceVinciServable
- Specified by:
eval
in classVinciServableAdapter
- Parameters:
doc
-Transportable
- a VinciFrame containing client request- Returns:
Transportable
- a VinciFrame containg result of performing the service- Throws:
ServiceException
- thrown when there is an application level error that should result in the client receiving the same ServiceException on the other end.
-
start
protected void start()Starts this service and associates a ShutdownHook to handle gracefull shutdown. -
stop
public void stop()Terminate this service -
main
-
redirectLoggerOutput
Redirects all logger output for this JVM to the given output stream. -
makeTransportable
Description copied from interface:TransportableFactory
Creates a new (empty) document of the desired type.- Specified by:
makeTransportable
in interfaceTransportableFactory
- Overrides:
makeTransportable
in classVinciServableAdapter
- Returns:
- The new document.
- See Also:
-