|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.cache.loader.JDBCCacheLoader
JDBC CacheLoader implementation.
This implementation uses one table. The table consists of three columns:
Constructor Summary | |
JDBCCacheLoader()
|
Method Summary | |
void |
commit(java.lang.Object tx)
Commits a transaction. |
void |
create()
create the service, do expensive operations etc |
void |
destroy()
destroy the service, tear down |
boolean |
exists(Fqn (src) name)
Checks that there is a row for the fqn in the database. |
java.util.Map |
get(Fqn (src) name)
Returns a map representing a node. |
java.lang.Object |
get(Fqn (src) name,
java.lang.Object key)
Loads an attribute from the database. |
java.util.Set |
getChildrenNames(Fqn (src) fqn)
Fetches child node names (not pathes). |
byte[] |
loadEntireState()
Loads the entire state from the filesystem and returns it as a byte buffer. |
void |
prepare(java.lang.Object tx,
java.util.List modifications,
boolean one_phase)
First phase in transaction commit process. |
void |
put(Fqn (src) name,
java.util.Map attributes)
Adds attributes from the passed in map to the existing node. |
java.lang.Object |
put(Fqn (src) 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)
Inserts all modifications to the backend store. |
void |
remove(Fqn (src) name)
Removes a node and all its children. |
java.lang.Object |
remove(Fqn (src) name,
java.lang.Object key)
Removes attribute's value for a key. |
void |
removeData(Fqn (src) name)
Nullifies the node. |
void |
rollback(java.lang.Object tx)
Rolls back a transaction. |
void |
setCache(TreeCache (src) c)
This method allows the CacheLoader to set the TreeCache, therefore allowing the CacheLoader to invoke methods of the TreeCache. |
void |
setConfig(java.util.Properties props)
Sets the configuration. |
void |
start()
start the service, create is already called |
void |
stop()
stop the service |
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 |
Constructor Detail |
public JDBCCacheLoader()
Method Detail |
public void setConfig(java.util.Properties props)
CacheLoader (src)
Service.create()
and Service.start()
setConfig
in interface CacheLoader (src)
props
- A list of properties, defined in the XML filepublic void setCache(TreeCache (src) c)
CacheLoader (src)
setCache
in interface CacheLoader (src)
c
- The cache on which this loader workspublic java.util.Set getChildrenNames(Fqn (src) fqn) throws java.lang.Exception
getChildrenNames
in interface CacheLoader (src)
fqn
- parent fqn
java.lang.Exception
public java.lang.Object get(Fqn (src) name, java.lang.Object key) throws java.lang.Exception
get
in interface CacheLoader (src)
name
- node's fqnkey
- attribute's key
java.lang.Exception
public java.util.Map get(Fqn (src) name) throws java.lang.Exception
get
in interface CacheLoader (src)
name
- node's fqn
java.lang.Exception
public boolean exists(Fqn (src) name) throws java.lang.Exception
exists
in interface CacheLoader (src)
name
- node's fqn
java.lang.Exception
public java.lang.Object put(Fqn (src) name, java.lang.Object key, java.lang.Object value) throws java.lang.Exception
put
in interface CacheLoader (src)
name
- node's fqnkey
- attribute's keyvalue
- attribute's value
java.lang.Exception
public void put(Fqn (src) name, java.util.Map attributes) throws java.lang.Exception
put
in interface CacheLoader (src)
name
- node's fqnattributes
- attributes
java.lang.Exception
public void put(java.util.List modifications) throws java.lang.Exception
CacheLoader (src)
put
in interface CacheLoader (src)
modifications
- A Listjava.lang.Exception
public java.lang.Object remove(Fqn (src) name, java.lang.Object key) throws java.lang.Exception
remove
in interface CacheLoader (src)
name
- node's namekey
- attribute's key
java.lang.Exception
public void remove(Fqn (src) name) throws java.lang.Exception
remove
in interface CacheLoader (src)
name
- node's fqn
java.lang.Exception
public void removeData(Fqn (src) name) throws java.lang.Exception
removeData
in interface CacheLoader (src)
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 (src)
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 (src)
tx
- the tx to commit
java.lang.Exception
public void rollback(java.lang.Object tx)
rollback
in interface CacheLoader (src)
tx
- the tx to rollbackpublic byte[] loadEntireState() throws java.lang.Exception
loadEntireState
in interface CacheLoader (src)
java.lang.Exception
public void storeEntireState(byte[] state) throws java.lang.Exception
storeEntireState
in interface CacheLoader (src)
state
-
java.lang.Exception
public void create() throws java.lang.Exception
Service (src)
create
in interface Service (src)
java.lang.Exception
public void start() throws java.lang.Exception
Service (src)
start
in interface Service (src)
java.lang.Exception
public void stop()
Service (src)
stop
in interface Service (src)
public void destroy()
Service (src)
destroy
in interface Service (src)
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |