Consider the following Java classes:
public class A implements java.io.Serializable
{
// This is a non custom class
// A's data -- omitted
// A's constructors - omitted
// A's methods -- omitted
}
public class B extends A {
// B's data – omitted here
// B's cobstructors – omitted here
// This is a custom class
private void writeObject(java.io.ObjectOutputStream s)
{ .... }
// Other methods omitted
}
public class C extends B {
// This is a non-custom class
// C's data -- omitted
// C's constructors - omitted
// C's methods -- omitted
}
public class D extends C {
// D's data – omitted here
// D's cobstructors – omitted here
// This is a custom class
private void writeObject(java.io.ObjectOutputStream s) { .... }
// Other methods omitted
}
Here we have a class inheritance hierarchy as D:C:B:A with A and C as non-custom classes, B and D as custom classes. What is the rmi-iiop data layout on the wire when an instance of D is marshaled in terms of customer header and data w.r.t. to each of the super classes? Which one of the following layout is correct?
-----------------------------------------------------------------------------------------
a. | A-Data | B-FV B-DWO B-Data | CData | FV-D DWO-D DData |
-----------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
b. | A-FV A-DWO A-Data | B-FV B-DWO B-Data | C-FV C-DWO C-Data | D-FV D- DWO DData |
-------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------
c. | A-FV A-DWO A-Data | B-Data | C-Data | DData |
---------------------------------------------------------------------------
Terms used for illustration purpose here:
A-FV ------ means the Format version octet for class A
A-DWO ------ means the defaultWriteObject boolean flag for class A
A-Data ----- means the data fields of class A.
B-FV ------ means the Format version octet for class B
B-DWO ------ means the defaultWriteObject boolean flag for class B
B-Data ----- means the data fields of class B
C-FV ------ means the Format version octet for class C
C-DWO ------ means the defaultWriteObject boolean flag for class C
C-Data ----- means the data fields of class C.
D-FV ------ means the Format version octet for class D
D-DWO ------ means the defaultWriteObject boolean flag for class D
D-Data ----- means the data fields of class D.