|
||||||||||
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.jdbm.JdbmCacheLoader
@ThreadSafe public class JdbmCacheLoader
A persistent CacheLoader
based on the JDBM project.
See http://jdbm.sourceforge.net/ .
Does not support transaction isolation.
The configuration string format is:
environmentDirectoryName[#databaseName]
where databaseName, if omitted, defaults to the ClusterName property of the Cache.
Data is sorted out like:/ = N /node1 = N /node1/K/k1 = v1 /node1/K/k2 = v2 /node2 = N /node2/node3 = N /node2/node3/K/k1 = v1 /node2/node3/K/k2 = v2 /node2/node4 = NN represents a node, K represents a key block. k and v represent key/value pairs. The browse operations lock the entire tree; eventually the JDBM team plans to fix this.
Field Summary |
---|
Fields inherited from class org.jboss.cache.loader.AbstractCacheLoader |
---|
buddyFqnTransformer, cache, regionManager, transactions |
Constructor Summary | |
---|---|
JdbmCacheLoader()
|
Method Summary | |
---|---|
void |
create()
|
void |
dump()
Dumps the tree to debug. |
void |
dump(java.lang.Object key)
Dumps the tree past the key to debug. |
boolean |
exists(Fqn name)
Returns whether the given node exists. |
java.util.Map |
get(Fqn name)
Returns a map containing all key-value pairs for the given FQN, or null if the node is not present. |
CacheLoaderConfig.IndividualCacheLoaderConfig |
getConfig()
Gets the configuration. |
java.util.Set<?> |
getChildrenNames(Fqn name)
Returns an unmodifiable set of relative children names, or returns null if the parent node is not found or if no children are found. |
protected void |
checkNonNull(java.lang.Object param,
java.lang.String paramName)
Throws an exception if the parameter is null. |
protected void |
checkNotOpen()
Throws an exception if the environment is not open. |
void |
put(Fqn name,
java.util.Map values)
Stores a map of key-values for a given FQN, but does not delete existing key-value pairs (that is, it does not erase). |
java.lang.Object |
put(Fqn name,
java.lang.Object key,
java.lang.Object value)
Stores a single FQN-key-value record. |
void |
put(java.util.List<Modification> modifications)
Applies the given modifications. |
void |
remove(Fqn name)
Deletes the node for a given FQN and all its descendent nodes. |
java.lang.Object |
remove(Fqn name,
java.lang.Object key)
Deletes a single FQN-key-value record. |
void |
removeData(Fqn name)
Clears the map for the given node, but does not remove the node. |
void |
setCache(CacheSPI c)
Sets the CacheImpl owner of this cache loader. |
void |
setConfig(CacheLoaderConfig.IndividualCacheLoaderConfig base)
Sets the configuration string for this cache loader. |
int |
size()
Returns the number of database record nodes. |
void |
start()
Opens the environment and the database specified by the configuration string. |
void |
stop()
Closes the databases and environment, and nulls references to them. |
java.lang.String |
toString()
|
Methods inherited from class org.jboss.cache.loader.AbstractCacheLoader |
---|
commit, destroy, doMarshall, doUnmarshall, getMarshaller, getNodeDataList, loadEntireState, loadState, loadStateHelper, move, prepare, put, regionAwareMarshall, regionAwareUnmarshall, rollback, setRegionManager, storeEntireState, storeState, storeStateHelper |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JdbmCacheLoader()
Method Detail |
---|
public void create() throws java.lang.Exception
create
in interface Lifecycle
create
in class AbstractCacheLoader
java.lang.Exception
public void start() throws java.lang.Exception
start
in interface Lifecycle
start
in class AbstractCacheLoader
java.lang.Exception
public void stop()
stop
in interface Lifecycle
stop
in class AbstractCacheLoader
public void setConfig(CacheLoaderConfig.IndividualCacheLoaderConfig base)
base
- May be an instance of the CacheLoaderConfig.IndividualCacheLoaderConfig
base
class, in which case the cache loader should use the
PluggableConfigurationComponent.getProperties()
method to find configuration information. Alternatively,
may be a type-specific subclass of CacheLoaderConfig.IndividualCacheLoaderConfig
,
if there is one.public CacheLoaderConfig.IndividualCacheLoaderConfig getConfig()
CacheLoader
CacheLoaderConfig.IndividualCacheLoaderConfig
object.public void setCache(CacheSPI c)
setCache
in interface CacheLoader
setCache
in class AbstractCacheLoader
c
- The cache on which this loader workspublic java.util.Set<?> getChildrenNames(Fqn name) throws java.io.IOException
name
- The Fqn
of the parent
java.io.IOException
public java.util.Map get(Fqn name) throws java.lang.Exception
name
- the Fqn
to search for.
public boolean exists(Fqn name) throws java.io.IOException
java.io.IOException
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 values) throws java.lang.Exception
name
- The fully qualified name of the nodevalues
- A Map of attributes. Can be null
java.lang.Exception
public void put(java.util.List<Modification> modifications) throws java.lang.Exception
put
in interface CacheLoader
put
in class AbstractCacheLoader
modifications
- A Listjava.lang.Exception
public void remove(Fqn name) throws java.io.IOException
name
- the Fqn
of the node
java.io.IOException
public java.lang.Object remove(Fqn name, java.lang.Object key) throws java.lang.Exception
java.lang.Exception
public void removeData(Fqn name) throws java.lang.Exception
name
- the Fqn
of the node
java.lang.Exception
protected void checkNotOpen()
protected void checkNonNull(java.lang.Object param, java.lang.String paramName)
public void dump() throws java.io.IOException
java.io.IOException
public void dump(java.lang.Object key) throws java.io.IOException
java.io.IOException
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |