com.ibm.portal.resolver.cache
Interface CachedDataSourceFactory<T>
- All Superinterfaces:
- DataSourceFactory, DataSourceFactoryEx
-
public interface CachedDataSourceFactory<T>
- extends DataSourceFactoryEx
Representation of a DataSourceFactoryEx that caches information based
on a DataSource.
- Since:
- 7.0
getCallback
CachedDataSourceFactory.Callback<? extends T> getCallback()
- Returns the callback interface used by this cache
- Returns:
- the callback
getDataSourceFactory
DataSourceFactoryEx getDataSourceFactory()
- Returns the factory used to execute the downstream lookups for the
DataSource objects.
- Returns:
- the factory used for the callbacks, not null
newSource
CachedDataSourceFactory.Value<T> newSource(java.net.URI uri,
java.lang.String mode,
java.util.Map<java.lang.String,java.lang.String[]> params,
Context ctx)
throws java.io.IOException
- Retrieves the value from a cache or constructs it by invoking the
attached CachedDataSourceFactory.Callback interface. The retrieved value MUST be disposed
by the caller via the CachedDataSourceFactory.UncacheableValue.dispose() method.
- Specified by:
- newSource in interface DataSourceFactoryEx
- Parameters:
- uri - URI of the addressed resource
- mode - mode constant
- params - parameters map (String -> String[]).
This map is potentially unmodifiable
- ctx - Content Operations Registry (COR) context
- Returns:
- representation of the cached value or null. If the
return value is not null then the
CachedDataSourceFactory.UncacheableValue.dispose() method should be called when the value is
not longer used.
- Throws:
- java.io.IOException - - if the data soure cannot be created