public class Service extends LeoProperties
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
LOGGER
Logger for this class.
|
protected Map<String,Object> |
mAppCtx
Application execution map used primarily by the client.
|
protected org.apache.uima.aae.client.UimaAsynchronousEngine |
mUAEngine
UIMA Asynchronous Engine object used to deploy the server and later to
init and run the client side of the service also.
|
protected String |
uiamAsContainerId
When a service is deployed, UIMA assigns it a unique container id to be used for undeploying.
|
BROKERURL_DEFAULT, ENDPOINT_DEFAULT, LOG, mAggregateDescriptorFile, mBrokerURL, mCasPoolSize, mCCTimeout, mDeleteOnExit, mDeploymentDescriptorFile, mDescriptorDirectory, mEndpoint, mFSHeapSize, mInitTimeout, mJamJmxPort, mJamQueryIntervalInSeconds, mJamResetStatisticsAfterQuery, mJamServerBaseUrl, mPropertiesFile, mServiceName, mTimeout, PROPERTIES_DEFAULT
Constructor and Description |
---|
Service()
Default constructor loads the application execution variables from the properties file.
|
Service(Map<String,Object> propertiesMap)
Loads the application execution variables from the map.
|
Service(String propertiesFile)
Constructor which first sets a new properties file then calls the default constructor
to load the properties.
|
Modifier and Type | Method and Description |
---|---|
void |
deploy()
Initialize the mAppCtx and mUAEngine objects then deploy the service.
|
void |
deploy(org.apache.uima.analysis_engine.AnalysisEngineDescription aggregate)
Use the AnalysisEngineDescription as input for the deployment descriptor that is generated.
|
void |
deploy(ArrayList<String> primitives,
boolean byName)
Create a deployment descriptor and initialize the mAppCtx and mUAEngine objects then call
deploy to deploy the service.
|
void |
deploy(LeoAEDescriptor faed)
Initialize the Deployment Descriptor for the service using the provided
LeoAEDescriptor object as the Top Descriptor.
|
void |
deploy(LeoDeployDescriptor fdd)
Initialize the service using the provided LeoDeployDescriptor object as the basis of
the deployment information gov.va.vinci.leo.model.
|
void |
deploy(LeoTypeSystemDescription leoTypeSystemDescription,
int numInstances,
LeoAnnotator... annotators)
Initialize a pipeline by generating the aggregate descriptor file from the list of LeoAnnotator objects then
deploy it in the UIMA-AS framework.
|
void |
deploy(LeoTypeSystemDescription leoTypeSystemDescription,
LeoAnnotator... annotators)
Initialize a pipeline by generating the aggregate descriptor file from the list of LeoAnnotator objects then
deploy it in the UIMA-AS framework.
|
void |
deploy(List<LeoAEDescriptor> primitives)
Initialize a service pipeline by first generating an aggregate descriptor from a list of
LeoAEDescriptor objects.
|
void |
deploy(List<LeoAnnotator> annotators,
int numInstances,
LeoTypeSystemDescription leoTypeSystemDescription)
Initialize a pipeline by generating the aggregate descriptor file from the list of LeoAnnotator objects then
deploy it in the UIMA-AS framework.
|
String |
getAggregateDescriptorFile()
Get the aggregate descriptor file path.
|
protected void |
registerWithJam()
Call the appropriate JAM web services to register this service with jam.
|
void |
undeploy()
Undeploys a running service from the UIMA AS engine.
|
getBrokerURL, getCasPoolSize, getCCTimeout, getDeploymentDescriptorFile, getDescriptorDirectory, getEndpoint, getFSHeapSize, getInitTimeout, getInputQueueName, getJamJmxPort, getJamQueryIntervalInSeconds, getJamServerBaseUrl, getServiceName, getTimeout, isDeleteOnExit, isJamResetStatisticsAfterQuery, loadDefaults, loadProperties, loadprops, loadprops, setAggregateDescriptorFile, setBrokerURL, setCasPoolSize, setCCTimeout, setDeleteOnExit, setDeploymentDescriptorFile, setDescriptorDirectory, setEndpoint, setFSHeapSize, setInitTimeout, setInputQueueName, setJamJmxPort, setJamQueryIntervalInSeconds, setJamResetStatisticsAfterQuery, setJamServerBaseUrl, setServiceName, setTimeout
public static final org.apache.log4j.Logger LOGGER
protected Map<String,Object> mAppCtx
protected org.apache.uima.aae.client.UimaAsynchronousEngine mUAEngine
protected String uiamAsContainerId
public Service() throws Exception
Exception
- if properties file cannot be read or if data is invalidpublic Service(Map<String,Object> propertiesMap) throws FileNotFoundException
propertiesMap
- the map of properties to set. Map should have the property
name as the key, and value as the value. See LeoProperties for which
properties can be set.FileNotFoundException
- If deploymentDescriptor is specified, but not found or accessible.public Service(String propertiesFile) throws Exception
propertiesFile
- path to a properties file to be usedException
- if there is a problem loading the properties.public String getAggregateDescriptorFile()
getAggregateDescriptorFile
in class LeoProperties
public void deploy(ArrayList<String> primitives, boolean byName) throws Exception
primitives
- ArrayListbyName
- if true, it is assumed the list of primitives exists in the classpath. If false, full
paths to the primitives is required.Exception
- if any error occurs during deployment.public void deploy(List<LeoAEDescriptor> primitives) throws Exception
primitives
- a list of primitive components to deploy as a service.Exception
- if any error occurs during deployment.public void deploy(LeoTypeSystemDescription leoTypeSystemDescription, LeoAnnotator... annotators) throws Exception
leoTypeSystemDescription
- the type system to add to each delegate.annotators
- one or more annotators to deploy as a pipeline in the service.Exception
- if any error occurs during deployment.public void deploy(LeoTypeSystemDescription leoTypeSystemDescription, int numInstances, LeoAnnotator... annotators) throws Exception
leoTypeSystemDescription
- the type system to add to each delegate.numInstances
- number of pipeline instances to deploy.annotators
- one or more annotators to deploy as a pipeline in the service.Exception
- if any error occurs during deployment.public void deploy(List<LeoAnnotator> annotators, int numInstances, LeoTypeSystemDescription leoTypeSystemDescription) throws Exception
annotators
- list of annotators to deploy as a pipeline in the service.numInstances
- number of pipeline instances to deploy.leoTypeSystemDescription
- the type system to add to each delegate.Exception
- if any error occurs during deployment.public void deploy(org.apache.uima.analysis_engine.AnalysisEngineDescription aggregate) throws Exception
aggregate
- Aggregate AnalysisEngineDescriptor to be used in the UIMA AS serviceException
- if any error occurs during deployment.public void deploy(LeoAEDescriptor faed) throws Exception
faed
- the descriptor to be used for this service.Exception
- if any error occurs during deployment.public void deploy(LeoDeployDescriptor fdd) throws Exception
fdd
- the descriptor to be used for this service.Exception
- if any error occurs during deployment.public void deploy() throws Exception
Exception
- if any error occurs during deployment.public void undeploy() throws Exception
Exception
protected void registerWithJam()
Copyright © 2018 Department of Veterans Affairs. All Rights Reserved.