Interface ConfigurableResource
-
- All Superinterfaces:
Resource
- All Known Subinterfaces:
AnalysisEngine,CasConsumer,CasDataConsumer,CasDataInitializer,CasInitializer,CollectionReader,TextAnalysisEngine
- All Known Implementing Classes:
AggregateAnalysisEngine_impl,AnalysisEngineImplBase,AnalysisEngineProcessorAdapter,AnalysisEngineServiceAdapter,ASB_impl.DummyAnalysisEngine,CasConsumer_ImplBase,CasDataCollectionReader_ImplBase,CasDataConsumer_ImplBase,CasDataInitializer_ImplBase,CasInitializer_ImplBase,CasProcessorAnnotator,CollectionReader_ImplBase,ConfigurableResource_ImplBase,FileSystemCollectionReader,FlowControllerContainer,InlineXmlCasConsumer,JCasProcessorAnnotator,MultiprocessingAnalysisEngine_impl,PearAnalysisEngineWrapper,PrimitiveAnalysisEngine_impl,ProcessingContainer,ProcessingContainer_Impl,UimacppAnalysisEngineImpl,VinciAnalysisEngineServiceAdapter,XCasWriterCasConsumer,XmiWriterCasConsumer
public interface ConfigurableResource extends Resource
AResourcethat has configuration parameters that can be changed after the Resource has been instantiated.To set configuration parameters, call the
setConfigParameterValue(String,String,Object)method for each parameter that is to be set, and then call thereconfigure()method to cause the Resource to re-read its configuration settings.Note that if the Resource attempts to access its configuration settings between the call to
setConfigParameterValueand the call toreconfigure, it may retrieve either the old value or the new value. This decision is left to the framework'sConfigurationManagerimplementation.
-
-
Field Summary
-
Fields inherited from interface org.apache.uima.resource.Resource
PARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_MANAGER, PARAM_CONFIG_PARAM_SETTINGS, PARAM_EXTERNAL_OVERRIDE_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_RESOURCE_MANAGER, PARAM_UIMA_CONTEXT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectgetConfigParameterValue(java.lang.String aParamName)Looks up the value of a configuration parameter.java.lang.ObjectgetConfigParameterValue(java.lang.String aGroupName, java.lang.String aParamName)Looks up the value of a configuration parameter in a group.voidreconfigure()Instructs this Resource to re-read its configuration parameter settings.voidsetConfigParameterValue(java.lang.String aParamName, java.lang.Object aValue)Sets the value of a configuration parameter.voidsetConfigParameterValue(java.lang.String aGroupName, java.lang.String aParamName, java.lang.Object aValue)Sets the value of a configuration parameter in a group.-
Methods inherited from interface org.apache.uima.resource.Resource
destroy, getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, initialize, setLogger
-
-
-
-
Method Detail
-
getConfigParameterValue
java.lang.Object getConfigParameterValue(java.lang.String aParamName)
Looks up the value of a configuration parameter. This method will only return the value of a parameter that is not defined in any group.This method returns
nullif the parameter is optional and has not been assigned a value. (For mandatory parameters, an exception is thrown during initialization if no value has been assigned.) This method also returnsnullif there is no declared configuration parameter with the specified name.- Parameters:
aParamName- the name of a parameter that is not in any group- Returns:
- the value of the parameter with name
aParamName,nullis either the parameter does not exist or it has not been assigned a value.
-
getConfigParameterValue
java.lang.Object getConfigParameterValue(java.lang.String aGroupName, java.lang.String aParamName)Looks up the value of a configuration parameter in a group. If the parameter has no value assigned within the group, fallback strategies will be followed.This method returns
nullif the parameter is optional and has not been assigned a value. (For mandatory parameters, an exception is thrown during initialization if no value has been assigned.) This method also returnsnullif there is no declared configuration parameter with the specified name.- Parameters:
aGroupName- the name of a configuration group. If the group name isnull, this method will return the same value asgetParameterValue(String).aParamName- the name of a parameter in the group- Returns:
- the value of the parameter in group
aGroupNamewith nameaParamName,,nullis either the parameter does not exist or it has not been assigned a value.
-
setConfigParameterValue
void setConfigParameterValue(java.lang.String aParamName, java.lang.Object aValue)Sets the value of a configuration parameter. This only works for a parameter that is not defined in any group. Note that there is no guarantee that the change will take effect untilreconfigure()is called.- Parameters:
aParamName- the name of a parameter that is not in any groupaValue- the value to assign to the parameter
-
setConfigParameterValue
void setConfigParameterValue(java.lang.String aGroupName, java.lang.String aParamName, java.lang.Object aValue)Sets the value of a configuration parameter in a group. Note that there is no guarantee that the change will take effect untilreconfigure()is called.- Parameters:
aGroupName- the name of a configuration group. If this parameter isnull, this method will have the same effect assetParameterValue(String,Object).aParamName- the name of a parameter in the groupaValue- the value to assign to the parameter.
-
reconfigure
void reconfigure() throws ResourceConfigurationExceptionInstructs this Resource to re-read its configuration parameter settings.- Throws:
ResourceConfigurationException- if the configuration is not valid
-
-