|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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(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. |
Map |
get(Fqn name)
Returns a map representing a node. |
Object |
get(Fqn name,
Object key)
Loads an attribute from the database. |
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. |
void |
prepare(Object tx,
List modifications,
boolean one_phase)
First phase in transaction commit process. |
void |
put(Fqn name,
Map attributes)
Adds attributes from the passed in map to the existing node. |
Object |
put(Fqn name,
Object key,
Object value)
Adds/overrides a value in a node for a key. |
void |
put(List modifications)
Inserts all modifications to the backend store. |
void |
remove(Fqn name)
Removes a node and all its children. |
Object |
remove(Fqn name,
Object key)
Removes attribute's value for a key. |
void |
removeData(Fqn name)
Nullifies the node. |
void |
rollback(Object tx)
Rolls back a transaction. |
void |
setCache(TreeCache c)
This method allows the CacheLoader to set the TreeCache, therefore allowing the CacheLoader to invoke methods of the TreeCache. |
void |
setConfig(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(Properties props)
CacheLoader
Service.create()
and Service.start()
setConfig
in interface CacheLoader
props
- A list of properties, defined in the XML filepublic void setCache(TreeCache c)
CacheLoader
setCache
in interface CacheLoader
c
- The cache on which this loader workspublic Set getChildrenNames(Fqn fqn) throws Exception
getChildrenNames
in interface CacheLoader
fqn
- parent fqn
Exception
public Object get(Fqn name, Object key) throws Exception
get
in interface CacheLoader
name
- node's fqnkey
- attribute's key
Exception
public Map get(Fqn name) throws Exception
get
in interface CacheLoader
name
- node's fqn
Exception
public boolean exists(Fqn name) throws Exception
exists
in interface CacheLoader
name
- node's fqn
Exception
public Object put(Fqn name, Object key, Object value) throws Exception
put
in interface CacheLoader
name
- node's fqnkey
- attribute's keyvalue
- attribute's value
Exception
public void put(Fqn name, Map attributes) throws Exception
put
in interface CacheLoader
name
- node's fqnattributes
- attributes
Exception
public void put(List modifications) throws Exception
CacheLoader
put
in interface CacheLoader
modifications
- A ListException
public Object remove(Fqn name, Object key) throws Exception
remove
in interface CacheLoader
name
- node's namekey
- attribute's key
Exception
public void remove(Fqn name) throws Exception
remove
in interface CacheLoader
name
- node's fqn
Exception
public void removeData(Fqn name) throws Exception
removeData
in interface CacheLoader
name
- node's fqn
Exception
public void prepare(Object tx, List modifications, boolean one_phase) throws Exception
prepare
in interface CacheLoader
tx
- something representing transactionmodifications
- a list of modificationsone_phase
- indicates whether it's one or two phase commit transaction
Exception
public void commit(Object tx) throws Exception
commit
in interface CacheLoader
tx
- the tx to commit
Exception
public void rollback(Object tx)
rollback
in interface CacheLoader
tx
- the tx to rollbackpublic byte[] loadEntireState() throws Exception
loadEntireState
in interface CacheLoader
Exception
public void storeEntireState(byte[] state) throws Exception
storeEntireState
in interface CacheLoader
state
-
Exception
public void create() throws Exception
create
in interface org.jboss.system.Service
Exception
public void start() throws Exception
start
in interface org.jboss.system.Service
Exception
public void stop()
stop
in interface org.jboss.system.Service
public void destroy()
destroy
in interface org.jboss.system.Service
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |