|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.loader.JDBCCacheLoader
public class JDBCCacheLoader
JDBC CacheLoader implementation.
This implementation uses one table. The table consists of three columns:
Field Summary | |
---|---|
protected StripedLock |
lock
|
Constructor Summary | |
---|---|
JDBCCacheLoader()
|
Method Summary | |
---|---|
void |
commit(java.lang.Object tx)
Commits a transaction. |
void |
create()
|
void |
destroy()
|
boolean |
exists(Fqn name)
Checks that there is a row for the fqn in the database. |
java.util.Map |
get(Fqn name)
Returns a map representing a node. |
java.util.Set |
getChildrenNames(Fqn fqn)
Fetches child node names (not pathes). |
byte[] |
loadEntireState()
Loads the entire state from the filesystem and returns it as a byte buffer. |
protected void |
loadState(Fqn fqn,
java.io.ObjectOutputStream out)
Do a preorder traversal: visit the node first, then the node's children |
void |
prepare(java.lang.Object tx,
java.util.List modifications,
boolean one_phase)
First phase in transaction commit process. |
void |
put(Fqn name,
java.util.Map attributes)
Adds attributes from the passed in map to the existing node. |
java.lang.Object |
put(Fqn name,
java.lang.Object key,
java.lang.Object value)
Adds/overrides a value in a node for a key. |
void |
put(java.util.List modifications)
Applies all modifications to the backend store. |
void |
remove(Fqn name)
Removes a node and all its children. |
java.lang.Object |
remove(Fqn name,
java.lang.Object key)
Removes attribute's value for a key. |
void |
removeData(Fqn name)
Nullifies the node. |
void |
rollback(java.lang.Object tx)
Rolls back a transaction. |
void |
setCache(TreeCache c)
Sets the TreeCache that is maintaining this CacheLoader. |
void |
setConfig(java.util.Properties props)
Sets the configuration. |
void |
start()
|
void |
stop()
|
void |
storeEntireState(byte[] state)
Store the state given as a byte buffer to the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected StripedLock lock
Constructor Detail |
---|
public JDBCCacheLoader()
Method Detail |
---|
public void setConfig(java.util.Properties props)
CacheLoader
Service.create()
and Service.start()
.
setConfig
in interface CacheLoader
props
- a collection of configuration propertiespublic void setCache(TreeCache c)
CacheLoader
TreeCache
that is maintaining this CacheLoader.
This method allows this CacheLoader to invoke methods on TreeCache,
including fetching additional configuration information. This method is
called be called after the CacheLoader instance has been constructed.
setCache
in interface CacheLoader
c
- The cache on which this loader workspublic java.util.Set getChildrenNames(Fqn fqn) throws java.lang.Exception
getChildrenNames
in interface CacheLoader
fqn
- parent fqn
java.lang.Exception
public java.util.Map get(Fqn name) throws java.lang.Exception
get
in interface CacheLoader
name
- node's fqn
java.lang.Exception
public boolean exists(Fqn name) throws java.lang.Exception
exists
in interface CacheLoader
name
- node's fqn
java.lang.Exception
public java.lang.Object put(Fqn name, java.lang.Object key, java.lang.Object value) throws java.lang.Exception
put
in interface CacheLoader
name
- node's fqnkey
- attribute's keyvalue
- attribute's value
java.lang.Exception
public void put(Fqn name, java.util.Map attributes) throws java.lang.Exception
put
in interface CacheLoader
name
- node's fqnattributes
- attributes
java.lang.Exception
public void put(java.util.List modifications) throws java.lang.Exception
CacheLoader
put
in interface CacheLoader
modifications
- A Listjava.lang.Exception
public java.lang.Object remove(Fqn name, java.lang.Object key) throws java.lang.Exception
remove
in interface CacheLoader
name
- node's namekey
- attribute's key
java.lang.Exception
public void remove(Fqn name) throws java.lang.Exception
remove
in interface CacheLoader
name
- node's fqn
java.lang.Exception
public void removeData(Fqn name) throws java.lang.Exception
removeData
in interface CacheLoader
name
- node's fqn
java.lang.Exception
public void prepare(java.lang.Object tx, java.util.List modifications, boolean one_phase) throws java.lang.Exception
prepare
in interface CacheLoader
tx
- something representing transactionmodifications
- a list of modificationsone_phase
- indicates whether it's one or two phase commit transaction
java.lang.Exception
public void commit(java.lang.Object tx) throws java.lang.Exception
commit
in interface CacheLoader
tx
- the tx to commit
java.lang.Exception
public void rollback(java.lang.Object tx)
rollback
in interface CacheLoader
tx
- the tx to rollbackpublic byte[] loadEntireState() throws java.lang.Exception
loadEntireState
in interface CacheLoader
java.lang.Exception
public void storeEntireState(byte[] state) throws java.lang.Exception
storeEntireState
in interface CacheLoader
state
-
java.lang.Exception
public void create() throws java.lang.Exception
create
in interface org.jboss.system.Service
java.lang.Exception
public void start() throws java.lang.Exception
start
in interface org.jboss.system.Service
java.lang.Exception
public void stop()
stop
in interface org.jboss.system.Service
public void destroy()
destroy
in interface org.jboss.system.Service
protected void loadState(Fqn fqn, java.io.ObjectOutputStream out) throws java.lang.Exception
fqn
- Start nodeout
-
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |