org.webmacro.resource
Class BrokerTemplateLoader

java.lang.Object
  extended byorg.webmacro.resource.AbstractTemplateLoader
      extended byorg.webmacro.resource.BrokerTemplateLoader
All Implemented Interfaces:
TemplateLoader

public class BrokerTemplateLoader
extends AbstractTemplateLoader


Field Summary
 
Fields inherited from class org.webmacro.resource.AbstractTemplateLoader
broker, helper, log
 
Constructor Summary
BrokerTemplateLoader()
           
 
Method Summary
 Template load(java.lang.String query, CacheElement ce)
          Try to load a template.
 void setConfig(java.lang.String config)
          Set the config options for this template loader.
 
Methods inherited from class org.webmacro.resource.AbstractTemplateLoader
init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrokerTemplateLoader

public BrokerTemplateLoader()
Method Detail

setConfig

public void setConfig(java.lang.String config)
Description copied from interface: TemplateLoader
Set the config options for this template loader. The config option is the path after the colon (":") in the TemplatePath setting for this loader.
This can be an path as well as JDBC settings or something completely different.

Parameters:
config - config options for this template loader

load

public final Template load(java.lang.String query,
                           CacheElement ce)
                    throws ResourceException
Description copied from interface: TemplateLoader
Try to load a template. This method will create and return a template found in the location described by query or return null, if no such template exists. If a resource is found at the location, but no template could be created for some reason, a ResourceException is thrown.
If the cache element ce is not null, this method should set a reload context on the cache element to enable reload-on-demand for this template. If ce is null, caching is disabled.

Parameters:
query - location to load template from
ce - cache element that will be used for this template or null if no cache is used.
Throws:
ResourceException - if an error occured while loading the template