resourceInterceptor
Identifier:
net.refractions.udig.project.resourceInterceptor
Since:
1.1
Description:
resourceInterceptors are ran when getResource(Class>, IProgressMonitor) is called on a Layer. It allows the returned resource to be modified.
Configuration Markup:
<!ELEMENT extension (interceptor* , cachingStrategy*)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
>
<!ELEMENT interceptor EMPTY>
<!ATTLIST interceptor
id CDATA #REQUIRED
class CDATA #REQUIRED
target CDATA #IMPLIED
order (POST|PRE)
>
Declares an interceptor to run when a resource is obtained from a layer.
- id - The id of the interceptor
- class - The resource intercepter to run if the target type is correct.
- target - If provided, the interceptor will only be called when the resource being requested is of the type declared as the target.
- order - Indicates when, with respect to other interceptors, that this interceptor will be ran. Interceptors in a category are ran in random order.
<!ELEMENT cachingStrategy EMPTY>
<!ATTLIST cachingStrategy
id CDATA #REQUIRED
class CDATA #REQUIRED
>
Declares an caching strategy for Resources fetched from a Layer. Becareful changing this can have unexpected side effects. Make sure you test the entire application well.
For example if a new feature store was returned each time then every plugin that is interested in events would need to create a resource interceptor and every request for a FeatureStore would result in both a new FeatureStore and a new listener for every interested plugin. Since the Datastore's Listener manager often keeps the listeners indefinately then we would very quickly have 10s to 100s of listeners that can't be garbage collected and possibly featurestores as well.
- id - The id of the interceptor
- class - The resource caching intercepter to run if the target type is correct.
Examples:
An example is the case where a FeatureStore is requested. All features stores need a transaction set on them. The setTransaction functionality could be implemented as a resourceInterceptor
API Information:
[Enter API information here.]
Supplied Implementation:
[Enter information about supplied implementation of this extension point.]