| net.refractions.udig.project.IResourceCachingInterceptor
All known Subclasses: net.refractions.udig.project.internal.interceptor.ResourceCacheInterceptor,
IResourceCachingInterceptor | public interface IResourceCachingInterceptor (Code) | | Controls the caching of resources returned by:
ILayer.getResource(Classorg.eclipse.core.runtime.IProgressMonitor) .
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.
The "active" caching strategy is stored in the
ProjectPlugin.getPlugin().getPreferenceStore().getString( "P_LAYER_RESOURCE_CACHING_STRATEGY" ).
Set the preference to activate a custom Caching strategy.
author: Jesse since: 1.1.0 |
Method Summary | |
T | get(ILayer layer, Class<T> requestedType) Obtains the resource from the cache.
< Parameters: T - > the type of the resource. | boolean | isCached(ILayer layer, IGeoResource geoResource, Class<T> requestedType) Called to see if the resource should be obtained from cache
< Parameters: T - > the type of the resource. | void | put(ILayer layer, T resource, Class<T> requestedType) Caches the resource. |
get | T get(ILayer layer, Class<T> requestedType)(Code) | | Obtains the resource from the cache.
< Parameters: T - > the type of the resource. Can be most any type of Object Parameters: layer - the layer that the resource is being obtained from Parameters: requestedType - the type of object that the caller requested the cached instance of the resource. |
isCached | boolean isCached(ILayer layer, IGeoResource geoResource, Class<T> requestedType)(Code) | | Called to see if the resource should be obtained from cache
< Parameters: T - > the type of the resource. Can be most any type of Object Parameters: layer - the layer that the resource is being obtained from Parameters: geoResource - the resource obtained from the GeoResource. NO interceptors have ran on the resource. Parameters: requestedType - the type of object that the caller requested true if the resource should be obtained from the cache. |
put | void put(ILayer layer, T resource, Class<T> requestedType)(Code) | | Caches the resource.
< Parameters: T - > the type of the resource. Can be most any type of Object Parameters: layer - the layer that the resource is being obtained from Parameters: resource - the resource obtained from the GeoResource. All the PRE interceptors have ran on the resource. Parameters: requestedType - the type of object that the caller requested |
|
|