|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IResourceCachingInterceptor
Controls the caching of resources returned by:
ILayer#getResource(Class, org.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.
Method Summary | ||
---|---|---|
|
get(ILayer layer,
java.lang.Class<T> requestedType)
Obtains the resource from the cache. |
|
|
isCached(ILayer layer,
IGeoResource geoResource,
java.lang.Class<T> requestedType)
Called to see if the resource should be obtained from cache |
|
|
put(ILayer layer,
T resource,
java.lang.Class<T> requestedType)
Caches the resource. |
Method Detail |
---|
<T> boolean isCached(ILayer layer, IGeoResource geoResource, java.lang.Class<T> requestedType)
T
- the type of the resource. Can be most any type of Objectlayer
- the layer that the resource is being obtained fromgeoResource
- the resource obtained from the GeoResource. NO interceptors have ran on the resource.requestedType
- the type of object that the caller requested
<T> T get(ILayer layer, java.lang.Class<T> requestedType)
T
- the type of the resource. Can be most any type of Objectlayer
- the layer that the resource is being obtained fromrequestedType
- the type of object that the caller requested
<T> void put(ILayer layer, T resource, java.lang.Class<T> requestedType)
T
- the type of the resource. Can be most any type of Objectlayer
- the layer that the resource is being obtained fromresource
- the resource obtained from the GeoResource. All the PRE interceptors have ran on the resource.requestedType
- the type of object that the caller requested
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |