39 /**
40 * NOTE: There is a JDK-internal dependency on the existence of this
41 * class and its getClientSocketFactory method in the implementation
42 * of javax.management.remote.rmi.RMIConnector.
43 **/
44 public class LiveRef implements Cloneable {
45 /** wire representation for the object*/
46 private final Endpoint ep;
47 private final ObjID id;
48
49 /** cached connection service for the object */
50 private transient Channel ch;
51
52 /** flag to indicate whether this ref specifies a local server or
53 * is a ref for a remote object (surrogate)
54 */
55 private final boolean isLocal;
56
57 /**
58 * Construct a "well-known" live reference to a remote object
59 * @param isLocalServer If true, indicates this ref specifies a local
60 * server in this address space; if false, the ref is for a remote
61 * object (hence a surrogate or proxy) in another address space.
62 */
63 public LiveRef(ObjID objID, Endpoint endpoint, boolean isLocal) {
64 ep = endpoint;
65 id = objID;
66 this.isLocal = isLocal;
67 }
68
69 /**
70 * Construct a new live reference for a server object in the local
71 * address space.
72 */
73 public LiveRef(int port) {
74 this((new ObjID()), port);
75 }
76
77 /**
78 * Construct a new live reference for a server object in the local
79 * address space, to use sockets of the specified type.
|
39 /**
40 * NOTE: There is a JDK-internal dependency on the existence of this
41 * class and its getClientSocketFactory method in the implementation
42 * of javax.management.remote.rmi.RMIConnector.
43 **/
44 public class LiveRef implements Cloneable {
45 /** wire representation for the object*/
46 private final Endpoint ep;
47 private final ObjID id;
48
49 /** cached connection service for the object */
50 private transient Channel ch;
51
52 /** flag to indicate whether this ref specifies a local server or
53 * is a ref for a remote object (surrogate)
54 */
55 private final boolean isLocal;
56
57 /**
58 * Construct a "well-known" live reference to a remote object
59 * @param isLocal If true, indicates this ref specifies a local
60 * server in this address space; if false, the ref is for a remote
61 * object (hence a surrogate or proxy) in another address space.
62 */
63 public LiveRef(ObjID objID, Endpoint endpoint, boolean isLocal) {
64 ep = endpoint;
65 id = objID;
66 this.isLocal = isLocal;
67 }
68
69 /**
70 * Construct a new live reference for a server object in the local
71 * address space.
72 */
73 public LiveRef(int port) {
74 this((new ObjID()), port);
75 }
76
77 /**
78 * Construct a new live reference for a server object in the local
79 * address space, to use sockets of the specified type.
|