@NotStorableClass public abstract class AbstractObjectIOManagerIOForObject extends AbstractObjectIOManagerKeptInMemory
| Modifier and Type | Field and Description |
|---|---|
protected IClassNameManager |
classNameManager
class name manager
|
protected int |
currentDataModelIdentifier |
static int |
HEADER_DATA_SIZE
header data size that store:
object class identifier (int) storage format (short) joafip release identifier (int) data model identifier (int) |
protected HelperBinaryConversion |
helperBinaryConversion |
static HelperReflect |
helperReflect |
protected JoafipLogger |
logger |
protected static String |
OBJECT_MUST_HAVE_DATA_RECORD_IDENTIFIER_SET
error message
|
protected ObjectInputForEnum |
objectInputEnum |
protected IObjectOutput[] |
objectOutputs |
classInfoFactory| Constructor and Description |
|---|
AbstractObjectIOManagerIOForObject(int currentDataModelIdentifier,
IClassNameManager classNameManager,
boolean proxyMode,
ClassInfoFactory classInfoFactory,
HelperBinaryConversion helperBinaryConversion,
IProxyManagerForObjectIO proxyManager2) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertNotSubstituted(ObjectAndItsClassInfo objectAndItsClassInfo) |
protected abstract DataRecordIdentifier |
associateNewDataRecordIdentifierToObject(ObjectAndPersistInfo objectAndPersistInfo) |
protected abstract void |
checkForAutoSave() |
protected abstract void |
clearObjectAndPersistInfoByDataRecordIdentifier(DataRecordIdentifier identifier) |
protected abstract ObjectAndPersistInfo |
createObjectAndPersistInfoOfObjectImpl(Object object,
boolean proxyInstance,
ClassInfo objectClassInfo) |
ObjectAndPersistInfo |
createObjectPersistInfoOfObject(Object object,
Boolean proxyInstance,
ClassInfo objectClassInfo,
boolean persisted) |
ObjectAndPersistInfo |
createObjectPersistInfoOfObject(Object object,
boolean proxyInstance,
ClassInfo objectClassInfo,
DataRecordIdentifier dataRecordIdentifier) |
protected ObjectAndPersistInfo |
createObjectReadingInStore(DataRecordIdentifier dataRecordIdentifier,
boolean notLazy)
creation of a not existing object reading its state from data record
|
ObjectAndPersistInfo |
createObjectReadingInStoreOrGetExisting(DataRecordIdentifier dataRecordIdentifier,
boolean notLazy)
Create object, may return already created object
In case of lazy loading the object state is not set, else the object state is set reading its state in the file Must associate object created to its data record identifier NOTE FOR dataRecordIdentifier: for object creation that return same object for same state ( for example Integer.valueOf(int) or Enum.valueOf(Class, String) ), if
object already created it can have data record identifier different from
dataRecordIdentifier parameterParameter to force loading ( not lazy ) set data record associated to created object |
protected abstract ObjectAndPersistInfo |
createSubstitutedObjectAndPersistInfoOfObjectImpl(Object object,
ClassInfo objectClassInfo,
ObjectAndPersistInfo substituteObjectAndPersistInfo) |
protected ObjectAndPersistInfo |
createSubstituteObjectPersistInfoOfObject(Object substituteObject,
ClassInfo substituteClassInfo,
ObjectAndPersistInfo substitutedObjectAndPersistInfo) |
abstract void |
dataRecordIdentifierAssociatedToObjectSetted(ObjectAndPersistInfo objectAndItsClassInfo)
action after set the data record identifier of an object
|
Object |
deepCopy(Object sourceObject) |
byte[] |
getBodyDataFromRecord(ObjectAndPersistInfo objectAndPersistInfo) |
ClassInfoFactory |
getClassInfoFactory() |
ClassInfo |
getClassInfoInDataRecord(DataRecordIdentifier dataRecordIdentifier) |
int |
getCurrentDataModelIdentifier() |
protected abstract byte[] |
getDataOfDataRecord(DataRecordIdentifier dataRecordIdentifier)
get data of data record for an identifier
|
abstract ObjectAndPersistInfo |
getObjectByIdentifier(DataRecordIdentifier identifier)
to obtains object and persist information for data record by data record
identifier
public for tests |
protected IObjectInput |
getObjectInput(ClassInfo classInfo,
boolean notLazy)
get the object input manager according to object class
|
ObjectIOInputStream |
getObjectIOInputStream() |
ObjectIOOutputStream |
getObjectIOOutputStream() |
ObjectLinkTreeNode |
getObjectLinkTreeNode(DataRecordIdentifier dataRecordIdentifier)
get the object(s) referenced by the object and its number of link knowing
its data record identifier
|
protected IObjectOutput |
getObjectOutput(ClassInfo classInfo)
get the object output manager according to object class
|
DataRecordIdentifier |
getOrCreateDataRecordIdentifierAssociatedToObject(ObjectAndPersistInfo objectAndPersistInfo)
get or create data record identifier associated to object
check id data record associated to object exists and create it if needed |
ObjectAndPersistInfo |
getOrCreateObjectPersistInfoOfObject(Object object,
Boolean proxyInstance,
boolean persisted)
Get existing, or create, object and its persistence information, for an
object.
|
ObjectAndPersistInfo |
getOrCreateObjectPersistInfoOfObject(Object object,
Boolean proxyInstance,
ClassInfo objectClassInfo,
boolean persisted)
Get existing, or create, object and its persistence information, for an
object.
|
ObjectAndPersistInfo |
getOrCreateObjectPersistInfoOfObject(Object object,
boolean proxyInstance,
ClassInfo objectClassInfo,
DataRecordIdentifier dataRecordIdentifier)
Get existing, or create, object and its persistence information, for an
object.
|
IProxyManagerForObjectIO |
getProxyManager2() |
int |
getZipCompressionLevel() |
boolean |
isProxyMode() |
Object |
newInstance(Class<?> objectClass) |
Object |
newInstance(Class<?> objectClass,
Class<?>[] parameterTypes,
Object[] initargs) |
Object |
newInstanceNoConstruction(ClassInfo objectClassInfo) |
void |
newObjectLoaded() |
protected abstract void |
notToGarbage(DataRecordIdentifier dataRecordIdentifier,
ObjectAndPersistInfo objectAndPersistInfo) |
protected ObjectAndPersistInfo |
originalObjectAndPersistInfo(ObjectAndPersistInfo objectAndPersistInfo) |
void |
prepareWrite(ObjectAndPersistInfo objectAndPersistInfo)
write preparation, ensure all sons have a data record identifier
|
ObjectAndPersistInfo |
reCreateObjectReadingInStore(DataRecordIdentifier dataRecordIdentifier,
boolean notLazy) |
void |
reInitializeEnum(Enum<?> enumValue) |
void |
setInstanceFactory(IInstanceFactory instanceFactory) |
void |
setProxyMode(boolean proxyMode) |
void |
setProxyObjectState(ObjectAndPersistInfo objectAndPersistInfo)
set proxy object state reading in file
|
void |
setSpecificObjectIO(ClassInfo classInfo,
IObjectInput objectInput,
IObjectOutput objectOutput)
set object input output manager for a class
|
void |
setZipCompressionLevel(int zipCompressionLevel) |
ObjectAndPersistInfo |
substituteForWrite(ObjectAndPersistInfo objectAndPersistInfo) |
protected ObjectAndPersistInfo |
substituteObject(ObjectAndPersistInfo objectAndPersistInfo) |
ObjectClassInfoAndDeclared[] |
write(ObjectAndPersistInfo objectAndItsPersistInfo)
write object state
a data record must be associated to the object |
protected abstract void |
writeDataRecord(DataRecordIdentifier dataRecordIdentifier,
byte[] data) |
addObject, getKeptInMemorySubstituteObjectManager, isKeptInMemory, keptInMemoryoriginalObject, keptInMemorysubstituteObject, keyOfObjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCurrentFileAccessSessionIdentifier, getObjectAndPersistInfoOfObject, getStoreMutex, isAutoSaveEnabled, isExclusiveAccessSession, isMaintainInMemoryEnabled, isRunAutosaveEnableAndDisable, objectIsAccessed, setRunAutosaveEnable, unsetProxyObjectStateisValueChanged, mostAccessedObject, objectHasPersistenceState, willNotBeWroteprotected final JoafipLogger logger
protected static final String OBJECT_MUST_HAVE_DATA_RECORD_IDENTIFIER_SET
public static final HelperReflect helperReflect
public static final int HEADER_DATA_SIZE
protected final IClassNameManager classNameManager
protected final IObjectOutput[] objectOutputs
protected final ObjectInputForEnum objectInputEnum
protected final int currentDataModelIdentifier
protected final HelperBinaryConversion helperBinaryConversion
public AbstractObjectIOManagerIOForObject(int currentDataModelIdentifier,
IClassNameManager classNameManager,
boolean proxyMode,
ClassInfoFactory classInfoFactory,
HelperBinaryConversion helperBinaryConversion,
IProxyManagerForObjectIO proxyManager2)
throws ObjectIOException
ObjectIOExceptionpublic void setInstanceFactory(IInstanceFactory instanceFactory)
@Fortest public boolean isProxyMode()
@Fortest public void setProxyMode(boolean proxyMode)
public int getCurrentDataModelIdentifier()
public IProxyManagerForObjectIO getProxyManager2()
public final void setSpecificObjectIO(ClassInfo classInfo, IObjectInput objectInput, IObjectOutput objectOutput)
classInfo - the information on class for which is provide the object input
outputobjectInput - object input manager for the classobjectOutput - object output manager for the classprotected IObjectInput getObjectInput(ClassInfo classInfo, boolean notLazy) throws ObjectIOException
classInfo - the object class which for object input manager is asknotLazy - true if force not lazy modeObjectIOExceptionprotected IObjectOutput getObjectOutput(ClassInfo classInfo) throws ObjectIOException
classInfo - the object class which for object output manager is askObjectIOExceptionpublic ObjectIOInputStream getObjectIOInputStream()
public ObjectIOOutputStream getObjectIOOutputStream()
public ClassInfoFactory getClassInfoFactory()
public int getZipCompressionLevel()
public void setZipCompressionLevel(int zipCompressionLevel)
zipCompressionLevel - the zip the compression level for object storing using zipped
serializationpublic ClassInfo getClassInfoInDataRecord(DataRecordIdentifier dataRecordIdentifier) throws ObjectIOException, ObjectIODataCorruptedException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException
protected abstract byte[] getDataOfDataRecord(DataRecordIdentifier dataRecordIdentifier) throws ObjectIOException, ObjectIODataCorruptedException, ObjectIODataRecordNotFoundException
dataRecordIdentifier - data record identifierObjectIOException - reading errorObjectIODataCorruptedExceptionObjectIODataRecordNotFoundExceptionpublic DataRecordIdentifier getOrCreateDataRecordIdentifierAssociatedToObject(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException, ObjectIODataCorruptedException
IObjectIOManagerForObjectIOObjectIOExceptionObjectIODataCorruptedExceptionpublic ObjectAndPersistInfo substituteForWrite(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException, ObjectIODataCorruptedException
protected abstract DataRecordIdentifier associateNewDataRecordIdentifierToObject(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIODataCorruptedException, ObjectIOException
public ObjectAndPersistInfo createObjectReadingInStoreOrGetExisting(DataRecordIdentifier dataRecordIdentifier, boolean notLazy) throws ObjectIOException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException, ObjectIOInvalidClassException, ObjectIODataCorruptedException, ObjectIONotSerializableException
IObjectIOManagerForObjectIOInteger.valueOf(int) or Enum.valueOf(Class, String) ), if
object already created it can have data record identifier different from
dataRecordIdentifier parameterdataRecordIdentifier - identifier of data record associated to objectnotLazy - true if force not lazy modeObjectIOException - create object errorObjectIODataRecordNotFoundException - data record for object not foundObjectIOClassNotFoundExceptionObjectIOInvalidClassExceptionObjectIODataCorruptedExceptionObjectIONotSerializableExceptionpublic abstract ObjectAndPersistInfo getObjectByIdentifier(DataRecordIdentifier identifier)
identifier - data record identifierpublic ObjectAndPersistInfo reCreateObjectReadingInStore(DataRecordIdentifier dataRecordIdentifier, boolean notLazy) throws ObjectIOException, ObjectIODataCorruptedException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException, ObjectIOInvalidClassException, ObjectIONotSerializableException
protected abstract void clearObjectAndPersistInfoByDataRecordIdentifier(DataRecordIdentifier identifier)
protected ObjectAndPersistInfo createObjectReadingInStore(DataRecordIdentifier dataRecordIdentifier, boolean notLazy) throws ObjectIOException, ObjectIODataCorruptedException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException, ObjectIOInvalidClassException, ObjectIONotSerializableException
dataRecordIdentifier - notLazy - true if force not lazy modeObjectIOExceptionObjectIODataCorruptedExceptionObjectIODataRecordNotFoundExceptionObjectIOClassNotFoundExceptionObjectIOInvalidClassExceptionObjectIONotSerializableExceptionprotected abstract void notToGarbage(DataRecordIdentifier dataRecordIdentifier, ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException
ObjectIOExceptionpublic void setProxyObjectState(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException, ObjectIODataRecordNotFoundException, ObjectIOInvalidClassException, ObjectIOClassNotFoundException, ObjectIODataCorruptedException, ObjectIONotSerializableException
IObjectIOManagerForProxyObjectIOobjectAndPersistInfo - object that must be a proxyObjectIOException - set object state errorObjectIODataRecordNotFoundException - data record for object not foundObjectIOInvalidClassExceptionObjectIOClassNotFoundExceptionObjectIODataCorruptedExceptionObjectIONotSerializableExceptionpublic void newObjectLoaded()
throws ObjectIOException
ObjectIOExceptionprotected abstract void checkForAutoSave()
throws ObjectIOException
ObjectIOExceptionprotected void assertNotSubstituted(ObjectAndItsClassInfo objectAndItsClassInfo) throws ObjectIOException
ObjectIOExceptionprotected ObjectAndPersistInfo originalObjectAndPersistInfo(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException, ObjectIODataCorruptedException, ObjectIODataRecordNotFoundException, ObjectIOInvalidClassException, ObjectIOClassNotFoundException, ObjectIONotSerializableException
public byte[] getBodyDataFromRecord(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException, ObjectIODataCorruptedException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException
ObjectIOExceptionObjectIODataCorruptedExceptionObjectIODataRecordNotFoundExceptionObjectIOClassNotFoundExceptionpublic ObjectLinkTreeNode getObjectLinkTreeNode(DataRecordIdentifier dataRecordIdentifier) throws ObjectIOException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException, ObjectIODataCorruptedException
IObjectIoManagerForGarbagedataRecordIdentifier - the identifier of the data record associated to objectObjectIOExceptionObjectIODataRecordNotFoundExceptionObjectIOClassNotFoundExceptionObjectIODataCorruptedExceptionpublic ObjectClassInfoAndDeclared[] write(ObjectAndPersistInfo objectAndItsPersistInfo) throws ObjectIOException, ObjectIOInvalidClassException, ObjectIONotSerializableException, ObjectIOClassNotFoundException, ObjectIODataRecordNotFoundException, ObjectIODataCorruptedException
IObjectIOManagerForSaveObjectIOException - write errorObjectIOInvalidClassExceptionObjectIONotSerializableExceptionObjectIOClassNotFoundExceptionObjectIODataRecordNotFoundExceptionObjectIODataCorruptedExceptionprotected abstract void writeDataRecord(DataRecordIdentifier dataRecordIdentifier, byte[] data) throws ObjectIOException
ObjectIOExceptionpublic void prepareWrite(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException, ObjectIOInvalidClassException, ObjectIONotSerializableException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException, ObjectIODataCorruptedException, ObjectIOTooBigForSerializationException
IObjectIOManagerForSaveprotected ObjectAndPersistInfo substituteObject(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException, ObjectIODataCorruptedException
public ObjectAndPersistInfo getOrCreateObjectPersistInfoOfObject(Object object, Boolean proxyInstance, boolean persisted) throws ObjectIOException, ObjectIODataCorruptedException
IObjectIOManagerForProxyObjectIOobject - the object which for object and its persistence information is
askproxyInstance - true if object is a proxy instance (use by creation only)persisted - true if object to be persistedObjectIOExceptionObjectIODataCorruptedExceptionpublic ObjectAndPersistInfo getOrCreateObjectPersistInfoOfObject(Object object, Boolean proxyInstance, ClassInfo objectClassInfo, boolean persisted) throws ObjectIOException, ObjectIODataCorruptedException
IObjectIOManagerForProxyObjectIOobject - the object which for object and its persistence information is
askproxyInstance - true if object is proxy instance (use by creation only)objectClassInfo - the class information of the objectpersisted - true if object to be persistedObjectIOExceptionObjectIODataCorruptedExceptionpublic ObjectAndPersistInfo createObjectPersistInfoOfObject(Object object, Boolean proxyInstance, ClassInfo objectClassInfo, boolean persisted) throws ObjectIOException, ObjectIODataCorruptedException
protected abstract ObjectAndPersistInfo createObjectAndPersistInfoOfObjectImpl(Object object, boolean proxyInstance, ClassInfo objectClassInfo) throws ObjectIOException
ObjectIOExceptionprotected abstract ObjectAndPersistInfo createSubstitutedObjectAndPersistInfoOfObjectImpl(Object object, ClassInfo objectClassInfo, ObjectAndPersistInfo substituteObjectAndPersistInfo) throws ObjectIOException
ObjectIOExceptionprotected ObjectAndPersistInfo createSubstituteObjectPersistInfoOfObject(Object substituteObject, ClassInfo substituteClassInfo, ObjectAndPersistInfo substitutedObjectAndPersistInfo) throws ObjectIOException
createSubstituteObjectPersistInfoOfObject in class AbstractObjectIOManagerKeptInMemoryObjectIOExceptionpublic ObjectAndPersistInfo getOrCreateObjectPersistInfoOfObject(Object object, boolean proxyInstance, ClassInfo objectClassInfo, DataRecordIdentifier dataRecordIdentifier) throws ObjectIOException, ObjectIODataCorruptedException
IObjectIOManagerForProxyObjectIOobject - the object which for object and its persistence information is
askproxyInstance - true if object is proxy instanceobjectClassInfo - the class information of the objectdataRecordIdentifier - the data record identifier to associate to the objectObjectIOExceptionObjectIODataCorruptedExceptionpublic ObjectAndPersistInfo createObjectPersistInfoOfObject(Object object, boolean proxyInstance, ClassInfo objectClassInfo, DataRecordIdentifier dataRecordIdentifier) throws ObjectIOException
ObjectIOExceptionpublic abstract void dataRecordIdentifierAssociatedToObjectSetted(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException
objectAndItsClassInfo - ObjectIOExceptionpublic void reInitializeEnum(Enum<?> enumValue) throws ObjectIOException, ObjectIODataCorruptedException
public Object deepCopy(Object sourceObject) throws CopierException
CopierExceptionpublic Object newInstance(Class<?> objectClass, Class<?>[] parameterTypes, Object[] initargs)
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.