org.apache.velocity.runtime.resource
public class ResourceManagerImpl extends Object implements ResourceManager
Version: $Id: ResourceManagerImpl.java,v 1.7.4.1 2004/03/03 23:23:01 geirm Exp $
Field Summary | |
---|---|
protected ResourceCache | globalCache
Object implementing ResourceCache to
be our resource manager's Resource cache. |
boolean | logWhenFound
switch to turn off log notice when a resource is found for
the first time. |
boolean | resourceLoaderInitializersActive
Each loader needs a configuration object for
its initialization, this flags keeps track of whether
or not the configuration objects have been created
for the resource loaders. |
protected ArrayList | resourceLoaders
The List of templateLoaders that the Runtime will
use to locate the InputStream source of a template. |
protected RuntimeServices | rsvc |
static int | RESOURCE_CONTENT
A static content resource. |
static String | RESOURCE_LOADER_IDENTIFIER
token used to identify the loader internally |
static int | RESOURCE_TEMPLATE
A template resources. |
ArrayList | sourceInitializerList
This is a list of the template input stream source
initializers, basically properties for a particular
template stream source. |
Hashtable | sourceInitializerMap
This is a map of public name of the template
stream source to it's initializer. |
Method Summary | |
---|---|
void | assembleResourceLoaderInitializers()
This will produce a List of Hashtables, each
hashtable contains the intialization info for
a particular resource loader. |
String | getLoaderNameForResource(String resourceName)
Determines is a template exists, and returns name of the loader that
provides it. |
Resource | getResource(String resourceName, int resourceType, String encoding)
Gets the named resource. |
Resource | getResource(String resourceName, int resourceType)
Gets the named resource. |
void | initialize(RuntimeServices rs)
Initialize the ResourceManager. |
protected Resource | loadResource(String resourceName, int resourceType, String encoding)
Loads a resource from the current set of resource loaders
|
protected void | refreshResource(Resource resource, String encoding)
Takes an existing resource, and 'refreshes' it. |
Parameters: resourceName Name of template or content resource
Returns: class name of loader than can provide it
Template
to RESOURCE_TEMPLATE
).
Parameters: resourceName The name of the resource to retrieve. resourceType The type of resource (RESOURCE_TEMPLATE
,
RESOURCE_CONTENT
, etc.). encoding The character encoding to use.
Returns: Resource with the template parsed and ready.
Throws: ResourceNotFoundException if template not found from any available source. ParseErrorException if template cannot be parsed due to syntax (or other) error. Exception if a problem in parse
Deprecated: Use ResourceManagerImpl
Gets the named resource. Returned class type corresponds to specified type (i.e.Template
to RESOURCE_TEMPLATE
).
Parameters: resourceName The name of the resource to retrieve. resourceType The type of resource (RESOURCE_TEMPLATE
,
RESOURCE_CONTENT
, etc.).
Returns: Resource with the template parsed and ready.
Throws: ResourceNotFoundException if template not found from any available source. ParseErrorException if template cannot be parsed due to syntax (or other) error. Exception if a problem in parse
Parameters: resourceName The name of the resource to retrieve. resourceType The type of resource (RESOURCE_TEMPLATE
,
RESOURCE_CONTENT
, etc.). encoding The character encoding to use.
Returns: Resource with the template parsed and ready.
Throws: ResourceNotFoundException if template not found from any available source. ParseErrorException if template cannot be parsed due to syntax (or other) error. Exception if a problem in parse
Parameters: resource resource to refresh
Throws: ResourceNotFoundException if template not found from current source for this Resource ParseErrorException if template cannot be parsed due to syntax (or other) error. Exception if a problem in parse