cziegeler 2003/08/28 05:40:28
Modified: store/src/java/org/apache/excalibur/store/impl
MemoryStore.java
Log:
The hashtable is already synced
Revision Changes Path
1.8 +23 -26
avalon-excalibur/store/src/java/org/apache/excalibur/store/impl/MemoryStore.java
Index: MemoryStore.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/store/src/java/org/apache/excalibur/store/impl/MemoryStore.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- MemoryStore.java 20 May 2003 21:03:39 -0000 1.7
+++ MemoryStore.java 28 Aug 2003 12:40:28 -0000 1.8
@@ -82,13 +82,14 @@
*/
/** The shared store */
- private Hashtable table = new Hashtable();
+ protected Hashtable m_table = new Hashtable();
/**
* Get the object associated to the given unique key.
*/
- public synchronized Object get(Object key) {
- return(table.get(key));
+ public Object get(Object key)
+ {
+ return m_table.get(key);
}
/**
@@ -96,55 +97,51 @@
* caller to ensure that the key has a persistent state across
* different JVM executions.
*/
- public synchronized void store(Object key, Object value) {
- this.hold(key,value);
- }
-
- /**
- * Holds the given object in a volatile state. This means
- * the object store will discard held objects if the
- * virtual machine is restarted or some error happens.
- */
- public synchronized void hold(Object key, Object value) {
- table.put(key,value);
+ public void store(Object key, Object value)
+ {
+ m_table.put(key,value);
}
/**
* Remove the object associated to the given key.
*/
- public synchronized void remove(Object key) {
- table.remove(key);
+ public void remove(Object key)
+ {
+ m_table.remove(key);
}
/**
* Clear the Store of all elements
*/
- public synchronized void clear() {
- table.clear();
+ public void clear()
+ {
+ m_table.clear();
}
- public synchronized void free() {}
+ public void free() {}
/**
* Indicates if the given key is associated to a contained object.
*/
- public synchronized boolean containsKey(Object key) {
- return(table.containsKey(key));
+ public boolean containsKey(Object key)
+ {
+ return m_table.containsKey(key);
}
/**
* Returns the list of used keys as an Enumeration of Objects.
*/
- public synchronized Enumeration keys() {
- return(table.keys());
+ public Enumeration keys()
+ {
+ return m_table.keys();
}
/**
* Returns count of the objects in the store, or -1 if could not be
* obtained.
*/
- public synchronized int size()
+ public int size()
{
- return table.size();
+ return m_table.size();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]