public class LegacyObject
extends java.lang.Object
implements java.io.Externalizable
object instances over the network, for i.e. appserver calls.| Modifier and Type | Class and Description |
|---|---|
static class |
LegacyObject.LegacyArray
Serializable storage of a BDT array associated with a field.
|
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
legacyClass
The legacy type being transported.
|
private boolean |
local
Flag indicating whether the appserver, which sent the object, is running in the same
JVM as the requester.
|
private static CentralLogger |
LOG
Logger
|
private java.util.LinkedHashMap<java.lang.reflect.Field,java.lang.Object> |
serialized
Serialization of each instance field.
|
private java.lang.Class<? extends _BaseObject_> |
type
The converted type of the object being transported.
|
private boolean |
unknown
Flag indicating if this is an unknown instance.
|
| Constructor and Description |
|---|
LegacyObject()
Default c'tor, used for deserialization.
|
LegacyObject(object<? extends _BaseObject_> o)
Calls
serialize(com.goldencode.p2j.util.object<? extends com.goldencode.p2j.oo.lang._BaseObject_>) in order to prepare the object to be transported over network. |
LegacyObject(object<? extends _BaseObject_> o,
boolean local)
Calls
serialize(com.goldencode.p2j.util.object<? extends com.goldencode.p2j.oo.lang._BaseObject_>) in order to prepare the object to be transported over network. |
| Modifier and Type | Method and Description |
|---|---|
void |
assign(LegacyObject ref) |
private java.util.ArrayList<java.lang.reflect.Field> |
collectInstanceFields(_BaseObject_ ref)
Collect all instance fields defined in the reference's type.
|
private void |
deserialize(java.lang.Object dest,
BaseDataType ser)
Restore the given field from its serialized state.
|
private void |
deserializeDataSet(java.lang.Object dest,
longchar ser)
Restore the given
DataSet field from its serialized state. |
private void |
deserializeHandle(java.lang.Object dest,
handle ser)
Restore the given
handle field from its serialized state. |
private void |
deserializeMemptr(java.lang.Object dest,
MemoryBuffer ser)
Restore the given
memptr field from its serialized state. |
private boolean |
deserializeObject(java.lang.Class<?> ftype,
java.lang.Object dest,
java.lang.Object ser)
Restore the state of a field using the received (serialized) value.
|
private void |
deserializeObject(java.lang.Object dest,
LegacyObject ser)
Restore the given
object field from its serialized state. |
private void |
deserializeTable(java.lang.Object dest,
TableWrapper ser)
Restore the given table field from its serialized state.
|
java.lang.Class<? extends _BaseObject_> |
getType()
Get the object's
type. |
private static TableWrapper |
preProcessTable(TableWrapper tableWrapper)
This method emulates as if
TableWrapper was sent over the network. |
void |
readExternal(java.io.ObjectInput in)
Initialize this instance by reading its state from the specified stream.
|
_BaseObject_ |
restore()
Create a new instance and set its state from the
serialized information. |
(package private) _BaseObject_ |
restore(boolean local)
Create a new instance and set its state from the
serialized information. |
private void |
restoreField(java.lang.reflect.Field f,
_BaseObject_ ref,
java.lang.Object ser)
Restore the given field from its serialized state.
|
private void |
save(_BaseObject_ ref)
Serialize the given reference.
|
private static java.io.Externalizable |
serialize(BaseDataType ref)
Get the field's serialized state.
|
private void |
serialize(object<? extends _BaseObject_> o)
Serialize the given
object reference, and save it, to be transported over network. |
private static java.io.Externalizable |
serializeDataSet(DataSet dataSet)
Get the field's serialized state.
|
private java.lang.Object |
serializeField(_BaseObject_ ref,
java.lang.reflect.Field f)
Get the field's serialized state.
|
private static java.lang.Object |
serializeField(java.lang.Class<?> ftype,
java.lang.Object val)
Get the field's value using a serializable instance, assuming that
the sent object is not being transported in the same JVM.
|
private static java.lang.Object |
serializeField(java.lang.Class<?> ftype,
java.lang.Object val,
boolean local)
Get the field's value using a serializable instance.
|
private static java.io.Externalizable |
serializeHandle(handle ref)
Get the field's serialized state.
|
private static java.io.Externalizable |
serializeMemptr(memptr ref)
Get the field's serialized state.
|
private static java.io.Externalizable |
serializeObject(object ref)
Get the field's serialized state.
|
private static java.io.Externalizable |
serializeTable(Buffer buffer,
boolean local)
Get the field's serialized state.
|
void |
writeExternal(java.io.ObjectOutput out)
Write the state of this instance to the specified stream.
|
private static final CentralLogger LOG
private java.lang.String legacyClass
private boolean unknown
private java.lang.Class<? extends _BaseObject_> type
private java.util.LinkedHashMap<java.lang.reflect.Field,java.lang.Object> serialized
private boolean local
public LegacyObject()
public LegacyObject(object<? extends _BaseObject_> o, boolean local)
serialize(com.goldencode.p2j.util.object<? extends com.goldencode.p2j.oo.lang._BaseObject_>) in order to prepare the object to be transported over network.o - The instance.local - Flag indicating if the object is being transported in the same JVM.public LegacyObject(object<? extends _BaseObject_> o)
serialize(com.goldencode.p2j.util.object<? extends com.goldencode.p2j.oo.lang._BaseObject_>) in order to prepare the object to be transported over network.o - The instance.public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizableout - The stream where the state of this instance will be sent.java.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablein - The stream from where the state of this instance will be read.java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic java.lang.Class<? extends _BaseObject_> getType()
type.public void assign(LegacyObject ref)
public _BaseObject_ restore()
serialized information._BaseObject_ restore(boolean local)
serialized information.local - Flag indicating if the object is being transported in the same JVM.private void serialize(object<? extends _BaseObject_> o)
object reference, and save it, to be transported over network.o - private void save(_BaseObject_ ref)
ref - The reference to serialize.private void restoreField(java.lang.reflect.Field f,
_BaseObject_ ref,
java.lang.Object ser)
throws java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
f - The field to restore.ref - The reference where the field needs to be set.ser - The field's new value, which will either be assigned or set directly.java.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionprivate boolean deserializeObject(java.lang.Class<?> ftype,
java.lang.Object dest,
java.lang.Object ser)
ftype - The field's type.dest - The field's current value.ser - The field's value to be assigned.true if the field was updated.private void deserialize(java.lang.Object dest,
BaseDataType ser)
dest - The reference where the field needs to be set.ser - The serialized state.private void deserializeTable(java.lang.Object dest,
TableWrapper ser)
dest - The reference where the field needs to be set.ser - The serialized state.private void deserializeDataSet(java.lang.Object dest,
longchar ser)
DataSet field from its serialized state.dest - The reference where the field needs to be set.ser - The serialized state.private void deserializeMemptr(java.lang.Object dest,
MemoryBuffer ser)
memptr field from its serialized state.dest - The reference where the field needs to be set.ser - The serialized state.private void deserializeHandle(java.lang.Object dest,
handle ser)
handle field from its serialized state.dest - The reference where the field needs to be set.ser - The serialized state.private void deserializeObject(java.lang.Object dest,
LegacyObject ser)
object field from its serialized state.dest - The reference where the field needs to be set.ser - The serialized state.private java.lang.Object serializeField(_BaseObject_ ref, java.lang.reflect.Field f) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException
ref - The reference from where the field is read.f - The field to read.java.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionprivate static java.lang.Object serializeField(java.lang.Class<?> ftype,
java.lang.Object val)
ftype - The field's type.val - The field's value.private static java.lang.Object serializeField(java.lang.Class<?> ftype,
java.lang.Object val,
boolean local)
ftype - The field's type.val - The field's value.local - Flag indicating if the object is being transported in the same JVM.private static java.io.Externalizable serialize(BaseDataType ref)
ref - The field's value.private static java.io.Externalizable serializeTable(Buffer buffer, boolean local)
buffer - The field's value.private static TableWrapper preProcessTable(TableWrapper tableWrapper)
TableWrapper was sent over the network.tableWrapper - The TableWrapper object which has to be serialized.private static java.io.Externalizable serializeDataSet(DataSet dataSet)
dataSet - The field's value.private static java.io.Externalizable serializeMemptr(memptr ref)
ref - The field's value.private static java.io.Externalizable serializeHandle(handle ref)
ref - The field's value.private static java.io.Externalizable serializeObject(object ref)
ref - The field's value.private java.util.ArrayList<java.lang.reflect.Field> collectInstanceFields(_BaseObject_ ref)
ref - The reference.