Encode an rmi RemoteObject as a URI.
The object must be a RemoteObject, and the ".getRef()" must be
of type UnicastRef. This implementation is strongly tied
to the serialization format of the RMI infrastructure. However,
Sun strives to keep RMI stable across JDK releases, so I don't
expect this to be a problem...
For example, given an object with a ".toString()" of:
"com.foo.Bar_Stub[RemoteStub [ref: [endpoint:[127.0.0.1:45123](remote),objID:[189d0c:f2389d89ac:-8000, 0]]]]"
the generated URI will look like:
"rmi://127.0.0.1:45123/com.foo.Bar_Stub/1_189d0c_f2389d89ac_-8000_0"
. Note that the server-side object's ".toString()" will
hide the ObjID and look more like:
"com.foo.Bar_Stub[RemoteStub [ref: [endpoint:[127.0.0.1:45123](local),objID:[0]]]]"
but we work around that here.
Parameters: o - a RemoteObject to encode the URI representation See Also: RMIRemoteObjectDecoder.decode(URI) |