|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.cache.loader.JDBCCacheLoader
public class 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()
|
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 |
| Constructor Detail |
|---|
public JDBCCacheLoader()
| Method Detail |
|---|
public void setConfig(java.util.Properties props)
CacheLoaderService.create() and Service.start().
setConfig in interface CacheLoaderprops - a collection of configuration propertiespublic void setCache(TreeCache c)
CacheLoaderTreeCache 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 CacheLoaderc - The cache on which this loader works
public java.util.Set getChildrenNames(Fqn fqn)
throws java.lang.Exception
getChildrenNames in interface CacheLoaderfqn - parent fqn
java.lang.Exception
public java.util.Map get(Fqn name)
throws java.lang.Exception
get in interface CacheLoadername - node's fqn
java.lang.Exception
public boolean exists(Fqn name)
throws java.lang.Exception
exists in interface CacheLoadername - 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 CacheLoadername - 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 CacheLoadername - node's fqnattributes - attributes
java.lang.Exception
public void put(java.util.List modifications)
throws java.lang.Exception
CacheLoader
put in interface CacheLoadermodifications - A Listjava.lang.Exception
public java.lang.Object remove(Fqn name,
java.lang.Object key)
throws java.lang.Exception
remove in interface CacheLoadername - node's namekey - attribute's key
java.lang.Exception
public void remove(Fqn name)
throws java.lang.Exception
remove in interface CacheLoadername - node's fqn
java.lang.Exception
public void removeData(Fqn name)
throws java.lang.Exception
removeData in interface CacheLoadername - 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 CacheLoadertx - 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 CacheLoadertx - the tx to commit
java.lang.Exceptionpublic void rollback(java.lang.Object tx)
rollback in interface CacheLoadertx - the tx to rollback
public byte[] loadEntireState()
throws java.lang.Exception
loadEntireState in interface CacheLoaderjava.lang.Exception
public void storeEntireState(byte[] state)
throws java.lang.Exception
storeEntireState in interface CacheLoaderstate -
java.lang.Exception
public void create()
throws java.lang.Exception
create in interface org.jboss.system.Servicejava.lang.Exception
public void start()
throws java.lang.Exception
start in interface org.jboss.system.Servicejava.lang.Exceptionpublic void stop()
stop in interface org.jboss.system.Servicepublic 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 | |||||||||