electric.util.dictionary.transactional
Class TransactionalDictionary
java.lang.Object
java.util.Dictionary
electric.util.dictionary.transactional.TransactionalDictionary
- public class TransactionalDictionary
- extends java.util.Dictionary
TransactionalDictionary is a subclass of Dictionary that
supports multi-threaded transactions. An operation such as put() or
remove() that occurs outside of a transaction is committed immediately.
When a thread performs an operation inside of a transaction for the
first time, a View is created that provides a view onto the
underlying TransactionDictionary and that caches uncommitted operations.
If the transaction is rolled back, the View is discarded.
If the transaction is committed, the View commits the cached
uncommitted operations, thus updating the underlying TransactionalDictionary.
- Author:
- webMethods
Method Summary |
void |
clear()
|
void |
delete()
|
java.util.Enumeration |
elements()
|
java.lang.Object |
get(java.lang.Object key)
|
boolean |
getEncoded()
Return true if I use an EncodedWriter to persist objects to storage. |
IPersistentDictionary |
getPersistentDictionary()
|
java.lang.String |
getRoot()
|
boolean |
getSync()
|
boolean |
isEmpty()
|
java.util.Enumeration |
keys()
|
java.lang.Object |
load(java.lang.Object key)
|
java.lang.Object |
peek(java.lang.Object key)
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
java.lang.Object |
remove(java.lang.Object key)
|
void |
setEncoded(boolean encoded)
If the encoded argument is true, use an EncodedWriter to persist
objects to storage, otherwise use a LiteralWriter. |
void |
setSync(boolean flag)
|
int |
size()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TransactionalDictionary
public TransactionalDictionary(java.lang.String root)
- Parameters:
root
-
TransactionalDictionary
public TransactionalDictionary(java.lang.String root,
boolean delete)
- Parameters:
root
- delete
-
TransactionalDictionary
public TransactionalDictionary(java.lang.String root,
boolean delete,
boolean lazy)
- Parameters:
root
- delete
- lazy
-
TransactionalDictionary
public TransactionalDictionary(IPersistentDictionary persistentDictionary)
- Parameters:
persistentDictionary
-
toString
public java.lang.String toString()
getRoot
public java.lang.String getRoot()
get
public java.lang.Object get(java.lang.Object key)
- Parameters:
key
-
put
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
- Parameters:
key
- value
-
remove
public java.lang.Object remove(java.lang.Object key)
- Parameters:
key
-
size
public int size()
isEmpty
public boolean isEmpty()
keys
public java.util.Enumeration keys()
elements
public java.util.Enumeration elements()
clear
public void clear()
delete
public void delete()
load
public java.lang.Object load(java.lang.Object key)
- Parameters:
key
-
peek
public java.lang.Object peek(java.lang.Object key)
- Parameters:
key
-
setSync
public void setSync(boolean flag)
- Parameters:
flag
-
getSync
public boolean getSync()
getPersistentDictionary
public IPersistentDictionary getPersistentDictionary()
getEncoded
public boolean getEncoded()
- Return true if I use an EncodedWriter to persist objects to storage.
setEncoded
public void setEncoded(boolean encoded)
- If the encoded argument is true, use an EncodedWriter to persist
objects to storage, otherwise use a LiteralWriter.
- Parameters:
encoded
- The new encoded mode.
copyright© 2001-2004 by webMethods All Rights Reserved.