问题
When using standard Java serialization, it is possible to have an object replaced on the fly in stream by, according to Serializable interface, creating a Object writeReplace()
method that will be invoked during serialization.
My question is simple : is there an equivalent for this construct in Corba Java implementation ?
回答1:
You can use writeReplace
as normal with RMI-IIOP (Java RMI over CORBA/IIOP). The ORB presents "standard" Java serialization of Serializable/Externalizable (with all associated features) and marshals them as "custom marshalled" values.
回答2:
As far as I know there isn't even such a thing in the Corba specification, let alone the Java implementation.
来源:https://stackoverflow.com/questions/13252304/is-there-any-equivalent-to-writereplace-in-corba