@NotStorableClass public abstract class AbstractObjectOutput extends Object implements IObjectOutput
Modifier and Type | Field and Description |
---|---|
protected ClassInfoFactory |
classInfoFactory |
protected HelperBinaryConversion |
helperBinaryConversion |
protected static HelperReflect |
helperReflect |
protected JoafipLogger |
logger |
protected static ObjectClassInfoAndDeclared[] |
NO_SOONS |
protected IObjectIOManagerForObjectIO |
objectIOManager |
protected IProxyManagerForObjectIO |
proxyManager2 |
Constructor and Description |
---|
AbstractObjectOutput(IObjectIOManagerForObjectIO objectIOManager,
ClassInfoFactory classInfoFactory,
IProxyManagerForObjectIO proxyManager2,
HelperBinaryConversion helperBinaryConversion) |
Modifier and Type | Method and Description |
---|---|
int |
byteSize(ObjectAndPersistInfo objectAndItsClassInfo,
int headerDataSize)
compute bytes needs to store an object state for a class
it is number of byte to store object state + bytes to store object class identifier |
protected int |
byteSizeForFieldOrElement(ClassInfo typeInfo) |
protected void |
computeReferenceChangeList(ObjectAndPersistInfo objectAndPersistInfo) |
protected ObjectClassInfoAndDeclared[] |
currentValuesToReferencedSoon(ObjectAndPersistInfo objectAndPersistInfo) |
IObjectIOManagerForObjectIO |
getObjectIOManager() |
boolean |
isGenericValueChanged(ObjectAndPersistInfo objectAndPersistInfo)
test if value changed
also compute reference change list |
abstract int |
numberOfByteForData(ObjectAndPersistInfo objectAndItsClassInfo)
obtains the number of bytes need to store object state
|
void |
setGarbageManagement(boolean garbageManagement) |
protected void |
setReferenceChangeListForGeneric(ObjectAndPersistInfo objectAndItsClassInfo)
compute reference change list for new object
|
ObjectClassInfoAndDeclared[] |
willNotBeWrote(ObjectAndPersistInfo objectAndPersistInfo) |
protected abstract ObjectClassInfoAndDeclared[] |
willNotBeWroteImpl(ObjectAndPersistInfo objectAndPersistInfo) |
ObjectClassInfoAndDeclared[] |
writeBody(byte[] binary,
int bodyBeginOffset,
ObjectAndPersistInfo objectAndPersistInfo,
boolean updateOriginalValue)
write body: body is data after number of link that represent object state
|
protected abstract ObjectClassInfoAndDeclared[] |
writeBodyAndItsHeader(byte[] binary,
int bodyBeginOffset,
ObjectAndPersistInfo objectAndItsClassInfo,
boolean updateOriginalValue) |
ObjectClassInfoAndDeclared[] |
writeCurrentValue(byte[] binary,
int fieldBeginOffset,
ObjectAndPersistInfo objectAndPersistInfo,
boolean updateOriginalValue) |
protected int |
writeSignature(byte[] binary,
int signatureBeginOffset,
ClassInfo classInfo)
check signature according off object class
|
protected int |
writeStaticFieldSignature(byte[] binary,
int signatureBeginOffset,
ClassInfo classInfo) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isValueChanged, prepareWrite, setReferenceChangeListForNewObject
protected final JoafipLogger logger
protected static final ObjectClassInfoAndDeclared[] NO_SOONS
protected final ClassInfoFactory classInfoFactory
protected final HelperBinaryConversion helperBinaryConversion
protected static final HelperReflect helperReflect
protected final IObjectIOManagerForObjectIO objectIOManager
protected final IProxyManagerForObjectIO proxyManager2
public AbstractObjectOutput(IObjectIOManagerForObjectIO objectIOManager, ClassInfoFactory classInfoFactory, IProxyManagerForObjectIO proxyManager2, HelperBinaryConversion helperBinaryConversion)
public void setGarbageManagement(boolean garbageManagement)
setGarbageManagement
in interface IObjectOutput
public IObjectIOManagerForObjectIO getObjectIOManager()
public int byteSize(ObjectAndPersistInfo objectAndItsClassInfo, int headerDataSize) throws ObjectIOException, ObjectIOInvalidClassException, ObjectIONotSerializableException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException, ObjectIODataCorruptedException
IObjectOutput
byteSize
in interface IObjectOutput
objectAndItsClassInfo
- the objectObjectIOException
- data to store size errorObjectIOInvalidClassException
ObjectIONotSerializableException
ObjectIODataRecordNotFoundException
ObjectIOClassNotFoundException
ObjectIODataCorruptedException
public abstract int numberOfByteForData(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException, ObjectIOInvalidClassException, ObjectIONotSerializableException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException, ObjectIODataCorruptedException
objectAndItsClassInfo
- the objectObjectIOException
ObjectIONotSerializableException
ObjectIOInvalidClassException
ObjectIODataCorruptedException
ObjectIOClassNotFoundException
ObjectIODataRecordNotFoundException
public ObjectClassInfoAndDeclared[] writeBody(byte[] binary, int bodyBeginOffset, ObjectAndPersistInfo objectAndPersistInfo, boolean updateOriginalValue) throws ObjectIOException, ObjectIOInvalidClassException, ObjectIONotSerializableException, ObjectIODataCorruptedException
IObjectOutput
writeBody
in interface IObjectOutput
binary
- binary data of data record associated to objectbodyBeginOffset
- offset in binary data of begin of body, it is the header data
sizeobjectAndPersistInfo
- the object which for state is to writeupdateOriginalValue
- true if set original value to current value ( true only when
serialization is done to update heap file )ObjectIOException
ObjectIOInvalidClassException
ObjectIONotSerializableException
ObjectIODataCorruptedException
public ObjectClassInfoAndDeclared[] willNotBeWrote(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException
willNotBeWrote
in interface IObjectOutput
objectAndPersistInfo
- the object which for state will not be wroteObjectIOException
protected abstract ObjectClassInfoAndDeclared[] willNotBeWroteImpl(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException
ObjectIOException
protected abstract ObjectClassInfoAndDeclared[] writeBodyAndItsHeader(byte[] binary, int bodyBeginOffset, ObjectAndPersistInfo objectAndItsClassInfo, boolean updateOriginalValue) throws ObjectIOException, ObjectIODataCorruptedException, ObjectIOInvalidClassException, ObjectIONotSerializableException
binary
- binary data of data record associated to objectbodyBeginOffset
- offset in binary data of begin of bodyobjectAndItsClassInfo
- the object which for state is to writeupdateOriginalValue
- true if set original value to current value ( true only when
serialization is done to update heap file )ObjectIOException
ObjectIODataCorruptedException
ObjectIOInvalidClassException
ObjectIONotSerializableException
protected int byteSizeForFieldOrElement(ClassInfo typeInfo)
typeInfo
- the field type or component typeprotected int writeSignature(byte[] binary, int signatureBeginOffset, ClassInfo classInfo) throws ObjectIOException
binary
- binary data to write tosignatureBeginOffset
- signature offset in binary dataclassInfo
- class information of object used for signatureObjectIOException
protected int writeStaticFieldSignature(byte[] binary, int signatureBeginOffset, ClassInfo classInfo) throws ObjectIOException
ObjectIOException
public ObjectClassInfoAndDeclared[] writeCurrentValue(byte[] binary, int fieldBeginOffset, ObjectAndPersistInfo objectAndPersistInfo, boolean updateOriginalValue) throws ObjectIOException, ObjectIODataCorruptedException
binary
- binary data of data record associated to objectfieldBeginOffset
- offset in binary data of begin of bodyobjectAndPersistInfo
- the object which for state is to writeupdateOriginalValue
- true if set original value to current value ( true only when
serialization is done to update heap file )ObjectIOException
ObjectIODataCorruptedException
public boolean isGenericValueChanged(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException
objectAndPersistInfo
- ObjectIOException
protected void computeReferenceChangeList(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException
ObjectIOException
protected void setReferenceChangeListForGeneric(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException
objectAndItsClassInfo
- ObjectIOException
protected ObjectClassInfoAndDeclared[] currentValuesToReferencedSoon(ObjectAndPersistInfo objectAndPersistInfo) throws ObjectIOException
ObjectIOException
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.