Class CasProcessorConfigurationJAXBImpl
- java.lang.Object
-
- org.apache.uima.collection.impl.cpm.container.CasProcessorConfigurationJAXBImpl
-
- All Implemented Interfaces:
CasProcessorConfiguration
public class CasProcessorConfigurationJAXBImpl extends java.lang.Object implements CasProcessorConfiguration
A wrapper containing Cas Processor configuration. An instance of this class is associated with each Cas Processor.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
actionOnMaxError
private java.lang.String
actionOnMaxRestarts
private int
batchSize
private java.util.List
deploymentParameters
private java.lang.String
deploymentType
private CpeComponentDescriptor
descriptor
private int
errorRate
private long
errorSampleSize
private java.lang.String
filterString
private boolean
isJavaProcess
private JavaApplication
javaApp
private int
maxErrorThreshold
private int
maxRestartThreshold
private int
maxRetryThreshold
private java.lang.String
name
private NonJavaApplication
nonJavaApp
private boolean
parallelizable
private boolean
readOnly
private ResourceManager
resourceManager
private boolean
runInSeparateProcess
private long
timeOut
private int
waitTimeBetweenRestarts
-
Constructor Summary
Constructors Constructor Description CasProcessorConfigurationJAXBImpl(CpeCasProcessor aCasProcessorConfig, ResourceManager aResourceManager)
Initializes instance and copies configuation from cpe descriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addBatchSize(CpeCasProcessor aCasProcessorConfig)
Copies batch size associated with this Cas Processorprivate void
addDeploymentParameters(CpeCasProcessor aCasProcessorConfig)
Copies deployment parameters associated with this Cas Processor These parameters are used to construct appropriate command line for launching the Cas Processor in external processprivate void
addDeploymentType(CpeCasProcessor aCasProcessorConfig)
Copies deployment type associated with this Cas Processorprivate void
addDescriptor(CpeCasProcessor aCasProcessorConfig)
Copies path of the Cas Processor descriptor.private void
addErrorHandling(CpeCasProcessor aCasProcessorConfig)
Copies Error handling settingsprivate void
addFiltering(CpeCasProcessor aCasProcessorConfig)
Copies filter expression used during processing.private void
addIsJavaProcess(CpeCasProcessor aCasProcessorConfig)
Determines if this Cas Processor should run in java jvm.private void
addRunInSeparateProcess(CpeCasProcessor aCasProcessorConfig)
Copies runtime informationjava.lang.String
getActionOnError()
Returns an action as String to identify an action to take in case of excessive Cas Processor errors.java.lang.String
getActionOnMaxRestart()
Returns an action as String to identify an action to take in case of excessive Cas Processor restarts.int
getBatchSize()
Returns configured batch size setup for this Cas Processorjava.lang.String
getDeploymentParameter(java.lang.String aDeployParameter)
Returns a value for a given deployment parameterjava.util.List
getDeploymentParameters()
Returns a list of deployment parameters ssociated with this Cas Processorjava.lang.String
getDeploymentType()
Returns deployment type associated with this Cas Processor integrated local remotejava.net.URL
getDescriptorUrl()
Returns descriptor associated with this Cas Processorint
getErrorRate()
long
getErrorSampleSize()
Execute
getExecSpec()
Returns executable section of the Cas Processor configuration.java.util.LinkedList
getFilter()
Returns parsed filter expressions as List.java.lang.String
getFilterString()
Returns unparsed filter expressionjava.lang.String[]
getKeysToDrop()
Returns an array of types that should not be sent to Cas Processor.int
getMaxErrorCount()
Returns max number of tolerated errorsint
getMaxRestartCount()
Returns max number of Cas Processor restartsint
getMaxRetryCount()
Returns max number of tries to process each bundle of Casint
getMaxTimeToWaitBetweenRetries()
Returns how long to wait between resending CAS after failurejava.lang.String
getName()
Returns Cas Processor namelong
getTimeout()
Returns the max amount of time the CPE will wait for Cas Processor reponse.boolean
isJavaProcess()
Returns true it the Cas Processor is written in java and will be run with java jvm.boolean
isParallelizable()
Returns if the Cas Processor is able to run in parallelboolean
readOnly()
Returns if the Cas Processor is read onlyboolean
runInSeparateProcess()
Returns true if this Cas Processor will run in its own processprivate boolean
validActionOnError(java.lang.String aActionOnError)
Varifies action String.
-
-
-
Field Detail
-
actionOnMaxError
private java.lang.String actionOnMaxError
-
actionOnMaxRestarts
private java.lang.String actionOnMaxRestarts
-
name
private java.lang.String name
-
descriptor
private CpeComponentDescriptor descriptor
-
deploymentType
private java.lang.String deploymentType
-
filterString
private java.lang.String filterString
-
errorSampleSize
private long errorSampleSize
-
timeOut
private long timeOut
-
errorRate
private int errorRate
-
maxErrorThreshold
private int maxErrorThreshold
-
maxRestartThreshold
private int maxRestartThreshold
-
maxRetryThreshold
private int maxRetryThreshold
-
batchSize
private int batchSize
-
runInSeparateProcess
private boolean runInSeparateProcess
-
isJavaProcess
private boolean isJavaProcess
-
nonJavaApp
private NonJavaApplication nonJavaApp
-
javaApp
private JavaApplication javaApp
-
deploymentParameters
private java.util.List deploymentParameters
-
waitTimeBetweenRestarts
private int waitTimeBetweenRestarts
-
parallelizable
private boolean parallelizable
-
readOnly
private boolean readOnly
-
resourceManager
private ResourceManager resourceManager
-
-
Constructor Detail
-
CasProcessorConfigurationJAXBImpl
public CasProcessorConfigurationJAXBImpl(CpeCasProcessor aCasProcessorConfig, ResourceManager aResourceManager) throws ResourceConfigurationException
Initializes instance and copies configuation from cpe descriptor.- Parameters:
aCasProcessorConfig
- - configuration object containing Cas Processor configurationaResourceManager
- - needed to resolve import by name- Throws:
ResourceConfigurationException
- if descriptor error
-
-
Method Detail
-
getMaxTimeToWaitBetweenRetries
public int getMaxTimeToWaitBetweenRetries()
Returns how long to wait between resending CAS after failure- Specified by:
getMaxTimeToWaitBetweenRetries
in interfaceCasProcessorConfiguration
-
isParallelizable
public boolean isParallelizable()
Returns if the Cas Processor is able to run in parallel- Returns:
- - true if the component can run in parallel, false otherwise
-
readOnly
public boolean readOnly()
Returns if the Cas Processor is read only- Returns:
- - true if read only, false otherwise
-
addRunInSeparateProcess
private void addRunInSeparateProcess(CpeCasProcessor aCasProcessorConfig)
Copies runtime information- Parameters:
aJaxbCasProcessorConfig
- - configuration object containing Cas Processor configuration
-
addIsJavaProcess
private void addIsJavaProcess(CpeCasProcessor aCasProcessorConfig)
Determines if this Cas Processor should run in java jvm.- Parameters:
aJaxbCasProcessorConfig
- - configuration object containing Cas Processor configuration
-
addErrorHandling
private void addErrorHandling(CpeCasProcessor aCasProcessorConfig) throws ResourceConfigurationException
Copies Error handling settings- Parameters:
aJaxbCasProcessorConfig
- - configuration object containing Cas Processor configuration- Throws:
ResourceConfigurationException
-
addDeploymentParameters
private void addDeploymentParameters(CpeCasProcessor aCasProcessorConfig) throws ResourceConfigurationException
Copies deployment parameters associated with this Cas Processor These parameters are used to construct appropriate command line for launching the Cas Processor in external process- Parameters:
aJaxbCasProcessorConfig
- - configuration object containing Cas Processor configuration- Throws:
ResourceConfigurationException
-
addDeploymentType
private void addDeploymentType(CpeCasProcessor aCasProcessorConfig) throws ResourceConfigurationException
Copies deployment type associated with this Cas Processor- Parameters:
aJaxbCasProcessorConfig
- - - configuration object containing Cas Processor configuration- Throws:
ResourceConfigurationException
- -
-
addFiltering
private void addFiltering(CpeCasProcessor aCasProcessorConfig) throws ResourceConfigurationException
Copies filter expression used during processing.- Parameters:
aJaxbCasProcessorConfig
- - configuration object containing Cas Processor configuration- Throws:
ResourceConfigurationException
-
addBatchSize
private void addBatchSize(CpeCasProcessor aCasProcessorConfig) throws ResourceConfigurationException
Copies batch size associated with this Cas Processor- Parameters:
aJaxbCasProcessorConfig
- - configuration object containing Cas Processor configuration- Throws:
ResourceConfigurationException
-
addDescriptor
private void addDescriptor(CpeCasProcessor aCasProcessorConfig) throws ResourceConfigurationException
Copies path of the Cas Processor descriptor.- Parameters:
aJaxbCasProcessorConfig
- - configuration object holding path to the descriptor- Throws:
ResourceConfigurationException
- -
-
validActionOnError
private boolean validActionOnError(java.lang.String aActionOnError)
Varifies action String. It must any of the three possible values:- continue
- terminate
- disable
- kill-pipeline
- Parameters:
aActionOnError
- - action string to verify- Returns:
- - true if action is valid, false otherwise
-
getActionOnError
public java.lang.String getActionOnError()
Returns an action as String to identify an action to take in case of excessive Cas Processor errors.- continue
- terminate
- disable
- Specified by:
getActionOnError
in interfaceCasProcessorConfiguration
- Returns:
- - action
-
getActionOnMaxRestart
public java.lang.String getActionOnMaxRestart()
Returns an action as String to identify an action to take in case of excessive Cas Processor restarts.- continue
- terminate
- disable
- Specified by:
getActionOnMaxRestart
in interfaceCasProcessorConfiguration
- Returns:
- - action
-
getErrorRate
public int getErrorRate()
- Specified by:
getErrorRate
in interfaceCasProcessorConfiguration
-
getErrorSampleSize
public long getErrorSampleSize()
- Specified by:
getErrorSampleSize
in interfaceCasProcessorConfiguration
-
getMaxErrorCount
public int getMaxErrorCount()
Returns max number of tolerated errors- Specified by:
getMaxErrorCount
in interfaceCasProcessorConfiguration
- Returns:
- - max number of allowed errors
-
getMaxRestartCount
public int getMaxRestartCount()
Returns max number of Cas Processor restarts- Specified by:
getMaxRestartCount
in interfaceCasProcessorConfiguration
- Returns:
- - max number of restarts
-
getMaxRetryCount
public int getMaxRetryCount()
Returns max number of tries to process each bundle of Cas- Specified by:
getMaxRetryCount
in interfaceCasProcessorConfiguration
- Returns:
- - max retry count
-
getName
public java.lang.String getName()
Returns Cas Processor name- Specified by:
getName
in interfaceCasProcessorConfiguration
- Returns:
- - Name
-
getTimeout
public long getTimeout()
Returns the max amount of time the CPE will wait for Cas Processor reponse.- Specified by:
getTimeout
in interfaceCasProcessorConfiguration
- Returns:
- - value for timeout
-
getDeploymentParameters
public java.util.List getDeploymentParameters()
Returns a list of deployment parameters ssociated with this Cas Processor- Specified by:
getDeploymentParameters
in interfaceCasProcessorConfiguration
- Returns:
- - deployment paramaters as List
-
getDeploymentType
public java.lang.String getDeploymentType()
Returns deployment type associated with this Cas Processor- integrated
- local
- remote
- Specified by:
getDeploymentType
in interfaceCasProcessorConfiguration
- Returns:
- - deployment type
-
getFilterString
public java.lang.String getFilterString()
Returns unparsed filter expression- Specified by:
getFilterString
in interfaceCasProcessorConfiguration
- Returns:
- - fliter String
-
getFilter
public java.util.LinkedList getFilter() throws ResourceConfigurationException
Returns parsed filter expressions as List.- Specified by:
getFilter
in interfaceCasProcessorConfiguration
- Throws:
ResourceConfigurationException
-
getKeysToDrop
public java.lang.String[] getKeysToDrop() throws ResourceConfigurationException
Returns an array of types that should not be sent to Cas Processor. The drop types are defined in the cpe descriptor.- Specified by:
getKeysToDrop
in interfaceCasProcessorConfiguration
- Throws:
ResourceConfigurationException
-
getBatchSize
public int getBatchSize()
Returns configured batch size setup for this Cas Processor- Specified by:
getBatchSize
in interfaceCasProcessorConfiguration
- Returns:
- - batch size
-
getDescriptorUrl
public java.net.URL getDescriptorUrl() throws ResourceConfigurationException
Returns descriptor associated with this Cas Processor- Specified by:
getDescriptorUrl
in interfaceCasProcessorConfiguration
- Returns:
- object that identifies location of descriptor
- Throws:
ResourceConfigurationException
- if an import could not be resolved
-
getDeploymentParameter
public java.lang.String getDeploymentParameter(java.lang.String aDeployParameter)
Returns a value for a given deployment parameter- Specified by:
getDeploymentParameter
in interfaceCasProcessorConfiguration
- Parameters:
aDeployParameter
- - name of the parameter- Returns:
- - value for parameter name
-
runInSeparateProcess
public boolean runInSeparateProcess()
Returns true if this Cas Processor will run in its own process- Specified by:
runInSeparateProcess
in interfaceCasProcessorConfiguration
- Returns:
- - true if running in seperate process
-
isJavaProcess
public boolean isJavaProcess()
Returns true it the Cas Processor is written in java and will be run with java jvm.- Specified by:
isJavaProcess
in interfaceCasProcessorConfiguration
-
getExecSpec
public Execute getExecSpec()
Returns executable section of the Cas Processor configuration. It contains the name of executable program to be used when launching a seperate process with Cas Processor running as vinci service.- Specified by:
getExecSpec
in interfaceCasProcessorConfiguration
- Returns:
- - Execute object
-
-