com.buglabs.osgi.sewing
Class TemplateIncludesCache

java.lang.Object
  extended by com.buglabs.osgi.sewing.TemplateIncludesCache
All Implemented Interfaces:
Cache

public class TemplateIncludesCache
extends java.lang.Object
implements Cache

This class allows us to include templates within templates All included templates must be in includesAlias the default extension for include templates is "inc" Only the minimum methods for Cache have been implemented, getItem(String) and getItem(String, String) This is all we need to allow simple directives in Sewing freemarker templates


Constructor Summary
TemplateIncludesCache(BundleContext context, java.lang.String includesAlias)
           
 
Method Summary
 void addCacheListener(CacheListener listener)
          Not implemented - throws UnsupportedOperationException
 CacheListener[] getCacheListeners()
          Not implemented - throws UnsupportedOperationException
 Cacheable getItem(java.lang.String name)
          Gets an item from the cache.
 Cacheable getItem(java.lang.String name, java.lang.String type)
          Gets an item of the specified type from the cache.
 java.util.Iterator listCachedFiles()
          Not implemented - throws UnsupportedOperationException
 void removeCacheListener(CacheListener listener)
          Not implemented - throws UnsupportedOperationException
 void stopAutoUpdate()
          Not implemented - throws UnsupportedOperationException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateIncludesCache

public TemplateIncludesCache(BundleContext context,
                             java.lang.String includesAlias)
Method Detail

getItem

public Cacheable getItem(java.lang.String name)
Description copied from interface: Cache
Gets an item from the cache. Assumes a default type of object will be returned.

Specified by:
getItem in interface Cache
Parameters:
name - a string uniquely identifying the item.
Returns:
the item corresponding to the name, or null if not found.

getItem

public Cacheable getItem(java.lang.String name,
                         java.lang.String type)
Description copied from interface: Cache
Gets an item of the specified type from the cache.

Specified by:
getItem in interface Cache
Parameters:
name - a string uniquely identifying the item.
type - the type of item to be retrieved
Returns:
the item corresponding to the name, or null if not found.

addCacheListener

public void addCacheListener(CacheListener listener)
Not implemented - throws UnsupportedOperationException

Specified by:
addCacheListener in interface Cache
Parameters:
listener - the CacheListener to be registered.

getCacheListeners

public CacheListener[] getCacheListeners()
Not implemented - throws UnsupportedOperationException

Specified by:
getCacheListeners in interface Cache
Returns:
an array of CacheListeners

listCachedFiles

public java.util.Iterator listCachedFiles()
Not implemented - throws UnsupportedOperationException

Specified by:
listCachedFiles in interface Cache
Returns:
the iterator over a list of CacheElement instances that correspond to templates in the cache

removeCacheListener

public void removeCacheListener(CacheListener listener)
Not implemented - throws UnsupportedOperationException

Specified by:
removeCacheListener in interface Cache
Parameters:
listener - the CacheListener to be unregistered.

stopAutoUpdate

public void stopAutoUpdate()
Not implemented - throws UnsupportedOperationException

Specified by:
stopAutoUpdate in interface Cache