Class ResourceServiceAdapter
- java.lang.Object
-
- org.apache.uima.resource.Resource_ImplBase
-
- org.apache.uima.resource.service.impl.ResourceServiceAdapter
-
- All Implemented Interfaces:
Resource
public abstract class ResourceServiceAdapter extends Resource_ImplBase
Insulates applications from the knowledge that they are interacting with aResourceService_implrather than a local instance of aResource. This is an abstract base class that specific resource adapter implementations may extend.This class implements the
Resourceinterface and encapsulates all communications with a remoteResourceService. Thus, applications can interact with this adapter in the same way they would interact with anyResource, and can be completely unaware of the fact that a remoteResourceServiceis being used.
-
-
Field Summary
Fields Modifier and Type Field Description private ResourceMetaDatamCachedMetaDataCached meta data.private ResourceServiceStubmStubThe stub that communicates with the remote service.-
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 ResourceServiceAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Releases all resources held by thisResource.ResourceMetaDatagetMetaData()Gets the metadata that describes thisResource.protected ResourceServiceStubgetStub()Gets the stub to be used to communicate with the remote service.protected voidsetStub(ResourceServiceStub aStub)Sets the stub to be used to communicate with the remote service.-
Methods inherited from class org.apache.uima.resource.Resource_ImplBase
getCasManager, getLogger, getRelativePathResolver, getResourceManager, getUimaContext, getUimaContextAdmin, initialize, loadUserClass, loadUserClassOrThrow, setContextHolder, setContextHolderX, setLogger, setMetaData, withContextHolder
-
-
-
-
Field Detail
-
mStub
private ResourceServiceStub mStub
The stub that communicates with the remote service.
-
mCachedMetaData
private ResourceMetaData mCachedMetaData
Cached meta data.
-
-
Method Detail
-
setStub
protected void setStub(ResourceServiceStub aStub)
Sets the stub to be used to communicate with the remote service. Subclasses must call this from theirinitializemethod.- Parameters:
aStub- the stub for the remote service
-
getStub
protected ResourceServiceStub getStub()
Gets the stub to be used to communicate with the remote service.- Returns:
- the stub for the remote service
-
getMetaData
public ResourceMetaData getMetaData()
Description copied from interface:ResourceGets the metadata that describes thisResource.- Specified by:
getMetaDatain interfaceResource- Overrides:
getMetaDatain classResource_ImplBase- Returns:
- an object containing all metadata for this resource.
- See Also:
Resource.getMetaData()
-
destroy
public void destroy()
Description copied from interface:ResourceReleases all resources held by thisResource.- Specified by:
destroyin interfaceResource- Overrides:
destroyin classResource_ImplBase- See Also:
Resource.destroy()
-
-