@NoStorableAccess @NotStorableClass public class FilePersistence extends AbstractFilePersistenceDelegatingToStore
Modifier and Type | Field and Description |
---|---|
static int |
BEST_COMPRESSION
Compression level for best compression.
|
static int |
BEST_SPEED
Compression level for fastest compression.
|
static int |
DEFAULT_COMPRESSION
Default compression level.
|
static int |
NO_COMPRESSION
Compression level for no compression.
|
classLoaderProvider, logger, mutex, store
Constructor and Description |
---|
FilePersistence(String propertiesSetupResourceName,
boolean removeFiles)
create a persistence setup from properties
|
Modifier and Type | Method and Description |
---|---|
protected void |
assertSessionClosed() |
protected void |
assertSessionOpenned() |
boolean |
autoSave() |
void |
clear()
clear all persisted data
|
void |
close()
close ( important to close files )
do not save modification |
static void |
closeAll() |
IAloneDataAccessSession |
createAloneDataAccessSession()
Deprecated.
|
IDataAccessSession |
createDataAccessSession() |
IExclusiveDataAccessSession |
createExclusiveDataAccessSession() |
static FileIOException |
fileIOException(Exception exception) |
static EnumFileState |
fileState(Exception exception)
to have the file state give by exception or its primary cause
|
static String |
getVersion() |
boolean |
isClosed() |
boolean |
isOpened() |
boolean |
isRunAutosaveEnable() |
boolean |
isUsed()
for tests only ( used to check all user thread have ended usage )
|
void |
save() |
static void |
setIdCount(int idCount)
for test only
|
void |
setImportListener(IImportListener listener) |
void |
setRunAutosaveEnable(boolean runAutosaveEnable) |
void |
storedMutableEnum(Class<? extends Enum<?>> enumClass)
declare persisted mutable enum by its class
(PROPS) can be set using properties file see FilePersistence(String, boolean)
|
void |
storedMutableEnum(Class<? extends Enum<?>>[] enumClasses)
declare persisted mutable enum by their class
(PROPS) can be set using properties file see FilePersistence(String, boolean)
|
static Throwable |
targetCause(Exception exception) |
void |
xmlImport(String directoryName,
boolean validating)
import from exported data in
directoryName |
addProhibitedPackage, addToNotCheckMethod, addToNotCheckMethod, addToNotCheckMethod, addToNotCheckMethod, allClassInformation, autoSaveSetup, classInfoOfObject, classOfObject, clearStore, closeStore, copy, createObjectReadingInStoreOrGetExisting, deepCopy, disableBackgroundGarbageSweep, enableBackgroundGarbageSweep, freeSize, garbageSweep, getAllReferenceLink, getCandidate, getClassIdentifier, getClassLoader, getCurrentDataRecordIdentifierAssociatedToObject, getDataManager, getLinkRecordManager, getMutex, getNumberOfDataRecord, getNumberOfFreeRecord, getNumberOfGarbageCandidate, getNumberOfModified, getNumberOfObjectExported, getNumberOfObjectState, getNumberOfReferenced, getNumberOfToGarbage, getNumberOfVisited, getNumberOfWeakReference, getObjectAndPersistInfoOfObjectFromQueue, getObjectAndPersistInfoOfObjectFromQueue, getObjectHavingStateSet, getObjectIOManager, getResource, getStorageFileName, getStore, getStoredEnumMap, getToGarbage, getVisitedObjectSet, getWroteArrays, getWroteObjectSet, isAutoSaveEnabled, isGarbageManagement, isProxy, keptInMemory, keyOfObjectKeptInMemory, knownAsNotExisting, listenStateMapClean, maintainInMemorySetup, newInstance, newInstance, newProxyInstance, newProxyInstance, newProxyInstance, openStore, referencedByPesistedStaticField, referencedByPesistedStaticField, removeWriteSubstitution, removeWriteSubstitution, setAutoSaveEnabled, setAutoSaveEventListener, setChangeLogEnabled, setClassLoader, setDeprecatedInStore, setDeprecatedInStore, setDeprecatedInStore, setDeprecatedInStore, setEnumState, setExportListener, setForceEnhance, setForceEnhance, setForceEnhance, setForceEnhance, setGarbageListener, setMaintainedInMemoryEnabled, setNoLazyLoad, setNoLazyLoad, setNoLazyLoad, setNoLazyLoad, setNotPersistedField, setNotPersistedField, setNotStorable, setNotStorable, setNotStorable, setNotStorable, setObjectIOForClass, setObjectIOForClass, setRecordSaveActions, setRecordSaveActions, setSaveRecordActionListener, setStorable, setStorable, setStorable, setStorable, setStore, setStoredEnumMap, setStoreNotUseStandardSerialization, setStoreNotUseStandardSerialization, setStoreNotUseStandardSerialization, setStoreNotUseStandardSerialization, setStoreOnlyMarkedStorable, setStoreSerializeAndGZippedInOneRecord, setStoreSerializeAndGZippedInOneRecord, setStoreSerializeAndGZippedInOneRecord, setStoreSerializeAndGZippedInOneRecord, setStoreSerializeAndZippedInOneRecord, setStoreSerializeAndZippedInOneRecord, setStoreSerializeAndZippedInOneRecord, setStoreSerializeAndZippedInOneRecord, setStoreSerializeInOneRecord, setStoreSerializeInOneRecord, setStoreSerializeInOneRecord, setStoreSerializeInOneRecord, setSubstituteObjectManager, setSubstituteObjectManager, setSubstitutionOfJavaUtilCollection, setWriteSubstitution, setWriteSubstitution, setZipCompressionLevel, storedEnum, storedEnum, storedEnum, storedImmutableEnum, storedImmutableEnum, storeDoNotSave, storeEndAccessSession, storeGetRoot, storeNewAccessSession, storeReadRoot, storeSave, storeSetInstanceFactory, storeSetRoot, totalSize, usedForClassNameManagement, usedForGarbageManagement, usedSize, xmlExport
public static final int NO_COMPRESSION
public static final int BEST_SPEED
public static final int BEST_COMPRESSION
public static final int DEFAULT_COMPRESSION
public FilePersistence(String propertiesSetupResourceName, boolean removeFiles) throws FilePersistenceException, FilePersistenceInvalidClassException, FilePersistenceNotSerializableException, FilePersistenceClassNotFoundException, FilePersistenceDataCorruptedException
propertiesSetupResourceName
- properties to use for setupremoveFiles
- true if remove files before openFilePersistenceException
FilePersistenceNotSerializableException
- Some object to be serialized does not follow joafip
persistence rules or does not implement the
java.io.Serializable interface.FilePersistenceInvalidClassException
- something is wrong with a class used by serializationFilePersistenceDataCorruptedException
- data is inconsistent.FilePersistenceClassNotFoundException
- Class of a serialized object cannot be found.public static String getVersion()
public void close() throws FilePersistenceException
IFilePersistence
FilePersistenceException
public boolean isClosed()
public boolean isOpened()
public static void closeAll()
public IDataAccessSession createDataAccessSession() throws FilePersistenceException
FilePersistenceException
@Deprecated public IAloneDataAccessSession createAloneDataAccessSession() throws FilePersistenceException
FilePersistenceException
public IExclusiveDataAccessSession createExclusiveDataAccessSession() throws FilePersistenceException
FilePersistenceException
public void clear() throws FilePersistenceException, FilePersistenceInvalidClassException, FilePersistenceNotSerializableException, FilePersistenceClassNotFoundException, FilePersistenceDataCorruptedException
IFilePersistence
public boolean autoSave() throws FilePersistenceException, FilePersistenceInvalidClassException, FilePersistenceNotSerializableException, FilePersistenceClassNotFoundException, FilePersistenceDataCorruptedException, FilePersistenceTooBigForSerializationException
public void setRunAutosaveEnable(boolean runAutosaveEnable)
public boolean isRunAutosaveEnable()
public void save() throws FilePersistenceException, FilePersistenceInvalidClassException, FilePersistenceNotSerializableException, FilePersistenceClassNotFoundException, FilePersistenceDataCorruptedException, FilePersistenceTooBigForSerializationException
@Fortest public boolean isUsed() throws FilePersistenceException
FilePersistenceException
protected void assertSessionClosed() throws FilePersistenceException
assertSessionClosed
in class AbstractFilePersistenceDelegatingToStore
FilePersistenceException
protected void assertSessionOpenned() throws FilePersistenceException
assertSessionOpenned
in class AbstractFilePersistenceDelegatingToStore
FilePersistenceException
public static EnumFileState fileState(Exception exception)
exception
- exceptionpublic static FileIOException fileIOException(Exception exception)
public static Throwable targetCause(Exception exception)
exception
- the exception in which search for target invocation exception@Fortest public static void setIdCount(int idCount) throws FilePersistenceException
idCount
- FilePersistenceException
public void storedMutableEnum(Class<? extends Enum<?>> enumClass) throws FilePersistenceException
IFilePersistence
FilePersistence(String, boolean)
enumClass
- the enum classFilePersistenceException
public void storedMutableEnum(Class<? extends Enum<?>>[] enumClasses) throws FilePersistenceException
IFilePersistence
FilePersistence(String, boolean)
FilePersistenceException
public void xmlImport(String directoryName, boolean validating) throws FilePersistenceException, FilePersistenceClassNotFoundException, FilePersistenceInvalidClassException, FilePersistenceDataCorruptedException, FilePersistenceNotSerializableException
IFilePersistence
directoryName directory
directoryName
- directory name where are stored exported data to importFilePersistenceException
FilePersistenceClassNotFoundException
FilePersistenceInvalidClassException
FilePersistenceDataCorruptedException
FilePersistenceNotSerializableException
public void setImportListener(IImportListener listener)
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.