Save This Page
Home » velocity-1.5 » org.apache » velocity » runtime » resource » [javadoc | source]
org.apache.velocity.runtime.resource
public class: ResourceManagerImpl [javadoc | source]
java.lang.Object
   org.apache.velocity.runtime.resource.ResourceManagerImpl

All Implemented Interfaces:
    ResourceManager

Class to manage the text resource for the Velocity Runtime.
Field Summary
public static final  int RESOURCE_TEMPLATE    A template resources. 
public static final  int RESOURCE_CONTENT    A static content resource. 
protected  ResourceCache globalCache    Object implementing ResourceCache to be our resource manager's Resource cache. 
protected final  List resourceLoaders    The List of templateLoaders that the Runtime will use to locate the InputStream source of a template. 
protected  RuntimeServices rsvc    The internal RuntimeServices object. 
protected  Log log    Logging. 
Method from org.apache.velocity.runtime.resource.ResourceManagerImpl Summary:
getLoaderNameForResource,   getResource,   getResource,   initialize,   loadResource,   refreshResource
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.velocity.runtime.resource.ResourceManagerImpl Detail:
 public String getLoaderNameForResource(String resourceName) 
    Determines if a template exists, and returns name of the loader that provides it. This is a slightly less hokey way to support the Velocity.templateExists() utility method, which was broken when per-template encoding was introduced. We can revisit this.
 public Resource getResource(String resourceName,
    int resourceType) throws Exception, ResourceNotFoundException, ParseErrorException 
Deprecated! Use - #getResource(String resourceName, int resourceType, String encoding )

    Gets the named resource. Returned class type corresponds to specified type (i.e. Template to RESOURCE_TEMPLATE).
 public synchronized Resource getResource(String resourceName,
    int resourceType,
    String encoding) throws Exception, ResourceNotFoundException, ParseErrorException 
    Gets the named resource. Returned class type corresponds to specified type (i.e. Template to RESOURCE_TEMPLATE).
 public synchronized  void initialize(RuntimeServices rsvc) throws Exception 
    Initialize the ResourceManager.
 protected Resource loadResource(String resourceName,
    int resourceType,
    String encoding) throws Exception, ResourceNotFoundException, ParseErrorException 
    Loads a resource from the current set of resource loaders.
 protected  void refreshResource(Resource resource,
    String encoding) throws Exception, ResourceNotFoundException, ParseErrorException 
    Takes an existing resource, and 'refreshes' it. This generally means that the source of the resource is checked for changes according to some cache/check algorithm and if the resource changed, then the resource data is reloaded and re-parsed.