org.opendoors.cache.immutable
Class CacheFactory

java.lang.Object
  |
  +--org.opendoors.cache.immutable.CacheFactory

public class CacheFactory
extends java.lang.Object

CacheFactory provides static and instance-specific methods for the creation of an immutable cache.

The preferred method of using this cache is to create an instance of it and specify the property values for the creation of usually several caches over the life-cycle of an application.

create(), create(Map) and destroyCache(UpdateableCache) are the static methods available using the default properties.

See Also:
org.opendoors.cache

Constructor Summary
CacheFactory(java.util.Properties properties)
          Creates an instance of a cache factory with text property options to control the behavior the factory.
CacheFactory(java.util.Properties properties, java.util.Properties defaults)
          This constructor allows you to present factory defaults different than those provided by VFC.
 
Method Summary
static UpdateableCache create()
          A factory static method to provide an empty updateable cache.
static UpdateableCache create(java.util.Map map)
          A factory static method to provide an updateable cache preloaded
 void destroy(UpdateableCache cache)
          Destroys the instance of the cache created by the factory.
static void destroyCache(UpdateableCache cache)
          A static factory method to destroy a cache.
 UpdateableCache initialize(java.util.Map preload)
          Initializes a cache and returns it according to the factory properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheFactory

public CacheFactory(java.util.Properties properties)
Creates an instance of a cache factory with text property options to control the behavior the factory.

Use these options to customize, in other words, the kind of caches the instance this factory produces. The properties names, values and defaults:

 ChangeControl=Subclass.impl.of.ChangeControl
 default: org.opendoors.cache.imple.ChangeControl
 usage: certain cache implementors will subclass ChangeControl
 to provide more granular control over the regeneration
 of the immutable image of the cache.
 
 RefreshRate=NumberOfMilliseconds
 default: 2500 milliseconds
 usage: the amount of time between updates provided
 the cache is idle at least this amount of time.
 
Parameters:
properties - If null, the above defaults will be used, else the elements of the properties will be employed.

CacheFactory

public CacheFactory(java.util.Properties properties,
                    java.util.Properties defaults)
This constructor allows you to present factory defaults different than those provided by VFC.
Method Detail

initialize

public UpdateableCache initialize(java.util.Map preload)
Initializes a cache and returns it according to the factory properties.

create

public static UpdateableCache create()
A factory static method to provide an empty updateable cache.

create

public static UpdateableCache create(java.util.Map map)
A factory static method to provide an updateable cache preloaded

destroyCache

public static void destroyCache(UpdateableCache cache)
A static factory method to destroy a cache.

destroy

public void destroy(UpdateableCache cache)
Destroys the instance of the cache created by the factory.