|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectledge.cache.DefaultCacheFactory
public class DefaultCacheFactory
DefaultCacheFactory component.
An instance declaration is a list of map layer declarations.
A map layer declaration is composed of a map type name (both
standard and custom types may be used) and a pair of parentheses. Optional
configuration string may be placed betweene the parens. The meaning of the
string is depenant upon the implementation class. If there is a non-empty
configuration string, the map implementation is required to support ConfigurableMap interface. Layers declared first are the deeper than those
declared later. The implemenation of map types used on layers deeper than
layer one are required to support LayeredMap interface. The layer
number n becomes the delegate of the layer n+1.
| Nested Class Summary | |
|---|---|
private class |
DefaultCacheFactory.DelayedUpdateTask
The task that performs delayed updates. |
| Field Summary | |
|---|---|
private org.jcontainer.dna.Configuration |
config
The configuration |
static String |
DISTRIBUTED_MAP_CLASS_DEFALUT
The default implementation DistributedMap implementation. |
static String |
DISTRIBUTED_MAP_TYPE
Type constant for DistributedMap. |
static String |
FACTORY_MAP_CLASS_DEFALUT
The default implementation FactoryMap implementation. |
static String |
FACTORY_MAP_TYPE
Type constant for FactoryMap. |
private Map<String,org.jcontainer.dna.Configuration> |
factoryConfigurations
Factory configurations |
static String |
FORGETFULL_MAP_CLASS_DEFALUT
The default implementation StatisticsMap implementation. |
static String |
FORGETFULL_MAP_TYPE
Type constant for ForgetFullMap. |
static String |
HASH_MAP_CLASS_DEFALUT
The default implementation HashMap implementation. |
static String |
HASH_MAP_TYPE
Type constant for HashMap. |
private Map<String,Class> |
implClasses
Mapping of *_TYPE constants into configured implementation classes. |
private Map<String,org.jcontainer.dna.Configuration> |
instanceConfigurations
instance prepared configurations map. |
private Map<String,Map> |
instances
Configured map instances. |
private org.jcontainer.dna.Logger |
logger
The logging facility. |
static String |
LRU_MAP_CLASS_DEFALUT
The default implementation LRUMap implementation. |
static String |
LRU_MAP_TYPE
Type constant for LRUMap. |
private Notification |
notification
The notification |
private Persistence |
persistence
The persistence |
private SortedMap<Long,Set<DelayedUpdate>> |
queue
DelayedUpdate queue (target update time -> object) |
private Map<DelayedUpdate,Long> |
queueHelper
DelayedUpdate queue helper map (object -> target update time) |
static String |
SOFT_MAP_CLASS_DEFALUT
The default implementation SoftMap implementation. |
static String |
SOFT_MAP_TYPE
Type constant for SoftMap. |
private List<StatisticsMap> |
statistics
The registered StatisticsMaps |
static String |
STATISTICS_MAP_CLASS_DEFALUT
The default implementation StatisticsMap implementation. |
static String |
STATISTICS_MAP_TYPE
Type constant for StatisticsMap. |
private ThreadPool |
threadPool
The thread pool |
static String |
TIMEOUT_MAP_CLASS_DEFALUT
The default implementation TimeoutMap implementation. |
static String |
TIMEOUT_MAP_TYPE
Type constant for TimeoutMap. |
| Constructor Summary | |
|---|---|
DefaultCacheFactory(org.jcontainer.dna.Configuration config,
org.jcontainer.dna.Logger logger,
ThreadPool threadPool,
Notification notification,
Persistence persistence)
Component constructor. |
|
| Method Summary | |
|---|---|
void |
addStatisticsMap(StatisticsMap map)
Adds an statistics map the the service's registry. |
private Map |
buildInstance(String name,
org.jcontainer.dna.Configuration conf)
Creates a new configurable map instance. |
DistributedMap |
getDistributedMap(String name,
Map delegate)
|
Map |
getFactoryMap(ValueFactory factory,
Map delegate)
|
Map |
getHashMap()
|
Map |
getInstance(String name)
|
Map |
getInstance(String name,
String configAlias)
|
Map |
getLRUMap(int capacity)
|
Map |
getMap(String type)
Get the map. |
Notification |
getNotification()
Get the notification system. |
Persistence |
getPersistence()
Get the persistence system. |
ValueFactory |
getPersitenceValueFactory(Class valueClass)
|
Map |
getSoftMap(int protect)
|
Map |
getStatisticsMap(String name,
Map delegate)
|
void |
getStatus(PrintWriter out)
Prints the report on the specified PrintWriter. |
Map |
getTimeoutMap(long timeoutMillis)
|
ValueFactory |
getValueFactory(String factory,
String map)
|
private void |
initImpl(String type,
String className,
Class iface)
Initializes an entry in the implClasses map. |
void |
register(DelayedUpdate object)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String HASH_MAP_TYPE
public static final String TIMEOUT_MAP_TYPE
public static final String LRU_MAP_TYPE
public static final String SOFT_MAP_TYPE
public static final String FACTORY_MAP_TYPE
public static final String DISTRIBUTED_MAP_TYPE
public static final String STATISTICS_MAP_TYPE
public static final String FORGETFULL_MAP_TYPE
public static final String HASH_MAP_CLASS_DEFALUT
public static final String TIMEOUT_MAP_CLASS_DEFALUT
public static final String LRU_MAP_CLASS_DEFALUT
public static final String SOFT_MAP_CLASS_DEFALUT
public static final String DISTRIBUTED_MAP_CLASS_DEFALUT
public static final String FACTORY_MAP_CLASS_DEFALUT
public static final String STATISTICS_MAP_CLASS_DEFALUT
public static final String FORGETFULL_MAP_CLASS_DEFALUT
private List<StatisticsMap> statistics
private Map<String,Class> implClasses
private Map<String,org.jcontainer.dna.Configuration> instanceConfigurations
private Map<String,org.jcontainer.dna.Configuration> factoryConfigurations
private Map<String,Map> instances
private SortedMap<Long,Set<DelayedUpdate>> queue
private Map<DelayedUpdate,Long> queueHelper
private org.jcontainer.dna.Configuration config
private org.jcontainer.dna.Logger logger
private ThreadPool threadPool
private Notification notification
private Persistence persistence
| Constructor Detail |
|---|
public DefaultCacheFactory(org.jcontainer.dna.Configuration config,
org.jcontainer.dna.Logger logger,
ThreadPool threadPool,
Notification notification,
Persistence persistence)
throws org.jcontainer.dna.ConfigurationException,
ClassNotFoundException
config - the configuration.logger - the logger.threadPool - the thread pool.notification - the notification.persistence - the persistence.
org.jcontainer.dna.ConfigurationException - thrown if configuration is invalid.
ClassNotFoundException - thrown if one of the class not found.| Method Detail |
|---|
public Map getMap(String type)
getMap in interface CacheFactorytype - the type.
public Map getInstance(String name)
getInstance in interface CacheFactory
public Map getInstance(String name,
String configAlias)
throws org.jcontainer.dna.ConfigurationException
getInstance in interface CacheFactoryorg.jcontainer.dna.ConfigurationException
public ValueFactory getValueFactory(String factory,
String map)
getValueFactory in interface CacheFactorypublic Map getHashMap()
getHashMap in interface CacheFactorypublic Map getTimeoutMap(long timeoutMillis)
getTimeoutMap in interface CacheFactorypublic Map getLRUMap(int capacity)
getLRUMap in interface CacheFactorypublic Map getSoftMap(int protect)
getSoftMap in interface CacheFactory
public DistributedMap getDistributedMap(String name,
Map delegate)
getDistributedMap in interface CacheFactory
public Map getFactoryMap(ValueFactory factory,
Map delegate)
getFactoryMap in interface CacheFactory
public Map getStatisticsMap(String name,
Map delegate)
getStatisticsMap in interface CacheFactorypublic ValueFactory getPersitenceValueFactory(Class valueClass)
getPersitenceValueFactory in interface CacheFactorypublic void register(DelayedUpdate object)
register in interface CacheFactorypublic void getStatus(PrintWriter out)
getStatus in interface CacheFactoryout - the PrintWriter to print report into.public void addStatisticsMap(StatisticsMap map)
addStatisticsMap in interface CacheFactorySPImap - the mappublic Notification getNotification()
getNotification in interface CacheFactorySPIpublic Persistence getPersistence()
getPersistence in interface CacheFactorySPI
private void initImpl(String type,
String className,
Class iface)
throws ClassNotFoundException
implClasses map.
type - the map type.className - the implementation class name.iface - the interface the implementation class must support.
ClassNotFoundException - if class couldn't be found.
private Map buildInstance(String name,
org.jcontainer.dna.Configuration conf)
throws org.jcontainer.dna.ConfigurationException
name - instance's name.conf - inststance's configuration elements.
org.jcontainer.dna.ConfigurationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||