It would seem appropriate to generify the java.rmi.MarshalledObject API as follows:
public final class MarshalledObject<T> implements Serializable {
public MarshalledObject(T obj) throws IOException { ... }
public T get() throws IOException, ClassNotFoundException { ... }
...
}
With such a generification, a program element could be declared to be not just a MarshalledObject, but a MarshalledObject that contains a marshalled object that is assignable to a particular reference type.
(Along with this change, other java.rmi APIs that declare MarshalledObject would have to be changed accordingly; all such declarations in existing APIs (all in java.rmi.activation) would probably be changed to MarshalledObject<?>.)
public final class MarshalledObject<T> implements Serializable {
public MarshalledObject(T obj) throws IOException { ... }
public T get() throws IOException, ClassNotFoundException { ... }
...
}
With such a generification, a program element could be declared to be not just a MarshalledObject, but a MarshalledObject that contains a marshalled object that is assignable to a particular reference type.
(Along with this change, other java.rmi APIs that declare MarshalledObject would have to be changed accordingly; all such declarations in existing APIs (all in java.rmi.activation) would probably be changed to MarshalledObject<?>.)
- relates to
-
JDK-6278052 Uses of MarshalledObject in JMX API should be generified
-
- Resolved
-