|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.fzj.unicore.wsrflite.persistence.AbstractStore
public abstract class AbstractStore
Base functionality shared by all persistence implementations provides optional load-once semantics
LoadSemantics| Field Summary | |
|---|---|
protected ConcurrentMap<String,WSRFInstance> |
instances
|
protected String |
serviceName
|
protected PersistenceSettings |
settings
|
protected Set<String> |
uniqueIDs
|
| Fields inherited from interface de.fzj.unicore.wsrflite.persistence.IPersistenceProperties |
|---|
WSRF_PERSIST_CLASSNAME, WSRF_PERSIST_STORAGE_DIRECTORY |
| Constructor Summary | |
|---|---|
AbstractStore()
|
|
| Method Summary | |
|---|---|
protected abstract WSRFInstanceBean |
_getForUpdate(String uniqueID,
long time,
TimeUnit timeUnit)
|
protected abstract void |
_getUniqueIDs()
|
protected abstract void |
_persist(WSRFInstanceBean bean)
|
protected abstract WSRFInstanceBean |
_read(String uniqueID)
|
protected abstract void |
_remove(String uniqueID)
|
protected abstract void |
_unlock(WSRFInstanceBean bean)
|
long |
getCacheHits()
|
WSRFInstance |
getForUpdate(String uniqueID,
long time,
TimeUnit timeUnit)
get and lock a live instance from storage. |
PersistenceSettings |
getPersistenceSettings()
|
String |
getServiceName()
|
String[] |
getUniqueIDs()
retrieve a list of all unique ids |
void |
init(String serviceName)
initialise the store |
void |
persist(WSRFInstance inst)
persist a single wsrf instance |
WSRFInstance |
read(String uniqueID)
read an instance from storage. |
void |
remove(String uniqueID)
Delete an instance, and cleanup the persistence. |
void |
setPersistenceSettings(PersistenceSettings ps)
|
int |
size()
returns the number of instances in this store |
void |
unlock(WSRFInstance inst)
clear lock for the given instance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.fzj.unicore.wsrflite.persistence.Store |
|---|
getTerminationTimes, purgePersistentData, setTerminationTime, shutdown |
| Field Detail |
|---|
protected String serviceName
protected final Set<String> uniqueIDs
protected PersistenceSettings settings
protected ConcurrentMap<String,WSRFInstance> instances
| Constructor Detail |
|---|
public AbstractStore()
| Method Detail |
|---|
public void init(String serviceName)
Store
init in interface StoreserviceName - The name of the service that is persistedpublic void persist(WSRFInstance inst)
Store
persist in interface Storepublic void unlock(WSRFInstance inst)
Store
unlock in interface Store
protected abstract void _unlock(WSRFInstanceBean bean)
throws Exception
Exception
protected abstract void _persist(WSRFInstanceBean bean)
throws Exception
Exceptionpublic String[] getUniqueIDs()
Store
getUniqueIDs in interface Storeprotected abstract void _getUniqueIDs()
public WSRFInstance read(String uniqueID)
Store
read in interface Storenull if instance does not exist
protected abstract WSRFInstanceBean _read(String uniqueID)
throws Exception
Exception
public WSRFInstance getForUpdate(String uniqueID,
long time,
TimeUnit timeUnit)
throws TimeoutException
Store
getForUpdate in interface StoreuniqueID - - the id of the instance to readtime - - the maximum time to wait when aquiring a locktimeUnit - - the time units
TimeoutException
protected abstract WSRFInstanceBean _getForUpdate(String uniqueID,
long time,
TimeUnit timeUnit)
throws Exception
Exceptionpublic void remove(String uniqueID)
Store
remove in interface Storeprotected abstract void _remove(String uniqueID)
public int size()
Store
size in interface Storepublic long getCacheHits()
public void setPersistenceSettings(PersistenceSettings ps)
public PersistenceSettings getPersistenceSettings()
public String getServiceName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||