@NotStorableClass @NoStorableAccess public abstract class AbstractDataAccessSession extends Object implements IDataAccessSessionCommon
Modifier and Type | Field and Description |
---|---|
protected static String |
CLOSE_ERROR |
protected FilePersistence |
filePersistence
file persistence manager
|
protected JoafipLogger |
logger |
protected JoafipMutex |
mutex
for thread synchronization
|
protected static String |
OPEN_ERROR |
protected boolean |
opened
true when data access session is opened
|
protected boolean |
opening
true while in opening phase
|
Constructor and Description |
---|
AbstractDataAccessSession(FilePersistence filePersistence) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertClosed() |
protected void |
assertOpened() |
protected void |
assertPersistenceOpenned() |
int |
getClassIdentifier(Class<?> clazz) |
JoafipMutex |
getMutex() |
Object |
getObject(long dataRecordIdentifier) |
Object |
getObject(String key)
get a persistent object by its key
|
Collection<Object> |
getObjects() |
boolean |
isClosed() |
boolean |
isOpened() |
Set<String> |
objectKeySet() |
void |
removeAllObject()
remove all persistent object
|
Object |
removeObject(String key)
remove a persistent object associated to a key
|
protected void |
setCloserTrace() |
void |
setEnumState(Enum<?> enumObject)
Deprecated.
|
Object |
setObject(String key,
Object object)
add a persistent object associated to a key
|
protected void |
setOpenerTrace() |
void |
storedEnum(Class<? extends Enum<?>> enumClass)
Deprecated.
|
void |
storedImmutableEnum(Class<? extends Enum<?>> enumClass) |
void |
storedImmutableEnum(Class<? extends Enum<?>>[] enumClasses) |
void |
storedMutableEnum(Class<? extends Enum<?>> enumClass) |
void |
storedMutableEnum(Class<? extends Enum<?>>[] enumClasses) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
open
protected static final String OPEN_ERROR
protected static final String CLOSE_ERROR
protected final JoafipLogger logger
protected final FilePersistence filePersistence
protected final JoafipMutex mutex
protected boolean opened
protected boolean opening
public AbstractDataAccessSession(FilePersistence filePersistence)
public JoafipMutex getMutex()
getMutex
in interface IDataAccessSessionCommon
public boolean isOpened() throws FilePersistenceException
isOpened
in interface IDataAccessSessionCommon
FilePersistenceException
public boolean isClosed() throws FilePersistenceException
isClosed
in interface IDataAccessSessionCommon
FilePersistenceException
@Deprecated public void storedEnum(Class<? extends Enum<?>> enumClass) throws FilePersistenceException
IDataAccessSessionCommon
storedEnum
in interface IDataAccessSessionCommon
enumClass
- the enum classFilePersistenceException
public void storedImmutableEnum(Class<? extends Enum<?>> enumClass) throws FilePersistenceException
storedImmutableEnum
in interface IDataAccessSessionCommon
FilePersistenceException
public void storedImmutableEnum(Class<? extends Enum<?>>[] enumClasses) throws FilePersistenceException
storedImmutableEnum
in interface IDataAccessSessionCommon
FilePersistenceException
public void storedMutableEnum(Class<? extends Enum<?>> enumClass) throws FilePersistenceException
storedMutableEnum
in interface IDataAccessSessionCommon
FilePersistenceException
public void storedMutableEnum(Class<? extends Enum<?>>[] enumClasses) throws FilePersistenceException
storedMutableEnum
in interface IDataAccessSessionCommon
FilePersistenceException
public Object getObject(String key) throws FilePersistenceException
IDataAccessSessionCommon
getObject
in interface IDataAccessSessionCommon
key
- the persistent object keyFilePersistenceException
- this data access session not openedpublic Object getObject(long dataRecordIdentifier) throws FilePersistenceException, FilePersistenceClassNotFoundException, FilePersistenceInvalidClassException, FilePersistenceDataCorruptedException, FilePersistenceNotSerializableException
@Deprecated public void setEnumState(Enum<?> enumObject) throws FilePersistenceException
IDataAccessSessionCommon
setEnumState
in interface IDataAccessSessionCommon
enumObject
- the enum for which state must be setFilePersistenceException
public Object setObject(String key, Object object) throws FilePersistenceException
IDataAccessSessionCommon
setObject
in interface IDataAccessSessionCommon
key
- the object access keyobject
- the persistent objectFilePersistenceException
- this data access session not openedpublic Object removeObject(String key) throws FilePersistenceException
IDataAccessSessionCommon
removeObject
in interface IDataAccessSessionCommon
key
- the object access keyFilePersistenceException
- this data access session not openedpublic void removeAllObject() throws FilePersistenceException
IDataAccessSessionCommon
removeAllObject
in interface IDataAccessSessionCommon
FilePersistenceException
public Set<String> objectKeySet() throws FilePersistenceException
objectKeySet
in interface IDataAccessSessionCommon
FilePersistenceException
- this data access session not openedpublic Collection<Object> getObjects() throws FilePersistenceException
getObjects
in interface IDataAccessSessionCommon
FilePersistenceException
public int getClassIdentifier(Class<?> clazz) throws FilePersistenceException, FilePersistenceClassNotFoundException
getClassIdentifier
in interface IDataAccessSessionCommon
FilePersistenceException
FilePersistenceClassNotFoundException
protected void assertPersistenceOpenned() throws FilePersistenceException
FilePersistenceException
protected void assertClosed() throws FilePersistenceException
FilePersistenceException
protected void assertOpened() throws FilePersistenceException
FilePersistenceException
protected void setOpenerTrace()
protected final void setCloserTrace()
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.