@NotStorableClass public class Store extends AbstractDelegatingToStoreManagers
Modifier and Type | Field and Description |
---|---|
static DataRecordIdentifier |
IDENTIFIER_FOR_ROOT
data record identifier of root record
|
static DataRecordIdentifier |
IDENTIFIER_FOR_STORE_HEADER
data record identifier of store header associated to data record #0
|
autoSaveEnabled, classInfoFactory, classNameManager, currentDataModelIdentifier, garbageManagement, garbageManager, helperBinaryConversion, helperReflect, mutex, objectIOManager, proxyManager2, proxyMode, saver, storeGarbager, storeHeader, storeSaver, storeSynchro
dataManager, logger, STORE_DATA, TRACE_FILE
Constructor and Description |
---|
Store(StoreProperties storeProperties)
create a store using properties
|
Modifier and Type | Method and Description |
---|---|
void |
addProhibitedPackage(String packageName) |
void |
addToNotCheckMethod(Class<?> clazz) |
void |
addToNotCheckMethod(Constructor<?> constructor) |
void |
addToNotCheckMethod(Method method) |
void |
addToNotCheckMethod(String objectClassName,
String absoluteMethodName) |
void |
clear() |
void |
close()
close, do not save modifications
|
ObjectAndPersistInfo |
createObjectReadingInStoreOrGetExisting(DataRecordIdentifier dataRecordIdentifier,
boolean notLazy) |
void |
disableBackgroundGarbageSweep()
disable background garbage sweep operation
|
void |
doNotSave()
do not save the object modification, creation, and deletion on file
clear all informations on object persistence, persistent object are detached always for closing |
void |
enableBackgroundGarbageSweep(int sleepTime)
enable background garbage sweep operation
|
void |
endAccessSession()
access session is ended
|
long |
freeSize() |
int |
garbageSweep(String filePath)
garbage sweep, remove data record for object not attached to root
should be call only when all object detached, at startup or after commit |
ReferenceLink[] |
getAllReferenceLink() |
List<DataRecordIdentifierRBTNode> |
getCandidate() |
DataRecordIdentifier |
getDataRecordIdentifierAssociatedToObject(Object object) |
int |
getMaxNumberOfChangeLog() |
int |
getNumberOfDataRecord() |
int |
getNumberOfFreeRecord() |
int |
getNumberOfGarbageCandidate() |
int |
getNumberOfModified() |
int |
getNumberOfObjectState() |
int |
getNumberOfReferenced() |
int |
getNumberOfToGarbage() |
int |
getNumberOfVisitedForSave() |
int |
getNumberOfWeakReference() |
Collection<ObjectAndPersistInfo> |
getObjectHavingStateSet() |
Object |
getRoot() |
Map<EnumKey,Enum<?>> |
getStoredEnumMap() |
StoreRoot4 |
getStoreRoot() |
List<DataRecordIdentifierRBTNode> |
getToGarbage() |
boolean |
isBackgroundGarbageSweepWorking()
to know if sweeping or waiting ( may be becaus it is disabled )
|
boolean |
isChangeLogEnabled() |
void |
newAccessSession(boolean exclusiveAccessSession)
a new data access session is created
|
void |
open(boolean removeFiles)
open object storage management
|
void |
openAndNewAccessSession(boolean removeFiles,
boolean exclusiveAccessSession) |
Object |
readAndGetRoot() |
boolean |
readRoot()
read root object
|
void |
removeWriteSubstitution(Class<?> replacedClass) |
void |
removeWriteSubstitution(String replacedName) |
void |
save(boolean closing,
boolean autoSave)
save the object modification, creation, and deletion on file
then clear all informations on object persistence, persistent object are detached |
void |
setAutoSaveEventListener(IAutoSaveEventListener saveEventListener) |
void |
setBackgroundException(StoreException exception) |
void |
setChangeLogEnabled(boolean enabled,
int maxNumberOfChangeLog)
set enable state of file change logging
|
void |
setDeprecatedInStore(Class<?> objectClass) |
void |
setDeprecatedInStore(String objectClassName) |
void |
setEnumState(Enum<?> enumObject)
Deprecated.
|
void |
setForceEnhance(Class<?> objectClass)
force class to be enhanced even if have final public method
|
void |
setForceEnhance(String objectClassName) |
void |
setGarbageListener(IGarbageListener listener)
set garbage listener
|
void |
setInstanceFactory(IInstanceFactory instanceFactory) |
void |
setNoLazyLoad(Class<?> objectClass)
set no use of lazy load for a class
|
void |
setNoLazyLoad(Class<?>[] objectClasses)
set no use of lazy load for the classes
|
void |
setNoLazyLoad(String objectClassName) |
void |
setNoLazyLoad(String[] objectClassNames) |
void |
setNotPersistedField(Class<?> clazz,
String[] fieldNames) |
void |
setNotPersistedField(String objectClassName,
String[] fieldNames) |
void |
setNotStorable(Class<?> objectClass) |
void |
setNotStorable(String objectClassName) |
void |
setObjectIOForClass(Class<?> objectClass,
Class<? extends IObjectInput> objectInputClass,
Class<? extends IObjectOutput> objectOutputClass)
set object input output manager for a class
|
void |
setObjectIOForClass(String objectClassName,
Class<? extends IObjectInput> objectInputClass,
Class<? extends IObjectOutput> objectOutputClass) |
void |
setRoot(Object rootObject) |
void |
setRoot(Object rootObject,
Map<EnumKey,Enum<?>> storedEnumMap)
set root object
do not save the modification |
void |
setStorable(Class<?> objectClass)
mark class to be storable
|
void |
setStorable(String objectClassName) |
boolean |
setStoredEnumMap(Map<EnumKey,Enum<?>> storedEnumMap) |
void |
setStoreNotUseStandardSerialization(Class<?> objectClass)
set not use standard serialization for a class
|
void |
setStoreNotUseStandardSerialization(String objectClassName) |
void |
setStoreSerializeAndGZippedInOneRecord(Class<?> objectClass)
set storage mode serialized and GZipped for a class
|
void |
setStoreSerializeAndGZippedInOneRecord(String objectClassName) |
void |
setStoreSerializeAndZippedInOneRecord(Class<?> objectClass)
set storage mode serialized and Zipped for a class
|
void |
setStoreSerializeAndZippedInOneRecord(String objectClassName) |
void |
setStoreSerializeInOneRecord(Class<?> objectClass)
set storage mode serialized for a class
|
void |
setStoreSerializeInOneRecord(String objectClassName) |
void |
setSubstituteObjectManager(Class<?> objectClass,
Class<?> substituteObjectClass,
ISubstituteObjectManager substituteObjectManager)
set substitution for object of a class writing and reading
|
void |
setSubstituteObjectManager(String objectClassName,
Class<?> substituteObjectClass,
ISubstituteObjectManager substituteObjectManager) |
void |
setSubstitutionOfJavaUtilCollection(boolean enabled)
set java util collection substitution
PVector for Vector PLinkedList for LinkedList PArrayList for ArrayList PHashSet for HashSet PLinkedHashSet for LinkedHashSet PTreeSet for TreeSet PHashMap for HashMap PLinkedHashMap for LinkedHashMap PTreeMap for TreeMap PHashMap for HashTable |
void |
setWriteSubstitution(Class<?> replacedClass,
Class<?> substituteClass,
ISubsituteSynchronizer subsituteSynchronizer)
record a class substitution association
|
void |
setWriteSubstitution(String replacedName,
Class<?> substitute,
ISubsituteSynchronizer synchronizer) |
long |
totalSize() |
void |
usedForGarbageManagement(Set<DataRecordIdentifier> setToUpdate) |
long |
usedSize() |
allClassInformation, attachHeapRecordable, autoSaveSetup, classInfoOfObject, classOfObject, deepCopy, getClassIdentifier, getClassInfoFactory, getClassInfoInDataRecord, getClassLoaderProvider, getClassNameManager, getConversionManager, getCurrentDataModelIdentifier, getCurrentFileAccessSessionIdentifier, getGarbageCandidateRecordManager, getGarbageManager, getHeapRecordableManager, getHelperBinaryConversion, getLinkRecordManager, getMutex, getNumberOfObjectExported, getObjectAndPersistInfoOfObjectFromQueue, getObjectAndPersistInfoOfObjectFromQueue, getObjectIOManager, getPersistenceId, getProxyManager2, getStoreSaver, getStoreSynchro, getToGarbageRecordManager, getToVisitRecordManager, getVisitedObjectSet, getVisitedRecordManager, getWroteArrays, getWroteObjectSet, heapRecordableManagerDoNotSave, heapRecordableManagerSave, isAutoSaveEnabled, isGarbageManagement, isKeptInMemory, isProxyMode, keptInMemory, keyOfObjectKeptInMemory, knownAsNotExisting, listenStateMapClean, loadClassName, maintainInMemorySetup, newInstance, newInstance, newInstance, newInstanceNoConstruction, newProxyInstance, newProxyInstance, newProxyInstance, readAndSetHeapRecordableState, referencedByPesistedStaticField, setAutoSaveEnabled, setClassLoaderProvider, setDeprecatedInStore, setExportListener, setImportListener, setMaintainedInMemoryEnabled, setNotStorable, setPersistenceId, setRecordSaveActions, setRecordSaveActions, setSaveInDataAccessSessionEnabled, setSaver, setSaveRecordActionListener, setStoreMode, setStoreOnlyMarkedStorable, setZipCompressionLevel, stop, storedImmutableEnum, usedForClassNameManagement, xmlExport, xmlImport
clearDataManager, dataManagerBackup, dataManagerFreeSize, dataManagerGetNumberOfDataRecord, dataManagerGetNumberOfFreeRecord, dataManagerHeapSize, dataManagerUsedSize, flushDataManager, getDataManager, getNewDataRecordIdentifier, getStorageFileName, startDataManagerService, stopDataManagerService
public static final DataRecordIdentifier IDENTIFIER_FOR_STORE_HEADER
public static final DataRecordIdentifier IDENTIFIER_FOR_ROOT
public Store(StoreProperties storeProperties) throws StoreException
storeProperties
- StoreException
public void setSubstitutionOfJavaUtilCollection(boolean enabled) throws StoreException
IStore
StoreException
public StoreRoot4 getStoreRoot() throws StoreException
StoreException
public final void setWriteSubstitution(Class<?> replacedClass, Class<?> substituteClass, ISubsituteSynchronizer subsituteSynchronizer) throws StoreException
IStore
replacedClass
- the replaced classsubstituteClass
- the substitute for the replaced classsubsituteSynchronizer
- the state synchronizer for class and its substituteStoreException
public void removeWriteSubstitution(Class<?> replacedClass) throws StoreException
StoreException
public void setWriteSubstitution(String replacedName, Class<?> substitute, ISubsituteSynchronizer synchronizer) throws StoreException
StoreException
public void removeWriteSubstitution(String replacedName) throws StoreException, StoreClassNotFoundException
public void setNoLazyLoad(Class<?> objectClass) throws StoreException
IStore
StoreException
public void setNoLazyLoad(Class<?>[] objectClasses) throws StoreException
IStore
StoreException
public void setNoLazyLoad(String objectClassName)
public void setNoLazyLoad(String[] objectClassNames)
public final void setStoreNotUseStandardSerialization(Class<?> objectClass) throws StoreException
IStore
StoreException
public void setStoreNotUseStandardSerialization(String objectClassName) throws StoreException
StoreException
public final void setStoreSerializeAndGZippedInOneRecord(Class<?> objectClass) throws StoreException
IStore
StoreException
public void setStoreSerializeAndGZippedInOneRecord(String objectClassName) throws StoreException
StoreException
public final void setStoreSerializeAndZippedInOneRecord(Class<?> objectClass) throws StoreException
IStore
StoreException
public void setStoreSerializeAndZippedInOneRecord(String objectClassName) throws StoreException
StoreException
public final void setStoreSerializeInOneRecord(Class<?> objectClass) throws StoreException
IStore
StoreException
public void setStoreSerializeInOneRecord(String objectClassName) throws StoreException
StoreException
public void setStorable(Class<?> objectClass) throws StoreException
IStore
StoreException
public void setStorable(String objectClassName) throws StoreException
StoreException
public void setNotStorable(Class<?> objectClass) throws StoreException
StoreException
public void setNotStorable(String objectClassName) throws StoreException
StoreException
public void setDeprecatedInStore(Class<?> objectClass) throws StoreException
StoreException
public void setDeprecatedInStore(String objectClassName) throws StoreException
StoreException
public void setForceEnhance(Class<?> objectClass) throws StoreException
IStore
StoreException
public void setForceEnhance(String objectClassName)
public void addProhibitedPackage(String packageName)
public void addToNotCheckMethod(Class<?> clazz)
public void addToNotCheckMethod(Method method)
public void addToNotCheckMethod(Constructor<?> constructor)
public void addToNotCheckMethod(String objectClassName, String absoluteMethodName)
public void setObjectIOForClass(Class<?> objectClass, Class<? extends IObjectInput> objectInputClass, Class<? extends IObjectOutput> objectOutputClass) throws StoreException
IStore
objectClass
- the class for which is provide the object input outputobjectInputClass
- object input manager class for the classobjectOutputClass
- object output manager class for the classStoreException
- object I/O construction failurepublic void setObjectIOForClass(String objectClassName, Class<? extends IObjectInput> objectInputClass, Class<? extends IObjectOutput> objectOutputClass) throws StoreException
StoreException
public void setSubstituteObjectManager(Class<?> objectClass, Class<?> substituteObjectClass, ISubstituteObjectManager substituteObjectManager) throws StoreException
IStore
objectClass
- the class of object to substitutesubstituteObjectClass
- the substitute object classsubstituteObjectManager
- the substitute manager to useStoreException
public void setSubstituteObjectManager(String objectClassName, Class<?> substituteObjectClass, ISubstituteObjectManager substituteObjectManager) throws StoreException
StoreException
public void setNotPersistedField(Class<?> clazz, String[] fieldNames) throws StoreException
StoreException
public void setNotPersistedField(String objectClassName, String[] fieldNames) throws StoreException
StoreException
public void open(boolean removeFiles) throws StoreException, StoreClassNotFoundException
IStore
removeFiles
- true if remove files before openStoreException
StoreClassNotFoundException
@Fortest public void openAndNewAccessSession(boolean removeFiles, boolean exclusiveAccessSession) throws StoreException, StoreClassNotFoundException
public void close() throws StoreException
IStore
StoreException
public void clear() throws StoreException, StoreClassNotFoundException
@Fortest public Object readAndGetRoot() throws StoreException, StoreClassNotFoundException, StoreInvalidClassException, StoreDataCorruptedException, StoreNotSerializableException
public boolean readRoot() throws StoreException, StoreClassNotFoundException, StoreInvalidClassException, StoreDataCorruptedException, StoreNotSerializableException
IStore
StoreException
StoreClassNotFoundException
StoreInvalidClassException
StoreDataCorruptedException
StoreNotSerializableException
@StorableAccess public Object getRoot()
@StorableAccess public Map<EnumKey,Enum<?>> getStoredEnumMap()
@StorableAccess public boolean setStoredEnumMap(Map<EnumKey,Enum<?>> storedEnumMap)
@Fortest public void setRoot(Object rootObject) throws StoreException, StoreInvalidClassException, StoreNotSerializableException, StoreClassNotFoundException, StoreDataCorruptedException
public void setRoot(Object rootObject, Map<EnumKey,Enum<?>> storedEnumMap) throws StoreException, StoreInvalidClassException, StoreNotSerializableException, StoreClassNotFoundException, StoreDataCorruptedException
IStore
rootObject
- the root objectstoredEnumMap
- stored enum mapStoreException
StoreInvalidClassException
StoreNotSerializableException
StoreClassNotFoundException
StoreDataCorruptedException
@Deprecated public void setEnumState(Enum<?> enumObject) throws StoreException
IStore
enumObject
- the enum for which state must be setStoreException
public void setAutoSaveEventListener(IAutoSaveEventListener saveEventListener)
@StorableAccess public void save(boolean closing, boolean autoSave) throws StoreException, StoreInvalidClassException, StoreNotSerializableException, StoreClassNotFoundException, StoreDataCorruptedException, StoreTooBigForSerializationException
IStore
closing
- true if save for closingautoSave
- true if auto save callStoreException
StoreInvalidClassException
StoreNotSerializableException
StoreClassNotFoundException
StoreDataCorruptedException
StoreTooBigForSerializationException
public void doNotSave() throws StoreException
IStore
StoreException
public void endAccessSession() throws StoreException
IStore
StoreException
public void newAccessSession(boolean exclusiveAccessSession)
IStore
public void setInstanceFactory(IInstanceFactory instanceFactory)
public int getNumberOfDataRecord() throws StoreException
StoreException
public int getNumberOfFreeRecord() throws StoreException
StoreException
public long freeSize() throws StoreException
StoreException
public long usedSize() throws StoreException
StoreException
public long totalSize() throws StoreException
StoreException
public int getNumberOfGarbageCandidate() throws StoreException
StoreException
@Fortest public List<DataRecordIdentifierRBTNode> getCandidate() throws StoreException
StoreException
public int getNumberOfToGarbage() throws StoreException
StoreException
@Fortest public List<DataRecordIdentifierRBTNode> getToGarbage() throws StoreException
StoreException
@Fortest public ReferenceLink[] getAllReferenceLink() throws StoreException
StoreException
public void setGarbageListener(IGarbageListener listener) throws StoreException
IStore
listener
- th garbage listener, can be null to remove previous oneStoreException
public int garbageSweep(String filePath) throws StoreException, StoreClassNotFoundException, StoreDataCorruptedException
IStore
filePath
- temporary file for data record identifier setStoreException
StoreClassNotFoundException
StoreDataCorruptedException
public void enableBackgroundGarbageSweep(int sleepTime) throws StoreException
IStore
sleepTime
- sleep time between garbage sweep operationStoreException
public void disableBackgroundGarbageSweep() throws StoreException
IStore
StoreException
public boolean isBackgroundGarbageSweepWorking() throws StoreException
IStore
StoreException
public void usedForGarbageManagement(Set<DataRecordIdentifier> setToUpdate) throws StoreException
StoreException
@Fortest public DataRecordIdentifier getDataRecordIdentifierAssociatedToObject(Object object) throws StoreException
StoreException
public int getNumberOfObjectState() throws StoreException
StoreException
public int getNumberOfWeakReference() throws StoreException
StoreException
public int getNumberOfReferenced() throws StoreException
StoreException
@Fortest public Collection<ObjectAndPersistInfo> getObjectHavingStateSet()
public int getNumberOfModified() throws StoreException
StoreException
public int getNumberOfVisitedForSave() throws StoreException
StoreException
public void setBackgroundException(StoreException exception)
public void setChangeLogEnabled(boolean enabled, int maxNumberOfChangeLog) throws StoreException
IStore
enabled
- true if change log enabledmaxNumberOfChangeLog
- max number of state change logStoreException
public int getMaxNumberOfChangeLog()
public boolean isChangeLogEnabled()
public ObjectAndPersistInfo createObjectReadingInStoreOrGetExisting(DataRecordIdentifier dataRecordIdentifier, boolean notLazy) throws StoreException, StoreClassNotFoundException, StoreInvalidClassException, StoreDataCorruptedException, StoreNotSerializableException
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.