ehcache

net.sf.ehcache.bootstrap
Class BootstrapCacheLoaderFactory<T extends BootstrapCacheLoader>

java.lang.Object
  extended by net.sf.ehcache.bootstrap.BootstrapCacheLoaderFactory<T>
Type Parameters:
T - The BootstrapCacheLoader type this Factory will create
Direct Known Subclasses:
DiskStoreBootstrapCacheLoaderFactory, RMIBootstrapCacheLoaderFactory, TerracottaBootstrapCacheLoaderFactory

public abstract class BootstrapCacheLoaderFactory<T extends BootstrapCacheLoader>
extends Object

An abstract factory for creating BootstrapCacheLoader instances. Implementers should provide their own concrete factory extending this factory. It can then be configured in ehcache.xml.

Version:
$Id: BootstrapCacheLoaderFactory.java 5594 2012-05-07 16:04:31Z cdennis $
Author:
Greg Luck

Field Summary
static String BOOTSTRAP_ASYNCHRONOUSLY
          The property name expected in ehcache.xml for the bootstrap asyncrhonously switch.
 
Constructor Summary
BootstrapCacheLoaderFactory()
           
 
Method Summary
abstract  T createBootstrapCacheLoader(Properties properties)
          Create a BootstrapCacheLoader
protected  boolean extractBoolean(Properties properties, String prop, boolean defaultValue)
          Will retrieve the boolean value from the properties, defaulting if property isn't present
protected  boolean extractBootstrapAsynchronously(Properties properties)
          Extracts the value of bootstrapAsynchronously from the properties
protected  long extractLong(Properties properties, String prop, long defaultValue)
          Will retrieve the boolean value from the properties, defaulting if property isn't present
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOOTSTRAP_ASYNCHRONOUSLY

public static final String BOOTSTRAP_ASYNCHRONOUSLY
The property name expected in ehcache.xml for the bootstrap asyncrhonously switch.

See Also:
Constant Field Values
Constructor Detail

BootstrapCacheLoaderFactory

public BootstrapCacheLoaderFactory()
Method Detail

createBootstrapCacheLoader

public abstract T createBootstrapCacheLoader(Properties properties)
Create a BootstrapCacheLoader

Parameters:
properties - implementation specific properties. These are configured as comma separated name value pairs in ehcache.xml
Returns:
a constructed BootstrapCacheLoader

extractBootstrapAsynchronously

protected boolean extractBootstrapAsynchronously(Properties properties)
Extracts the value of bootstrapAsynchronously from the properties

Parameters:
properties - the properties passed by the CacheManager, read from the configuration file
Returns:
true if to be bootstrapped asynchronously, false otherwise

extractBoolean

protected boolean extractBoolean(Properties properties,
                                 String prop,
                                 boolean defaultValue)
Will retrieve the boolean value from the properties, defaulting if property isn't present

Parameters:
properties - the properties to use
prop - the property name to look for
defaultValue - the default value if property is missing
Returns:
the value, or it's default, for the property

extractLong

protected long extractLong(Properties properties,
                           String prop,
                           long defaultValue)
Will retrieve the boolean value from the properties, defaulting if property isn't present

Parameters:
properties - the properties to use
prop - the property name to look for
defaultValue - the default value if property is missing
Returns:
the value, or it's default, for the property

ehcache

Copyright 2001-2015, Terracotta, Inc.