public interface IModule extends Serializable
Collections of IModule objects and ILayer
objects together constitute
the cache metadata encapsulated by an ICache
object. Instances of
this object are serialized, through serialization of the containing
ICache
object, by the cache manager when it periodically saves a
snapshot of the cache metadata to disk. Serialization is actually performed
on clones of the objects in the cache in order to avoid performance
degradation which would be caused by locking of critical sections during file
I/O.
Instances of IModule
are created by calling IAggregator.newModule(String, URI)
.
IModules objects are cloneable and serializable.
Modifier and Type | Method and Description |
---|---|
void |
clearCached(ICacheManager mgr)
Delete any cache files associated with this module
|
Future<ModuleBuildReader> |
getBuild(javax.servlet.http.HttpServletRequest request)
Returns a
to the
module build for the specified request. |
String |
getModuleId()
Returns the module id for this module.
|
String |
getModuleName()
Returns the module name.
|
String |
getPluginName()
Returns the plugin name.
|
IResource |
getResource(IAggregator aggregator)
This method is provided so that the module can function as a runtime cache
for the
IResource object associated with the module URI that was
used to construct this instance. |
URI |
getURI()
Returns the source url for this module
|
Future<ModuleBuildReader> getBuild(javax.servlet.http.HttpServletRequest request) throws IOException
Future
<ModuleBuildReader
>
to the
module build for the specified request. The build object is returned
asynchronously in order to facilitate concurrent processing of module
builds.request
- The HTTP request objectFuture
to a ModuleBuildReader
object that will be available
at some point in the future.IOException
UnsupportedOperationException
- If no resource factory or module builder can be found for this resource.void clearCached(ICacheManager mgr)
mgr
- The cache manager. Modules can use
ICacheManager.deleteFileDelayed(String)
to
asynchronously schedule cache files for deletion following a
delay period, avoiding the potential for synchronization
issues associated with the use of cache files by multiple
threads.String getModuleId()
String getModuleName()
String getPluginName()
URI getURI()
IResource getResource(IAggregator aggregator)
IResource
object associated with the module URI that was
used to construct this instance.
Note that instances of IModule
are both Serializable
and Cloneable, yet instances of IResource
are neither, so the module
must not attempt to save the cached IResource
object to its
persistent state, nor to object clones.
aggregator
- the aggregator. The module may use the IAggregator.newResource(URI)
method to obtain a new instance of the IResource
.IResource
object for this module's URI.Copyright © 2011-2015 IBM. All Rights Reserved.