|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.cache.loader.AbstractCacheLoader
org.jboss.cache.loader.AdjListJDBCCacheLoader
org.jboss.cache.loader.JDBCCacheLoader
@ThreadSafe public class JDBCCacheLoader
JDBC implementation of AdjListJDBCCacheLoader.
Represents a faster alternative than JDBCCacheLoaderOld and relies on the same database structrure.
It is backward compatible with data created by existing JDBCCacheLoaderOld implemetation.
All configuration elements described there JDBCCacheLoaderOld also apply for this
implementation.
| Field Summary |
|---|
| Fields inherited from class org.jboss.cache.loader.AdjListJDBCCacheLoader |
|---|
cf, driverName, lock, NULL_NODE_IN_ROW |
| Fields inherited from class org.jboss.cache.loader.AbstractCacheLoader |
|---|
buddyFqnTransformer, cache, regionManager, transactions |
| Constructor Summary | |
|---|---|
JDBCCacheLoader()
|
|
| Method Summary | |
|---|---|
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,
java.util.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,
java.util.Map attributes)
As per interface's contract. |
java.lang.Object |
put(Fqn name,
java.lang.Object key,
java.lang.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,
java.io.ObjectInputStream in)
Stores the given portion of the cache tree's state in secondary storage. |
protected void |
storeStateHelper(Fqn subtree,
java.util.List nodeData,
boolean moveToBuddy)
|
| Methods inherited from class org.jboss.cache.loader.AdjListJDBCCacheLoader |
|---|
commit, exists, get, getDriverName, getChildrenNames, insertNode, loadNode, marshall, populatePreparedStatementForInsert, prepare, prepareAndLogStatement, remove, removeData, reportAndRethrowError, rollback, safeClose, safeClose, safeClose, setConfig, stop, tableExists, unmarshall, updateNode |
| Methods inherited from class org.jboss.cache.loader.AbstractCacheLoader |
|---|
create, destroy, doMarshall, doUnmarshall, getMarshaller, loadEntireState, loadState, loadStateHelper, move, put, put, regionAwareMarshall, regionAwareUnmarshall, setCache, setRegionManager, storeEntireState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JDBCCacheLoader()
| Method Detail |
|---|
protected AdjListJDBCCacheLoaderConfig processConfig(CacheLoaderConfig.IndividualCacheLoaderConfig base)
processConfig in class AdjListJDBCCacheLoader
public java.lang.Object put(Fqn name,
java.lang.Object key,
java.lang.Object value)
throws java.lang.Exception
java.lang.Exception
public void put(Fqn name,
java.util.Map attributes)
throws java.lang.Exception
name - The fully qualified name of the nodeattributes - A Map of attributes. Can be null
java.lang.Exception
protected void storeStateHelper(Fqn subtree,
java.util.List nodeData,
boolean moveToBuddy)
throws java.lang.Exception
storeStateHelper in class AbstractCacheLoaderjava.lang.Exception
public void remove(Fqn fqn)
throws java.lang.Exception
fqn - the Fqn of the node
java.lang.Exception
protected void getNodeDataList(Fqn fqn,
java.util.List<NodeData> list)
throws java.lang.Exception
getNodeDataList in class AbstractCacheLoaderjava.lang.Exceptionprotected org.apache.commons.logging.Log getLogger()
getLogger in class AdjListJDBCCacheLoader
public void start()
throws java.lang.Exception
start in interface Lifecyclestart in class AdjListJDBCCacheLoaderjava.lang.Exception
public int getNodeCount()
throws java.lang.Exception
java.lang.Exception
public void storeState(Fqn subtree,
java.io.ObjectInputStream in)
throws java.lang.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 state
java.lang.ExceptionAbstractCacheLoader.storeState(Fqn,ObjectInputStream),
NodeDatapublic CacheLoaderConfig.IndividualCacheLoaderConfig getConfig()
CacheLoader
CacheLoaderConfig.IndividualCacheLoaderConfig object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||