@ThreadSafe public class JDBCCacheLoader extends AdjListJDBCCacheLoader
JDBCCacheLoaderOld also apply for this
implementation.
Additional configuration info: cf, driverName, lock, NULL_NODE_IN_ROWbuddyFqnTransformer, cache, regionManager, transactions| Constructor and Description |
|---|
JDBCCacheLoader() |
| Modifier and Type | Method and Description |
|---|---|
CacheLoaderConfig.IndividualCacheLoaderConfig |
getConfig()
Gets the configuration.
|
protected org.apache.commons.logging.Log |
getLogger() |
int |
getNodeCount()
Returns a number representing the count of persisted children.
|
protected void |
getNodeDataList(Fqn fqn,
List<NodeData> list)
Subscribes to contract.
|
protected AdjListJDBCCacheLoaderConfig |
processConfig(CacheLoaderConfig.IndividualCacheLoaderConfig base)
Builds a AdjListJDBCCacheLoaderConfig based on the supplied base config.
|
void |
put(Fqn name,
Map attributes)
As per interface's contract.
|
Object |
put(Fqn name,
Object key,
Object value)
As per interface's contract.
|
void |
remove(Fqn fqn)
As per interface's contrect.
|
void |
start()
Start is overwritten for the sake of backward compatibility only.
|
void |
storeState(Fqn subtree,
ObjectInputStream in)
Stores the given portion of the cache tree's state in secondary storage.
|
protected void |
storeStateHelper(Fqn subtree,
List nodeData,
boolean moveToBuddy) |
commit, exists, get, getChildrenNames, getDriverName, insertNode, loadNode, marshall, populatePreparedStatementForInsert, prepare, prepareAndLogStatement, remove, removeData, reportAndRethrowError, rollback, safeClose, safeClose, safeClose, setConfig, stop, tableExists, unmarshall, updateNodecreate, destroy, doMarshall, doUnmarshall, getMarshaller, loadEntireState, loadState, loadStateHelper, move, put, put, regionAwareMarshall, regionAwareUnmarshall, setCache, setRegionManager, storeEntireStateprotected AdjListJDBCCacheLoaderConfig processConfig(CacheLoaderConfig.IndividualCacheLoaderConfig base)
processConfig in class AdjListJDBCCacheLoaderpublic Object put(Fqn name, Object key, Object value) throws Exception
Exceptionpublic void put(Fqn name, Map attributes) throws Exception
name - The fully qualified name of the nodeattributes - A Map of attributes. Can be nullExceptionprotected void storeStateHelper(Fqn subtree, List nodeData, boolean moveToBuddy) throws Exception
storeStateHelper in class AbstractCacheLoaderExceptionpublic void remove(Fqn fqn) throws Exception
protected void getNodeDataList(Fqn fqn, List<NodeData> list) throws Exception
getNodeDataList in class AbstractCacheLoaderExceptionprotected org.apache.commons.logging.Log getLogger()
getLogger in class AdjListJDBCCacheLoaderpublic void start()
throws Exception
start in interface Lifecyclestart in class AdjListJDBCCacheLoaderExceptionpublic int getNodeCount()
throws Exception
Exceptionpublic void storeState(Fqn subtree, ObjectInputStream in) throws Exception
CacheLoadersubtree,
then no special behavior is required. Otherwise, ensure that
the state is integrated under the given subtree. Typically
in the latter case subtree would be the Fqn of the buddy
backup region for
a buddy group; e.g.
If the the transferred state had Fqns starting with "/a" and
subtree was "/_BUDDY_BACKUP_/192.168.1.2:5555" then the
state should be stored in the local persistent store under
"/_BUDDY_BACKUP_/192.168.1.2:5555/a"
Implementations of this method should not catch any exception or close the
given ObjectInputStream parameter. In order to ensure cacheloader interoperability
contents of the cache are read from the ObjectInputStream as a sequence of
NodeData objects.
Default implementation is provided by AbstractCacheLoader and ensures cacheloader
interoperability. Implementors are encouraged to consider extending AbstractCacheLoader
prior to implementing completely custom cacheloader.storeState in interface CacheLoaderstoreState in class AbstractCacheLoadersubtree - Fqn naming the root (i.e. highest level parent) node of
the subtree included in state. If the Fqns
of the data included in state are not
already children of subtree, then their
Fqns should be altered to make them children of
subtree before they are persisted.in - ObjectInputStream to read stateExceptionAbstractCacheLoader.storeState(Fqn,ObjectInputStream),
NodeDatapublic CacheLoaderConfig.IndividualCacheLoaderConfig getConfig()
CacheLoaderCacheLoaderConfig.IndividualCacheLoaderConfig object.Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.