|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.ha.store.api.BackingStore<K,V>
public abstract class BackingStore<K extends java.io.Serializable,V extends java.io.Serializable>
An object that stores a given value against an id. This class defines the set of operations that a container could perform on a store.
An instance of BackingStore is created by callingBackingStoreFactory.createBackingStore() method.
The BackingStore instance is created and used for storing data that belongs
to a single application or container.
The store implementation must be thread safe.
| Constructor Summary | |
|---|---|
BackingStore()
|
|
| Method Summary | |
|---|---|
void |
close()
Typically called during shutdown of the process. |
protected java.io.ObjectInputStream |
createObjectInputStream(java.io.InputStream is)
|
protected java.io.ObjectOutputStream |
createObjectOutputStream(java.io.OutputStream os)
|
void |
destroy()
Called when the store is no longer needed. |
protected BackingStoreConfiguration<K,V> |
getBackingStoreConfiguration()
|
abstract BackingStoreFactory |
getBackingStoreFactory()
|
protected void |
initialize(BackingStoreConfiguration<K,V> conf)
|
abstract V |
load(K key,
java.lang.String version)
Load and return the data for the given id. |
abstract void |
remove(K key)
Remove the association for the id. |
abstract int |
removeExpired()
Remove expired entries |
int |
removeExpired(long idleForMillis)
|
abstract java.lang.String |
save(K key,
V value,
boolean isNew)
Save the value whose key is id. |
abstract int |
size()
Get the current size of the store |
void |
updateTimestamp(K key,
long time)
TODO: BEGIN: REMOVE after shoal integration |
java.lang.String |
updateTimestamp(K key,
java.lang.String version,
java.lang.Long accessTime)
Recomended way is to just do a save(k, v) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BackingStore()
| Method Detail |
|---|
protected void initialize(BackingStoreConfiguration<K,V> conf)
throws BackingStoreException
BackingStoreExceptionprotected BackingStoreConfiguration<K,V> getBackingStoreConfiguration()
public abstract BackingStoreFactory getBackingStoreFactory()
public abstract V load(K key,
java.lang.String version)
throws BackingStoreException
save() method.
key - the key whose value must be returned
java.lang.NullPointerException - if the id is null
BackingStoreException - if the underlying store implementation encounters any
exception
public abstract java.lang.String save(K key,
V value,
boolean isNew)
throws BackingStoreException
key - the idvalue - The Metadata to be stored
BackingStoreException - if the underlying store implementation encounters any
exception
public abstract void remove(K key)
throws BackingStoreException
load(id) must return
null. In addition, any association between id and
container extra params must also be removed.
key - the id of the Metadata
BackingStoreException - if the underlying store implementation encounters any
exception
public void updateTimestamp(K key,
long time)
throws BackingStoreException
BackingStoreException
public int removeExpired(long idleForMillis)
throws BackingStoreException
BackingStoreException
public java.lang.String updateTimestamp(K key,
java.lang.String version,
java.lang.Long accessTime)
throws BackingStoreException
key - version - accessTime -
BackingStoreException
public abstract int removeExpired()
throws BackingStoreException
BackingStoreException
public abstract int size()
throws BackingStoreException
BackingStoreException - if the underlying store implementation encounters any
exception
public void close()
throws BackingStoreException
BackingStoreException
public void destroy()
throws BackingStoreException
BackingStoreException
protected java.io.ObjectOutputStream createObjectOutputStream(java.io.OutputStream os)
throws java.io.IOException
java.io.IOException
protected java.io.ObjectInputStream createObjectInputStream(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||