|
||||||||||
| 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()
|
protected java.io.ObjectInputStream |
createObjectInputStream(java.io.InputStream is)
|
protected java.io.ObjectOutputStream |
createObjectOutputStream(java.io.OutputStream os)
|
abstract void |
destroy()
Called when the store is no longer needed. |
java.util.Collection |
findByCriteria(Criteria<V> criteria,
StoreEntryEvaluator<K,V> eval)
Find entries that satisfy the given Criteria. |
protected BackingStoreConfiguration<K,V> |
getBackingStoreConfiguration()
|
BackingStoreFactory |
getBackingStoreFactory()
|
protected void |
initialize(BackingStoreConfiguration<K,V> conf)
|
abstract V |
load(java.lang.Object 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. |
void |
removeByCriteria(Criteria<V> criteria,
StoreEntryEvaluator<K,V> eval)
Remove instances that meet the criteria. |
int |
removeExpired()
|
abstract int |
removeExpired(long idleForMillis)
Remove expired entries |
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 |
java.util.Collection |
synchronizeKeys(Criteria<V> criteria,
StoreEntryEvaluator<K,V> eval,
boolean eagerFetch)
Cache the keys for the entries that satisfy the given Criteria. |
abstract void |
updateTimestamp(K key,
long time)
|
java.lang.String |
updateTimestamp(K key,
java.lang.Long version,
java.lang.Long accessTime,
java.lang.Long maxIdleTime)
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 V load(java.lang.Object 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 abstract void updateTimestamp(K key,
long time)
throws BackingStoreException
BackingStoreException
public java.lang.String updateTimestamp(K key,
java.lang.Long version,
java.lang.Long accessTime,
java.lang.Long maxIdleTime)
throws BackingStoreException
key - version - accessTime - maxIdleTime -
BackingStoreException
public abstract int removeExpired(long idleForMillis)
throws BackingStoreException
BackingStoreException
public int removeExpired()
throws BackingStoreException
BackingStoreException
public void removeByCriteria(Criteria<V> criteria,
StoreEntryEvaluator<K,V> eval)
throws BackingStoreException
BackingStoreException - if the underlying store implementation encounters any
exception
public abstract int size()
throws BackingStoreException
BackingStoreException - if the underlying store implementation encounters any
exception
public abstract void destroy()
throws BackingStoreException
BackingStoreException
public java.util.Collection findByCriteria(Criteria<V> criteria,
StoreEntryEvaluator<K,V> eval)
criteria - The criteria that must be satisfied. Can be null (in which case
every value in this store is assumed to match the criteria)eval - The StoreEntryEvaluator The evaluator whose _getExtraParamCollectionFromManager method must be invoked to further
narrow the result.
public void close()
throws BackingStoreException
BackingStoreExceptionpublic BackingStoreFactory getBackingStoreFactory()
public java.util.Collection synchronizeKeys(Criteria<V> criteria,
StoreEntryEvaluator<K,V> eval,
boolean eagerFetch)
criteria - The criteria that must be satisfied. Can be null (in which case
every value in this store is assumed to match the criteria)eval - The StoreEntryEvaluator The evaluator whose _getExtraParamCollectionFromManager method must be invoked to further
narrow the result.
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 | |||||||||