|
||||||||||
| 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 Serializable,V extends 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 ObjectInputStream |
createObjectInputStream(InputStream is)
|
protected ObjectOutputStream |
createObjectOutputStream(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,
String version)
Load and return the data for the given id. |
abstract void |
remove(K key)
Remove the association for the id. |
int |
removeExpired()
Remove expired entries |
int |
removeExpired(long idleForMillis)
|
abstract 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 |
String |
updateTimestamp(K key,
String version,
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,
String version)
throws BackingStoreException
save() method.
key - the key whose value must be returned
NullPointerException - if the id is null
BackingStoreException - if the underlying store implementation encounters any
exception
public abstract 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 String updateTimestamp(K key,
String version,
Long accessTime)
throws BackingStoreException
key - version - accessTime -
BackingStoreException
public 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 ObjectOutputStream createObjectOutputStream(OutputStream os)
throws IOException
IOException
protected ObjectInputStream createObjectInputStream(InputStream is)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||