|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.uima.simpleserver.Service
public class Service
This is the main class of the project. It represents a wrapper over UIMA Framework. One Server instance is able to perform one task. The Server object must be created, configured (method configure(...)) and can be used by calling process(...) method.
Field Summary | |
---|---|
protected org.apache.uima.cas.CAS |
cas
|
protected boolean |
initialized
|
protected ResultExtractor |
resultExtractor
|
protected ServerSpec |
serviceSpec
|
Constructor Summary | |
---|---|
Service()
Default constructor. |
Method Summary | |
---|---|
protected void |
configure(java.io.File serviceSpecFile)
|
void |
configureAnalysisEngine(java.io.File descriptorFile,
java.io.File resultSpecXMLFile)
Configure service with a UIMA descriptor. |
void |
configurePear(java.io.File pearFile,
java.io.File pearInstallationDir,
java.io.File serviceSpecFile)
Configure service with a UIMA PEAR file. |
static org.apache.uima.util.Logger |
getLogger()
|
java.lang.String |
getServiceDescription()
Delivers the service description as an XML document. |
ServerSpec |
getServiceSpec()
|
java.lang.String |
getXMLResultXSD()
Gets an XSD for the output format of the service. |
protected void |
logInitializationError()
|
Result |
process(java.lang.String text)
|
Result |
process(java.lang.String text,
java.lang.String lang)
Calls the services analysis engine on the input text, filters and produces the result. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.uima.cas.CAS cas
protected ServerSpec serviceSpec
protected ResultExtractor resultExtractor
protected volatile boolean initialized
Constructor Detail |
---|
public Service()
Method Detail |
---|
public static org.apache.uima.util.Logger getLogger()
public void configureAnalysisEngine(java.io.File descriptorFile, java.io.File resultSpecXMLFile) throws SimpleServerException, java.io.IOException, org.apache.xmlbeans.XmlException
descriptorFile
- AE descriptor file.resultSpecXMLFile
- Service specification file.
org.apache.xmlbeans.XmlException
- If service spec is not valid XML.
java.io.IOException
- On I/O problems (file not found etc).
SimpleServerException
- Other initialization problems.public void configurePear(java.io.File pearFile, java.io.File pearInstallationDir, java.io.File serviceSpecFile) throws java.io.IOException, SimpleServerException, org.apache.xmlbeans.XmlException
pearFile
- The PEAR file.pearInstallationDir
- The installation directory for the PEAR.serviceSpecFile
- Service specification file.
org.apache.xmlbeans.XmlException
- If service spec is not valid XML.
java.io.IOException
- On I/O problems (file not found etc).
SimpleServerException
- Other initialization problems.protected void configure(java.io.File serviceSpecFile) throws java.io.IOException, SimpleServerException, org.apache.xmlbeans.XmlException
java.io.IOException
SimpleServerException
org.apache.xmlbeans.XmlException
protected final void logInitializationError()
public java.lang.String getXMLResultXSD()
public Result process(java.lang.String text, java.lang.String lang)
public Result process(java.lang.String text)
public ServerSpec getServiceSpec()
public java.lang.String getServiceDescription()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |