org.apache.cayenne.access.jdbc
Class SQLTemplateResourceManager

java.lang.Object
  extended by org.apache.velocity.runtime.resource.loader.ResourceLoader
      extended by org.apache.cayenne.access.jdbc.SQLTemplateResourceManager
All Implemented Interfaces:
org.apache.velocity.runtime.resource.ResourceManager

public class SQLTemplateResourceManager
extends org.apache.velocity.runtime.resource.loader.ResourceLoader
implements org.apache.velocity.runtime.resource.ResourceManager

An implementation of the Velocity ResourceManager and ResourceLoader that creates templates from in-memory Strings.

Since:
1.1
Author:
Andrei Adamchik

Field Summary
protected  java.util.Map templateCache
           
 
Fields inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
className, isCachingOn, modificationCheckInterval, rsvc
 
Fields inherited from interface org.apache.velocity.runtime.resource.ResourceManager
RESOURCE_CONTENT, RESOURCE_TEMPLATE
 
Constructor Summary
SQLTemplateResourceManager()
           
 
Method Summary
 void clearCache()
           
 long getLastModified(org.apache.velocity.runtime.resource.Resource resource)
           
 java.lang.String getLoaderNameForResource(java.lang.String resourceName)
           
 org.apache.velocity.runtime.resource.Resource getResource(java.lang.String resourceName, int resourceType, java.lang.String encoding)
          Returns a Velocity Resource which is a Template for the given SQL.
 java.io.InputStream getResourceStream(java.lang.String source)
           
 void init(org.apache.commons.collections.ExtendedProperties configuration)
           
 void initialize(org.apache.velocity.runtime.RuntimeServices rs)
           
 boolean isSourceModified(org.apache.velocity.runtime.resource.Resource resource)
           
 
Methods inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
commonInit, getClassName, getModificationCheckInterval, isCachingOn, setCachingOn, setModificationCheckInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

templateCache

protected java.util.Map templateCache
Constructor Detail

SQLTemplateResourceManager

public SQLTemplateResourceManager()
Method Detail

initialize

public void initialize(org.apache.velocity.runtime.RuntimeServices rs)
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.velocity.runtime.resource.ResourceManager
Throws:
java.lang.Exception

clearCache

public void clearCache()

getResource

public org.apache.velocity.runtime.resource.Resource getResource(java.lang.String resourceName,
                                                                 int resourceType,
                                                                 java.lang.String encoding)
                                                          throws org.apache.velocity.exception.ResourceNotFoundException,
                                                                 org.apache.velocity.exception.ParseErrorException,
                                                                 java.lang.Exception
Returns a Velocity Resource which is a Template for the given SQL.

Specified by:
getResource in interface org.apache.velocity.runtime.resource.ResourceManager
Throws:
org.apache.velocity.exception.ResourceNotFoundException
org.apache.velocity.exception.ParseErrorException
java.lang.Exception

getLoaderNameForResource

public java.lang.String getLoaderNameForResource(java.lang.String resourceName)
Specified by:
getLoaderNameForResource in interface org.apache.velocity.runtime.resource.ResourceManager

getLastModified

public long getLastModified(org.apache.velocity.runtime.resource.Resource resource)
Specified by:
getLastModified in class org.apache.velocity.runtime.resource.loader.ResourceLoader

getResourceStream

public java.io.InputStream getResourceStream(java.lang.String source)
                                      throws org.apache.velocity.exception.ResourceNotFoundException
Specified by:
getResourceStream in class org.apache.velocity.runtime.resource.loader.ResourceLoader
Throws:
org.apache.velocity.exception.ResourceNotFoundException

init

public void init(org.apache.commons.collections.ExtendedProperties configuration)
Specified by:
init in class org.apache.velocity.runtime.resource.loader.ResourceLoader

isSourceModified

public boolean isSourceModified(org.apache.velocity.runtime.resource.Resource resource)
Specified by:
isSourceModified in class org.apache.velocity.runtime.resource.loader.ResourceLoader


Copyright © 2001-2006 Apache.org All Rights Reserved.