@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
IObjectOutputbyteSize in interface IObjectOutputobjectAndItsClassInfo - the objectObjectIOException - data to store size errorObjectIOInvalidClassExceptionObjectIONotSerializableExceptionObjectIODataRecordNotFoundExceptionObjectIOClassNotFoundExceptionObjectIODataCorruptedExceptionpublic ObjectAndPersistInfo createObject(DataRecordIdentifier dataRecordIdentifier, byte[] binary, ClassInfo classInfo, StorageInfo storageInfo) throws ObjectIOException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException, ObjectIOInvalidClassException, ObjectIODataCorruptedException, ObjectIONotSerializableException
IObjectInputcreateObject in interface IObjectInputdataRecordIdentifier - 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 foundObjectIOClassNotFoundExceptionObjectIOInvalidClassExceptionObjectIODataCorruptedExceptionObjectIONotSerializableExceptionpublic DataRecordIdentifier[] getReferencedList(byte[] binary, int beginOffset) throws ObjectIOException
IObjectInputgetReferencedList in interface IObjectInputbinary - binary data of data record associated to objectbeginOffset - start of field/element data in binaryObjectIOExceptionpublic boolean isImmediate()
isImmediate in interface IObjectInputpublic boolean isLazy()
isLazy in interface IObjectInputpublic boolean isValueChanged(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException, ObjectIODataCorruptedException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException
IObjectOutputisValueChanged in interface IObjectOutputobjectAndItsClassInfo - the object to testObjectIOExceptionObjectIODataCorruptedExceptionObjectIODataRecordNotFoundExceptionObjectIOClassNotFoundExceptionpublic void prepareWrite(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException, ObjectIOInvalidClassException, ObjectIONotSerializableException, ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException, ObjectIODataCorruptedException
IObjectOutputprepareWrite in interface IObjectOutputobjectAndItsClassInfo - the objectObjectIOExceptionObjectIOInvalidClassExceptionObjectIONotSerializableExceptionObjectIODataRecordNotFoundExceptionObjectIOClassNotFoundExceptionObjectIODataCorruptedExceptionpublic void setGarbageManagement(boolean garbageManagement)
setGarbageManagement in interface IObjectOutputpublic void setObjectState(ObjectAndPersistInfo objectAndPersistInfo, byte[] binary, int offset) throws ObjectIOException, ObjectIODataRecordNotFoundException, ObjectIOInvalidClassException, ObjectIOClassNotFoundException, ObjectIODataCorruptedException, ObjectIONotSerializableException
IObjectInputsetObjectState in interface IObjectInputobjectAndPersistInfo - 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 fileObjectIOInvalidClassExceptionObjectIOClassNotFoundExceptionObjectIODataCorruptedExceptionObjectIONotSerializableExceptionpublic void setReferenceChangeListForNewObject(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException
IObjectOutputsetReferenceChangeListForNewObject in interface IObjectOutputObjectIOExceptionpublic void unsetObjectState(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException, ObjectIOInvalidClassException
unsetObjectState in interface IObjectInputObjectIOExceptionObjectIOInvalidClassExceptionpublic ObjectClassInfoAndDeclared[] willNotBeWrote(ObjectAndPersistInfo objectAndItsClassInfo) throws ObjectIOException
willNotBeWrote in interface IObjectOutputobjectAndItsClassInfo - the object which for state will not be wroteObjectIOExceptionpublic ObjectClassInfoAndDeclared[] writeBody(byte[] binary, int bodyBeginOffset, ObjectAndPersistInfo objectAndItsClassInfo, boolean updateOriginalValue) throws ObjectIOException, ObjectIOInvalidClassException, ObjectIONotSerializableException, ObjectIODataCorruptedException
IObjectOutputwriteBody in interface IObjectOutputbinary - 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 )ObjectIOExceptionObjectIOInvalidClassExceptionObjectIONotSerializableExceptionObjectIODataCorruptedExceptionCopyright © 2007-2012 Luc Peuvrier. All Rights Reserved.