org.webmacro.resource
Interface ResourceLoader

All Known Implementing Classes:
CachingProvider, BrokerTemplateProviderHelper, Encoder

public interface ResourceLoader

Methods to be implemented by a resource loader, which will work with a cache manager.

Since:
0.96
Author:
Brian Goetz
See Also:
CachingProvider, CacheManager

Method Summary
 void init(Broker b, Settings config)
          Initialize this provider based on the specified config.
 java.lang.Object load(java.lang.Object query, CacheElement ce)
          Load an object from permanent storage (or construct it) on demand.
 java.lang.Object load(java.lang.String query, CacheElement ce)
          Load an object from permanent storage (or construct it) on demand.
 

Method Detail

load

public java.lang.Object load(java.lang.String query,
                             CacheElement ce)
                      throws ResourceException
Load an object from permanent storage (or construct it) on demand.

load

public java.lang.Object load(java.lang.Object query,
                             CacheElement ce)
                      throws ResourceException
Load an object from permanent storage (or construct it) on demand. Classes which extend CachingProvider don't need to supply this, since providers will only be called with String queries.

init

public void init(Broker b,
                 Settings config)
          throws InitException
Initialize this provider based on the specified config.