Package org.apache.uima.collection
Class CasInitializer_ImplBase
- java.lang.Object
-
- org.apache.uima.resource.Resource_ImplBase
-
- org.apache.uima.resource.ConfigurableResource_ImplBase
-
- org.apache.uima.collection.CasInitializer_ImplBase
-
- All Implemented Interfaces:
CasInitializer
,ConfigurableResource
,Resource
@Deprecated public abstract class CasInitializer_ImplBase extends ConfigurableResource_ImplBase implements CasInitializer
Deprecated.As of v2.0, CAS Initializers are deprecated. A component that performs an operation like HTML detagging should instead be implemented as a "multi-Sofa" annotator. See org.apache.uima.examples.XmlDetagger for an example.Base class for CAS Initializers, which developers should extend with their own CAS Initializer implementation classes.
-
-
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
-
-
Constructor Summary
Constructors Constructor Description CasInitializer_ImplBase()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
destroy()
Deprecated.Releases all resources held by thisResource
.ProcessingResourceMetaData
getProcessingResourceMetaData()
Deprecated.Gets the metadata that describes thisCasInitializer
.void
initialize()
Deprecated.This method is called during initialization, and does nothing by default.boolean
initialize(ResourceSpecifier aSpecifier, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams)
Deprecated.Called by the framework to initialize this CAS Initializer.void
reconfigure()
Deprecated.Notifies this CAS Initializer that its configuration parameter settings have been changed.void
typeSystemInit(TypeSystem arg0)
Deprecated.Informs this CasInitializer that the CAS TypeSystem has changed.-
Methods inherited from class org.apache.uima.resource.ConfigurableResource_ImplBase
getConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValue
-
Methods inherited from class org.apache.uima.resource.Resource_ImplBase
getCasManager, getLogger, getMetaData, getRelativePathResolver, getResourceManager, getUimaContext, getUimaContextAdmin, loadUserClass, loadUserClassOrThrow, setContextHolder, setContextHolderX, setLogger, setMetaData, withContextHolder
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.uima.collection.CasInitializer
initializeCas
-
Methods inherited from interface org.apache.uima.resource.ConfigurableResource
getConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValue
-
Methods inherited from interface org.apache.uima.resource.Resource
getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger
-
-
-
-
Method Detail
-
initialize
public boolean initialize(ResourceSpecifier aSpecifier, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams) throws ResourceInitializationException
Deprecated.Called by the framework to initialize this CAS Initializer. Subclasses should NOT override this method; instead they should override the zero-argumentinitialize()
method and access metadata via thegetProcessingResourceMetaData()
method. This method is non-final only for legacy reasons.- Specified by:
initialize
in interfaceResource
- Overrides:
initialize
in classResource_ImplBase
- Parameters:
aSpecifier
- specifies how to create a resource or locate an existing resource service.aAdditionalParams
- a Map containing additional parameters. May benull
if there are no parameters. Each class that implements this interface can decide what additional parameters it supports.- Returns:
- true if and only if initialization completed successfully. Returns false if the given
ResourceSpecifier
is not of an appropriate type for this Resource. If theResourceSpecifier
is of an appropriate type but is invalid or if some other failure occurs, an exception should be thrown. - Throws:
ResourceInitializationException
- if a failure occurs during initialization.- See Also:
Resource.initialize(org.apache.uima.resource.ResourceSpecifier, java.util.Map)
-
initialize
public void initialize() throws ResourceInitializationException
Deprecated.This method is called during initialization, and does nothing by default. Subclasses should override it to perform one-time startup logic.- Throws:
ResourceInitializationException
- if a failure occurs during initialization.
-
destroy
public void destroy()
Deprecated.Description copied from interface:Resource
Releases all resources held by thisResource
.- Specified by:
destroy
in interfaceResource
- Overrides:
destroy
in classResource_ImplBase
- See Also:
Resource.destroy()
-
typeSystemInit
public void typeSystemInit(TypeSystem arg0) throws ResourceInitializationException
Deprecated.Description copied from interface:CasInitializer
Informs this CasInitializer that the CAS TypeSystem has changed. The CollectionReader must call this method whenever the CollectionReader's typeSystemInit() method is called.In this method, the CasInitializer should use the
TypeSystem
to resolve the names of Type and Features to the actualType
andFeature
objects, which can then be used during processing.- Specified by:
typeSystemInit
in interfaceCasInitializer
- Parameters:
arg0
- the type system to use- Throws:
ResourceInitializationException
- if the type system is not compatible with this CAS Initializer- See Also:
CasObjectProcessor.typeSystemInit(org.apache.uima.cas.TypeSystem)
-
getProcessingResourceMetaData
public ProcessingResourceMetaData getProcessingResourceMetaData()
Deprecated.Description copied from interface:CasInitializer
Gets the metadata that describes thisCasInitializer
.- Specified by:
getProcessingResourceMetaData
in interfaceCasInitializer
- Returns:
- an object containing all metadata for this CasInitializer
- See Also:
CasProcessor.getProcessingResourceMetaData()
-
reconfigure
public void reconfigure() throws ResourceConfigurationException
Deprecated.Notifies this CAS Initializer that its configuration parameter settings have been changed. By default this method just callsdestroy()
followed byinitialize()
. CAS Initializers that have expensive initialization that does not need to be redone whenever configuration parameters change may wish to override this method to provide a more efficient implementation.- Specified by:
reconfigure
in interfaceConfigurableResource
- Overrides:
reconfigure
in classConfigurableResource_ImplBase
- Throws:
ResourceConfigurationException
- if the configuration is not valid- See Also:
ConfigurableResource_ImplBase.reconfigure()
-
-