@NotStorableClass public class ObjectIODummy extends Object implements IObjectInput, IObjectOutput
Constructor and Description |
---|
ObjectIODummy() |
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 |
ObjectAndPersistInfo |
createObject(DataRecordIdentifier dataRecordIdentifier,
byte[] binary,
ClassInfo classInfo,
StorageInfo storageInfo)
creation of a not existing object
set data record associated to created object as soon as it is created |
DataRecordIdentifier[] |
getReferencedList(byte[] binary,
int beginOffset)
get the referenced object's data identifier from binary data containing
object state
|
boolean |
isImmediate() |
boolean |
isLazy() |
boolean |
isValueChanged(ObjectAndPersistInfo objectAndItsClassInfo)
to know if object state change according to its original value
also compute reference change list |
void |
prepareWrite(ObjectAndPersistInfo objectAndItsClassInfo)
prepare possible write of object
|
void |
setGarbageManagement(boolean garbageManagement) |
void |
setObjectState(ObjectAndPersistInfo objectAndPersistInfo,
byte[] binary,
int offset)
set state of existing object by reading in the binary data
object state is after the data header ( number of link and class name identifier) |
void |
setReferenceChangeListForNewObject(ObjectAndPersistInfo objectAndItsClassInfo)
compute reference change list for new object
|
void |
unsetObjectState(ObjectAndPersistInfo objectAndItsClassInfo) |
ObjectClassInfoAndDeclared[] |
willNotBeWrote(ObjectAndPersistInfo objectAndItsClassInfo) |
ObjectClassInfoAndDeclared[] |
writeBody(byte[] binary,
int bodyBeginOffset,
ObjectAndPersistInfo objectAndItsClassInfo,
boolean updateOriginalValue)
write body: body is data after number of link that represent object state
|
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 ObjectAndPersistInfo createObject(DataRecordIdentifier dataRecordIdentifier, byte[] binary, ClassInfo classInfo, StorageInfo storageInfo) throws ObjectIOException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException, ObjectIOInvalidClassException, ObjectIODataCorruptedException, ObjectIONotSerializableException
IObjectInput
createObject
in interface IObjectInput
dataRecordIdentifier
- the data record identifier for data record that contains
object statebinary
- data of data record for objectclassInfo
- the object class information.the class can not exist.the
object class can be different than object.getClass()ObjectIOException
- object creation errorObjectIODataRecordNotFoundException
- data record for object not foundObjectIOClassNotFoundException
ObjectIOInvalidClassException
ObjectIODataCorruptedException
ObjectIONotSerializableException
public DataRecordIdentifier[] getReferencedList(byte[] binary, int beginOffset) throws ObjectIOException
IObjectInput
getReferencedList
in interface IObjectInput
binary
- binary data of data record associated to objectbeginOffset
- start of field/element data in binaryObjectIOException
public boolean isImmediate()
isImmediate
in interface IObjectInput
public boolean isLazy()
isLazy
in interface IObjectInput
public boolean isValueChanged(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException, ObjectIODataCorruptedException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException
IObjectOutput
isValueChanged
in interface IObjectOutput
objectAndItsClassInfo
- the object to testObjectIOException
ObjectIODataCorruptedException
ObjectIODataRecordNotFoundException
ObjectIOClassNotFoundException
public void prepareWrite(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException, ObjectIOInvalidClassException, ObjectIONotSerializableException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException, ObjectIODataCorruptedException
IObjectOutput
prepareWrite
in interface IObjectOutput
objectAndItsClassInfo
- the objectObjectIOException
ObjectIOInvalidClassException
ObjectIONotSerializableException
ObjectIODataRecordNotFoundException
ObjectIOClassNotFoundException
ObjectIODataCorruptedException
public void setGarbageManagement(boolean garbageManagement)
setGarbageManagement
in interface IObjectOutput
public void setObjectState(ObjectAndPersistInfo objectAndPersistInfo, byte[] binary, int offset) throws ObjectIOException, ObjectIODataRecordNotFoundException, ObjectIOInvalidClassException, ObjectIOClassNotFoundException, ObjectIODataCorruptedException, ObjectIONotSerializableException
IObjectInput
setObjectState
in interface IObjectInput
objectAndPersistInfo
- object to setbinary
- binary data containing the object stateoffset
- begin of body data in record, it is header data sizeObjectIOException
- reading errorObjectIODataRecordNotFoundException
- data record not found in fileObjectIOInvalidClassException
ObjectIOClassNotFoundException
ObjectIODataCorruptedException
ObjectIONotSerializableException
public void setReferenceChangeListForNewObject(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException
IObjectOutput
setReferenceChangeListForNewObject
in interface IObjectOutput
ObjectIOException
public void unsetObjectState(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException, ObjectIOInvalidClassException
unsetObjectState
in interface IObjectInput
ObjectIOException
ObjectIOInvalidClassException
public ObjectClassInfoAndDeclared[] willNotBeWrote(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException
willNotBeWrote
in interface IObjectOutput
objectAndItsClassInfo
- the object which for state will not be wroteObjectIOException
public ObjectClassInfoAndDeclared[] writeBody(byte[] binary, int bodyBeginOffset, ObjectAndPersistInfo objectAndItsClassInfo, 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
sizeobjectAndItsClassInfo
- 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
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.