|
Servertec Persistent Object Store 1.4.1 09/04/2005 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstec.xpos.ObjectStoreReference
public final class ObjectStoreReference
Handle to the persistent object store returned by ObjectStore.open() used to interface with the opened persistent object store.
Persistent object stores are simular to java.util.Hashtables, except they do not reside in memory, but on storage media and are not automaically rehashed.
open
,
Hashtable
Method Summary | |
---|---|
void |
clear()
Removes all the keys and associated values from the persistent object store. |
void |
close()
Closes this handle to the persistent object store. |
boolean |
containsKey(java.lang.Object key)
Returns whether the persistent object store contains the specified key associated with any value. |
boolean |
containsValue(java.lang.Object value)
Returns whether the persistent object store contains the specified object associated with any key. |
ObjectStoreEnumeration |
elements()
Returns an ObjectStoreEnumeration of the values in the persistent object store. |
ObjectStoreEnumeration |
elements(boolean with_locking)
Returns an ObjectStoreEnumeration of the values in the persistent object store. |
ObjectStoreEnumeration |
elements(ObjectStoreEnumerationFilter filter)
Returns an ObjectStoreEnumeration of the values in the persistent object store. |
ObjectStoreEnumeration |
elements(ObjectStoreEnumerationFilter filter,
boolean with_locking)
Returns an ObjectStoreEnumeration of the values in the persistent object store. |
java.lang.Object |
get(java.lang.Object key)
Returns the object associated with the specified key from the persistent object store. |
java.lang.String |
getFilename()
Returns the filename of the store this reference references. |
ObjectStoreInputStream |
getInputStream(java.lang.Object key)
Returns an ObjectStoreInputStream for the specified key. |
ObjectStoreOutputStream |
getOutputStream(java.lang.Object key)
Returns an ObjectStoreOutputStream for the specified key. |
ObjectStoreOutputStream |
getOutputStream(java.lang.Object key,
int type,
boolean append)
Returns an ObjectStoreOutputStream for the specified key. |
ObjectStoreOutputStream |
getOutputStream(java.lang.Object key,
java.lang.String class_name,
boolean append)
Returns an ObjectStoreOutputStream for the specified key. |
ObjectStoreRandomAccessStream |
getRandomAccessStream(java.lang.Object key,
boolean read_only)
Returns an ObjectStoreRandomAccessStream for the specified key. |
ObjectStoreRandomAccessStream |
getRandomAccessStream(java.lang.Object key,
int type,
boolean read_only)
Returns an ObjectStoreRandomAccessStream for the specified key. |
ObjectStoreRandomAccessStream |
getRandomAccessStream(java.lang.Object key,
java.lang.String class_name,
boolean read_only)
Returns an ObjectStoreRandomAccessStream for the specified key. |
boolean |
iLocked(java.lang.Object key)
Returns whether the current ObjectStoreReference has locked the specified key. |
boolean |
iReadLocked(java.lang.Object key)
Returns whether the current ObjectStoreReference has read locked the specified key. |
boolean |
isEmpty()
Returns whether the persistent object store is empty. |
boolean |
isLocked(java.lang.Object key)
Returns whether the specified key is locked. |
boolean |
isOpen()
Returns whether the current ObjectStoreReference is still open. |
boolean |
isReadLocked(java.lang.Object key)
Returns whether the specified key is read locked. |
boolean |
isWriteLocked(java.lang.Object key)
Returns whether the specified key is write locked. |
boolean |
iWriteLocked(java.lang.Object key)
Returns whether the current ObjectStoreReference has write locked the specified key. |
ObjectStoreEnumeration |
keys()
Returns an ObjectStoreEnumeration of the keys in the persistent object store. |
ObjectStoreEnumeration |
keys(boolean with_locking)
Returns an ObjectStoreEnumeration of the keys in the persistent object store. |
ObjectStoreEnumeration |
keys(ObjectStoreEnumerationFilter filter)
Returns an ObjectStoreEnumeration of the keys in the persistent object store. |
ObjectStoreEnumeration |
keys(ObjectStoreEnumerationFilter filter,
boolean with_locking)
Returns an ObjectStoreEnumeration of the keys in the persistent object store. |
void |
lock(java.lang.Object key)
Write locks the specified key or waits until it can be write locked. |
boolean |
lock(java.lang.Object key,
long timeout)
Write locks the specified key or waits until it can be write locked or the specified timeout is reached. |
int |
lockCount()
Returns the number of locked keys. |
int |
lockCount(java.lang.Object key)
Returns the number of locks for the specified key. |
java.util.Enumeration |
locks()
Returns an Enumeration of the locked keys. |
java.util.Enumeration |
locks(java.lang.Object key)
Returns an Enumeration of the locks on the specified key. |
long |
lookup_table_page_count(long lookup_table_page_number)
Returns the number of key, value pairs that map to the specified lookup table page. |
long |
lookup_table_size()
Returns the size of the lookup table as specified when the persistent object store was created. |
long |
lookup_table_usage()
Returns the number of lookup table pages that are mapped by one (1) or more key, value pairs. |
double |
lookup_table_utilization()
Returns the percentage of lookup table pages that are mapped by one (1) or more key, value pairs. |
void |
put(java.lang.Object key,
java.lang.Object value)
Stores the specified object associated with the given key object in the persistent object store. |
void |
readLock(java.lang.Object key)
Read locks the specified key or waits until it can be read locked. |
boolean |
readLock(java.lang.Object key,
long timeout)
Read locks the specified key or waits until it can be read locked or the specified timeout is reached. |
void |
remove(java.lang.Object key)
Removes the specified key and associated value from the persistent object store. |
long |
size()
Returns the number of key, value pairs in the persistent object store. |
void |
unlock(java.lang.Object key)
Unlocks the specified key. |
void |
unlockAll()
Clears all the locks to this persistent object store. |
void |
unlockMine()
Clears all the locks for the current ObjectStoreReference. |
void |
writeLock(java.lang.Object key)
Write locks the specified key or waits until it can be write locked. |
boolean |
writeLock(java.lang.Object key,
long timeout)
Write locks the specified key or waits until it can be write locked or the specified timeout is reached. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public final void close() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.open
public final java.lang.Object get(java.lang.Object key) throws java.io.IOException
Unlike java.util.Hashtable.get(), null is a valid return value and cannot be used to determine whether a value was associated with the specified key, instead stec.xpos.ObjectStoreReference.containsKey(Object) should be used.
key
- the key to use. key cannot be null.
java.io.IOException
- if an I/O exception occurred.put
,
remove
,
containsKey
public final void put(java.lang.Object key, java.lang.Object value) throws java.io.IOException
Unlike java.util.Hashtable.put(), null is a valid value and this method does not return any value previously associated with the specified key.
key
- the key to store. key cannot be null.value
- the value to associate with the specified key.
java.io.IOException
- if an I/O exception occurred.get
,
remove
public final void remove(java.lang.Object key) throws java.io.IOException
Unlike java.util.Hashtable.remove(), this method does not return any value previously associated with the specified key.
key
- the key to remove. key cannot be null.
java.io.IOException
- if an I/O exception occurred.get
,
put
public final boolean containsKey(java.lang.Object key) throws java.io.IOException
key
- the key to test.
java.io.IOException
- if an I/O exception occurred.containsValue
public final boolean containsValue(java.lang.Object value) throws java.io.IOException
Searching for a value in a large persistent object store may take a long time.
value
- the value to test.
java.io.IOException
- if an I/O exception occurred.containsKey
public final long size() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.public final boolean isEmpty() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.public final ObjectStoreEnumeration keys() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.keys
,
keys
,
keys
,
elements
,
elements
,
elements
,
elements
,
ObjectStoreEnumeration
public final ObjectStoreEnumeration keys(boolean with_locking) throws java.io.IOException
with_locking
- whether to enable locking.
java.io.IOException
- if an I/O exception occurred.keys
,
keys
,
keys
,
elements
,
elements
,
elements
,
elements
,
ObjectStoreEnumeration
public final ObjectStoreEnumeration keys(ObjectStoreEnumerationFilter filter) throws java.io.IOException
filter
- the ObjectStoreEnumerationFilter. null if none.
java.io.IOException
- if an I/O exception occurred.keys
,
keys
,
keys
,
elements
,
elements
,
elements
,
elements
,
ObjectStoreEnumeration
,
ObjectStoreEnumerationFilter
public final ObjectStoreEnumeration keys(ObjectStoreEnumerationFilter filter, boolean with_locking) throws java.io.IOException
filter
- the ObjectStoreEnumerationFilter. null if none.with_locking
- whether to enable locking.
java.io.IOException
- if an I/O exception occurred.keys
,
keys
,
keys
,
elements
,
elements
,
elements
,
elements
,
ObjectStoreEnumeration
,
ObjectStoreEnumerationFilter
public final ObjectStoreEnumeration elements() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.elements
,
elements
,
elements
,
keys
,
keys
,
keys
,
keys
,
ObjectStoreEnumeration
public final ObjectStoreEnumeration elements(boolean with_locking) throws java.io.IOException
with_locking
- whether to enable locking.
java.io.IOException
- if an I/O exception occurred.elements
,
elements
,
elements
,
keys
,
keys
,
keys
,
keys
,
ObjectStoreEnumeration
public final ObjectStoreEnumeration elements(ObjectStoreEnumerationFilter filter) throws java.io.IOException
filter
- the ObjectStoreEnumerationFilter. null if none.
java.io.IOException
- if an I/O exception occurred.elements
,
elements
,
elements
,
keys
,
keys
,
keys
,
keys
,
ObjectStoreEnumeration
,
ObjectStoreEnumerationFilter
public final ObjectStoreEnumeration elements(ObjectStoreEnumerationFilter filter, boolean with_locking) throws java.io.IOException
filter
- the ObjectStoreEnumerationFilter. null if none.with_locking
- whether to enable locking.
java.io.IOException
- if an I/O exception occurred.elements
,
elements
,
elements
,
keys
,
keys
,
keys
,
keys
,
ObjectStoreEnumeration
,
ObjectStoreEnumerationFilter
public final long lookup_table_size() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.create
,
create
,
create
public final long lookup_table_page_count(long lookup_table_page_number) throws java.io.IOException
lookup_table_page_number
- the lookup table page number, 0 to lookup_table_size() - 1
java.io.IOException
- if an I/O exception occurred.lookup_table_size
public final double lookup_table_utilization() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.lookup_table_usage
public final long lookup_table_usage() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.lookup_table_utilization
public final void clear() throws java.io.IOException
Also removes all locks.
java.io.IOException
- if an I/O exception occurred.public final void lock(java.lang.Object key) throws java.io.IOException
Same as writeLock().
If the key is already read or write locked by another stec.xpos.ObjectStoreReference the current thread will be blocked until the specified key can be write locked.
Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.xpos.ObjectStoreReference.unlock(Object), the persistent object store is cleared by a call to stec.xpos.ObjectStoreReference.clear() or the stec.xpos.ObjectStoreReference is closed.
key
- the key to write lock. key cannot be null.
java.io.IOException
- if an I/O exception occurred.readLock
,
writeLock
,
lock
,
readLock
,
writeLock
,
unlock
,
unlockAll
,
unlockMine
public final void readLock(java.lang.Object key) throws java.io.IOException
If the key is already write locked by another stec.xpos.ObjectStoreReference the current thread will be blocked until the specified key can be read locked.
Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.xpos.ObjectStoreReference.unlock(Object), the persistent object store is cleared by a call to stec.xpos.ObjectStoreReference.clear() or the stec.xpos.ObjectStoreReference is closed.
key
- the key to read lock. key cannot be null.
java.io.IOException
- if an I/O exception occurred.lock
,
writeLock
,
lock
,
readLock
,
writeLock
,
unlock
,
unlockAll
,
unlockMine
public final void writeLock(java.lang.Object key) throws java.io.IOException
If the key is already read or write locked by another stec.xpos.ObjectStoreReference the current thread will be blocked until the specified key can be write locked.
Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.xpos.ObjectStoreReference.unlock(Object), the persistent object store is cleared by a call to stec.xpos.ObjectStoreReference.clear() or the stec.xpos.ObjectStoreReference is closed.
key
- the key to write lock. key cannot be null.
java.io.IOException
- if an I/O exception occurred.lock
,
readLock
,
lock
,
readLock
,
writeLock
,
unlock
,
unlockAll
,
unlockMine
public final boolean lock(java.lang.Object key, long timeout) throws java.io.IOException
Same as writeLock().
If the key is already read or write locked by another stec.xpos.ObjectStoreReference the current thread will be blocked until the key can be write locked or the specified timeout is reached.
Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.xpos.ObjectStoreReference.unlock(Object), the persistent object store is cleared by a call to stec.xpos.ObjectStoreReference.clear() or the stec.xpos.ObjectStoreReference is closed.
key
- the key to write lock. key cannot be null.timeout
- the number of milliseconds to wait. -1 for unlimited.
java.io.IOException
- if an I/O exception occurred.lock
,
readLock
,
writeLock
,
readLock
,
writeLock
,
unlock
,
unlockAll
,
unlockMine
public final boolean readLock(java.lang.Object key, long timeout) throws java.io.IOException
If the key is already write locked by another stec.xpos.ObjectStoreReference the current thread will be blocked until the key can be read locked or the specified timeout is reached.
Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.xpos.ObjectStoreReference.unlock(Object), the persistent object store is cleared by a call to stec.xpos.ObjectStoreReference.clear() or the stec.xpos.ObjectStoreReference is closed.
key
- the key to read lock. key cannot be null.timeout
- the number of milliseconds to wait. -1 for unlimited.
java.io.IOException
- if an I/O exception occurred.lock
,
readLock
,
writeLock
,
lock
,
writeLock
,
unlock
,
unlockAll
,
unlockMine
public final boolean writeLock(java.lang.Object key, long timeout) throws java.io.IOException
If the key is already read or write locked by another stec.xpos.ObjectStoreReference the current thread will be blocked until the key can be write locked or the specified timeout is reached.
Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.xpos.ObjectStoreReference.unlock(Object), the persistent object store is cleared by a call to stec.xpos.ObjectStoreReference.clear() or the stec.xpos.ObjectStoreReference is closed.
key
- the key to write lock. key cannot be null.timeout
- the number of milliseconds to wait. -1 for unlimited.
java.io.IOException
- if an I/O exception occurred.lock
,
readLock
,
writeLock
,
lock
,
readLock
,
unlock
,
unlockAll
,
unlockMine
public final void unlock(java.lang.Object key) throws java.io.IOException
key
- the key to unlock. key cannot be null.
java.io.IOException
- if the specified key is locked by another stec.xpos.ObjectStoreReference or if an I/O exception occurred.lock
,
readLock
,
writeLock
,
lock
,
readLock
,
writeLock
,
unlockAll
,
unlockMine
public final void unlockAll() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.lock
,
readLock
,
writeLock
,
lock
,
readLock
,
writeLock
,
unlock
,
unlockMine
public final void unlockMine() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.lock
,
readLock
,
writeLock
,
lock
,
readLock
,
writeLock
,
unlock
,
unlockAll
public final boolean isLocked(java.lang.Object key) throws java.io.IOException
key
- the key to test. key cannot be null.
java.io.IOException
- if an I/O exception occurred.isReadLocked
,
isWriteLocked
,
iLocked
,
iReadLocked
,
iWriteLocked
public final boolean isReadLocked(java.lang.Object key) throws java.io.IOException
key
- the key to test. key cannot be null.
java.io.IOException
- if an I/O exception occurred.isLocked
,
isWriteLocked
,
iLocked
,
iReadLocked
,
iWriteLocked
public final boolean isWriteLocked(java.lang.Object key) throws java.io.IOException
key
- the key to test. key cannot be null.
java.io.IOException
- if an I/O exception occurred.isLocked
,
isReadLocked
,
iLocked
,
iReadLocked
,
iWriteLocked
public final boolean iLocked(java.lang.Object key) throws java.io.IOException
key
- the key to test. key cannot be null.
java.io.IOException
- if an I/O exception occurred.isLocked
,
isReadLocked
,
isWriteLocked
,
iReadLocked
,
iWriteLocked
public final boolean iReadLocked(java.lang.Object key) throws java.io.IOException
key
- the key to test. key cannot be null.
java.io.IOException
- if an I/O exception occurred.isLocked
,
isReadLocked
,
isWriteLocked
,
iLocked
,
iWriteLocked
public final boolean iWriteLocked(java.lang.Object key) throws java.io.IOException
key
- the key to test. key cannot be null.
java.io.IOException
- if an I/O exception occurred.isLocked
,
isReadLocked
,
isWriteLocked
,
iLocked
,
iReadLocked
public int lockCount() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.lockCount
public int lockCount(java.lang.Object key) throws java.io.IOException
key
- the key check to use.
java.io.IOException
- if an I/O exception occurred.lockCount
public java.util.Enumeration locks() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.locks
,
Enumeration
,
LinkedList
public java.util.Enumeration locks(java.lang.Object key) throws java.io.IOException
key
- the object to use.
java.io.IOException
- if an I/O exception occurred.locks
,
Enumeration
,
Lock
public final boolean isOpen() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.open
,
close
public final ObjectStoreRandomAccessStream getRandomAccessStream(java.lang.Object key, boolean read_only) throws java.io.IOException
key
- the key to create an ObjectStoreRandomAccessStream for.read_only
- whether read-only or whether updates are allowed. If not read-only and the key does not exist then an empty byte[] value will be created.
java.io.IOException
- if an I/O exception occurred.ObjectStoreRandomAccessStream
public final ObjectStoreRandomAccessStream getRandomAccessStream(java.lang.Object key, java.lang.String class_name, boolean read_only) throws java.io.IOException
key
- the key to create an ObjectStoreRandomAccessStream for.class_name
- the name of the value type.read_only
- whether read-only or whether updates are allowed. If not read-only and the key does not exist then an empty value of the specfied class will be created.
java.io.IOException
- if an I/O exception occurred.ObjectStoreRandomAccessStream
public final ObjectStoreRandomAccessStream getRandomAccessStream(java.lang.Object key, int type, boolean read_only) throws java.io.IOException
key
- the key to create an ObjectStoreRandomAccessStream for.type
- the value type.read_only
- whether read-only or whether updates are allowed. If not read-only and the key does not exist then an empty value of the specfied class will be created.
java.io.IOException
- if an I/O exception occurred.ObjectStoreRandomAccessStream
public final ObjectStoreInputStream getInputStream(java.lang.Object key) throws java.io.IOException
key
- the key to create an ObjectStoreInputStream for.
java.io.IOException
- if an I/O exception occurred.getOutputStream
,
ObjectStoreInputStream
public final ObjectStoreOutputStream getOutputStream(java.lang.Object key, int type, boolean append) throws java.io.IOException
key
- the key to create an ObjectStoreOutputStream for.type
- the value type.append
- whether to append to any existing value or whether to delete any exist value and create a new value.
java.io.IOException
- if an I/O exception occurred.getInputStream
,
ObjectStoreOutputStream
public final ObjectStoreOutputStream getOutputStream(java.lang.Object key, java.lang.String class_name, boolean append) throws java.io.IOException
key
- the key to create an ObjectStoreOutputStream for.class_name
- the name of the value type.append
- whether to append to any existing value or whether to delete any exist value and create a new value.
java.io.IOException
- if an I/O exception occurred.getInputStream
,
ObjectStoreOutputStream
public final ObjectStoreOutputStream getOutputStream(java.lang.Object key) throws java.io.IOException
Deletes any existing value and creates a new value.
key
- the key to create an ObjectStoreOutputStream for.
java.io.IOException
- if an I/O exception occurred.getInputStream
,
ObjectStoreOutputStream
public final java.lang.String getFilename()
|
Servertec Persistent Object Store 1.4.1 09/04/2005 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001-2005 Servertec. All rights reserved.