|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jrunx.persistence.AbstractFilePersistenceStore
Abstract implementation of a file-based persistent store. It provides subclasses with common functionality used to manipulate the file store resource.
| Field Summary | |
protected boolean |
cleanOnExit
|
static java.util.Map |
keySelectors
|
protected FileStoreManager |
storeManager
|
| Constructor Summary | |
AbstractFilePersistenceStore()
|
|
| Method Summary | |
void |
clean()
Removes all objects from the persistence store. |
static void |
cleanDirectory(java.io.File dir)
|
java.lang.Object |
create(java.lang.Object key,
PersistentObject object)
Inserts a new instance into the persistence store. |
static void |
deleteFile(java.io.File file)
|
void |
destroy()
Called by the PersistenceStore owner to let the PersistenceStore know that it should clean itself up. |
java.util.Collection |
findBy(java.lang.String method,
java.lang.Object args)
Finds wether the specified key is stored. |
protected java.util.Collection |
findBy(java.lang.String method,
java.lang.Object args,
java.util.Collection keys)
Finds wether the specified key is stored. |
java.lang.Object |
findByPrimaryKey(java.lang.Object key)
Finds wether the specified key is stored. |
protected KeySelector |
getKeySelector(java.lang.String name,
java.lang.Object[] args)
|
java.util.Map |
getKeySelectors()
|
void |
init()
Called by the PersistenceStore owner to let the PersistenceStore know that it should initialize itself. |
void |
load(java.lang.Object key,
PersistentObject object)
Retrieves the instance from the persistence store. |
void |
remove(java.lang.Object key)
Remove the instance from the persistence store. |
void |
setCleanOnExit(boolean cleanOnExit)
Marks wether the FileStore should be cleaned or not upon VM termination |
void |
setKeySelectors(java.util.Map keySelectors)
|
void |
setResource(java.lang.Object resource)
Sets the internal resource used by the store to persist objects |
void |
setStoreManager(StoreManager manager)
Sets the internal StoreManager used by the store to persist objects |
void |
store(java.lang.Object key,
PersistentObject object)
Inserts the instance into the persistence store. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean cleanOnExit
protected FileStoreManager storeManager
public static java.util.Map keySelectors
| Constructor Detail |
public AbstractFilePersistenceStore()
| Method Detail |
public void init()
throws java.lang.Exception
PersistenceStoreinit in interface PersistenceStore
public void destroy()
throws java.lang.Exception
PersistenceStoredestroy in interface PersistenceStore
public java.lang.Object create(java.lang.Object key,
PersistentObject object)
throws java.lang.Exception
create in interface PersistenceStorekey - the key associated with the bean.object - the object to be stored.
public void store(java.lang.Object key,
PersistentObject object)
throws java.lang.Exception
store in interface PersistenceStorekey - the key associated with the bean.object - the object to be stored.
public void load(java.lang.Object key,
PersistentObject object)
throws java.lang.Exception
load in interface PersistenceStorekey - the key associated with the bean.object - the PersistentObject used to load the object.
public void remove(java.lang.Object key)
throws java.lang.Exception
remove in interface PersistenceStorekey - the key associated with object.
public java.lang.Object findByPrimaryKey(java.lang.Object key)
throws java.lang.Exception
findByPrimaryKey in interface PersistenceStorekey - the key associated with the bean. Returns null if not found
public java.util.Collection findBy(java.lang.String method,
java.lang.Object args)
throws java.lang.Exception
findBy in interface PersistenceStoreargs - the set of arguments used to find the objects.
protected java.util.Collection findBy(java.lang.String method,
java.lang.Object args,
java.util.Collection keys)
throws java.lang.Exception
args - the set of arguments used to find the objects.keys - the set of keys to add to the list of keys to be
searched.public void setResource(java.lang.Object resource)
setResource in interface PersistenceStoreresource - the resource to be utilized by the storepublic void setStoreManager(StoreManager manager)
setStoreManager in interface PersistenceStoremanager - the manager to be utilized by the storepublic void setCleanOnExit(boolean cleanOnExit)
public void clean()
throws java.lang.Exception
clean in interface PersistenceStorepublic static void cleanDirectory(java.io.File dir)
public static void deleteFile(java.io.File file)
public java.util.Map getKeySelectors()
public void setKeySelectors(java.util.Map keySelectors)
protected KeySelector getKeySelector(java.lang.String name,
java.lang.Object[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||