56
57 private ActivationID id;
58 /** indicate compatibility with the Java 2 SDK v1.2 version of class */
59 private static final long serialVersionUID = -3120617863591563455L;
60
61 /**
62 * Constructs an activatable remote object by registering
63 * an activation descriptor (with the specified location, data, and
64 * restart mode) for this object, and exporting the object with the
65 * specified port.
66 *
67 * <p><strong>Note:</strong> Using the <code>Activatable</code>
68 * constructors that both register and export an activatable remote
69 * object is strongly discouraged because the actions of registering
70 * and exporting the remote object are <i>not</i> guaranteed to be
71 * atomic. Instead, an application should register an activation
72 * descriptor and export a remote object separately, so that exceptions
73 * can be handled properly.
74 *
75 * <p>This method invokes the {@link
76 * exportObject(Remote,String,MarshalledObject,boolean,port)
77 * exportObject} method with this object, and the specified location,
78 * data, restart mode, and port. Subsequent calls to {@link #getID}
79 * will return the activation identifier returned from the call to
80 * <code>exportObject</code>.
81 *
82 * @param location the location for classes for this object
83 * @param data the object's initialization data
84 * @param port the port on which the object is exported (an anonymous
85 * port is used if port=0)
86 * @param restart if true, the object is restarted (reactivated) when
87 * either the activator is restarted or the object's activation group
88 * is restarted after an unexpected crash; if false, the object is only
89 * activated on demand. Specifying <code>restart</code> to be
90 * <code>true</code> does not force an initial immediate activation of
91 * a newly registered object; initial activation is lazy.
92 * @exception ActivationException if object registration fails.
93 * @exception RemoteException if either of the following fails:
94 * a) registering the object with the activation system or b) exporting
95 * the object to the RMI runtime.
96 * @since 1.2
103 {
104 super();
105 id = exportObject(this, location, data, restart, port);
106 }
107
108 /**
109 * Constructs an activatable remote object by registering
110 * an activation descriptor (with the specified location, data, and
111 * restart mode) for this object, and exporting the object with the
112 * specified port, and specified client and server socket factories.
113 *
114 * <p><strong>Note:</strong> Using the <code>Activatable</code>
115 * constructors that both register and export an activatable remote
116 * object is strongly discouraged because the actions of registering
117 * and exporting the remote object are <i>not</i> guaranteed to be
118 * atomic. Instead, an application should register an activation
119 * descriptor and export a remote object separately, so that exceptions
120 * can be handled properly.
121 *
122 * <p>This method invokes the {@link
123 * exportObject(Remote,String,MarshalledObject,boolean,port,RMIClientSocketFactory,RMIServerSocketFactory)
124 * exportObject} method with this object, and the specified location,
125 * data, restart mode, port, and client and server socket factories.
126 * Subsequent calls to {@link #getID} will return the activation
127 * identifier returned from the call to <code>exportObject</code>.
128 *
129 * @param location the location for classes for this object
130 * @param data the object's initialization data
131 * @param restart if true, the object is restarted (reactivated) when
132 * either the activator is restarted or the object's activation group
133 * is restarted after an unexpected crash; if false, the object is only
134 * activated on demand. Specifying <code>restart</code> to be
135 * <code>true</code> does not force an initial immediate activation of
136 * a newly registered object; initial activation is lazy.
137 * @param port the port on which the object is exported (an anonymous
138 * port is used if port=0)
139 * @param csf the client-side socket factory for making calls to the
140 * remote object
141 * @param ssf the server-side socket factory for receiving remote calls
142 * @exception ActivationException if object registration fails.
143 * @exception RemoteException if either of the following fails:
295 public static void unregister(ActivationID id)
296 throws UnknownObjectException, ActivationException, RemoteException
297 {
298 ActivationGroup.getSystem().unregisterObject(id);
299 }
300
301 /**
302 * Registers an activation descriptor (with the specified location,
303 * data, and restart mode) for the specified object, and exports that
304 * object with the specified port.
305 *
306 * <p><strong>Note:</strong> Using this method (as well as the
307 * <code>Activatable</code> constructors that both register and export
308 * an activatable remote object) is strongly discouraged because the
309 * actions of registering and exporting the remote object are
310 * <i>not</i> guaranteed to be atomic. Instead, an application should
311 * register an activation descriptor and export a remote object
312 * separately, so that exceptions can be handled properly.
313 *
314 * <p>This method invokes the {@link
315 * exportObject(Remote,String,MarshalledObject,boolean,port,RMIClientSocketFactory,RMIServerSocketFactory)
316 * exportObject} method with the specified object, location, data,
317 * restart mode, and port, and <code>null</code> for both client and
318 * server socket factories, and then returns the resulting activation
319 * identifier.
320 *
321 * @param obj the object being exported
322 * @param location the object's code location
323 * @param data the object's bootstrapping data
324 * @param restart if true, the object is restarted (reactivated) when
325 * either the activator is restarted or the object's activation group
326 * is restarted after an unexpected crash; if false, the object is only
327 * activated on demand. Specifying <code>restart</code> to be
328 * <code>true</code> does not force an initial immediate activation of
329 * a newly registered object; initial activation is lazy.
330 * @param port the port on which the object is exported (an anonymous
331 * port is used if port=0)
332 * @return the activation identifier obtained from registering the
333 * descriptor, <code>desc</code>, with the activation system
334 * the wrong group
335 * @exception ActivationException if activation group is not active
|
56
57 private ActivationID id;
58 /** indicate compatibility with the Java 2 SDK v1.2 version of class */
59 private static final long serialVersionUID = -3120617863591563455L;
60
61 /**
62 * Constructs an activatable remote object by registering
63 * an activation descriptor (with the specified location, data, and
64 * restart mode) for this object, and exporting the object with the
65 * specified port.
66 *
67 * <p><strong>Note:</strong> Using the <code>Activatable</code>
68 * constructors that both register and export an activatable remote
69 * object is strongly discouraged because the actions of registering
70 * and exporting the remote object are <i>not</i> guaranteed to be
71 * atomic. Instead, an application should register an activation
72 * descriptor and export a remote object separately, so that exceptions
73 * can be handled properly.
74 *
75 * <p>This method invokes the {@link
76 * #exportObject(Remote,String,MarshalledObject,boolean,int)
77 * exportObject} method with this object, and the specified location,
78 * data, restart mode, and port. Subsequent calls to {@link #getID}
79 * will return the activation identifier returned from the call to
80 * <code>exportObject</code>.
81 *
82 * @param location the location for classes for this object
83 * @param data the object's initialization data
84 * @param port the port on which the object is exported (an anonymous
85 * port is used if port=0)
86 * @param restart if true, the object is restarted (reactivated) when
87 * either the activator is restarted or the object's activation group
88 * is restarted after an unexpected crash; if false, the object is only
89 * activated on demand. Specifying <code>restart</code> to be
90 * <code>true</code> does not force an initial immediate activation of
91 * a newly registered object; initial activation is lazy.
92 * @exception ActivationException if object registration fails.
93 * @exception RemoteException if either of the following fails:
94 * a) registering the object with the activation system or b) exporting
95 * the object to the RMI runtime.
96 * @since 1.2
103 {
104 super();
105 id = exportObject(this, location, data, restart, port);
106 }
107
108 /**
109 * Constructs an activatable remote object by registering
110 * an activation descriptor (with the specified location, data, and
111 * restart mode) for this object, and exporting the object with the
112 * specified port, and specified client and server socket factories.
113 *
114 * <p><strong>Note:</strong> Using the <code>Activatable</code>
115 * constructors that both register and export an activatable remote
116 * object is strongly discouraged because the actions of registering
117 * and exporting the remote object are <i>not</i> guaranteed to be
118 * atomic. Instead, an application should register an activation
119 * descriptor and export a remote object separately, so that exceptions
120 * can be handled properly.
121 *
122 * <p>This method invokes the {@link
123 * #exportObject(Remote,String,MarshalledObject,boolean,int,RMIClientSocketFactory,RMIServerSocketFactory)
124 * exportObject} method with this object, and the specified location,
125 * data, restart mode, port, and client and server socket factories.
126 * Subsequent calls to {@link #getID} will return the activation
127 * identifier returned from the call to <code>exportObject</code>.
128 *
129 * @param location the location for classes for this object
130 * @param data the object's initialization data
131 * @param restart if true, the object is restarted (reactivated) when
132 * either the activator is restarted or the object's activation group
133 * is restarted after an unexpected crash; if false, the object is only
134 * activated on demand. Specifying <code>restart</code> to be
135 * <code>true</code> does not force an initial immediate activation of
136 * a newly registered object; initial activation is lazy.
137 * @param port the port on which the object is exported (an anonymous
138 * port is used if port=0)
139 * @param csf the client-side socket factory for making calls to the
140 * remote object
141 * @param ssf the server-side socket factory for receiving remote calls
142 * @exception ActivationException if object registration fails.
143 * @exception RemoteException if either of the following fails:
295 public static void unregister(ActivationID id)
296 throws UnknownObjectException, ActivationException, RemoteException
297 {
298 ActivationGroup.getSystem().unregisterObject(id);
299 }
300
301 /**
302 * Registers an activation descriptor (with the specified location,
303 * data, and restart mode) for the specified object, and exports that
304 * object with the specified port.
305 *
306 * <p><strong>Note:</strong> Using this method (as well as the
307 * <code>Activatable</code> constructors that both register and export
308 * an activatable remote object) is strongly discouraged because the
309 * actions of registering and exporting the remote object are
310 * <i>not</i> guaranteed to be atomic. Instead, an application should
311 * register an activation descriptor and export a remote object
312 * separately, so that exceptions can be handled properly.
313 *
314 * <p>This method invokes the {@link
315 * #exportObject(Remote,String,MarshalledObject,boolean,int,RMIClientSocketFactory,RMIServerSocketFactory)
316 * exportObject} method with the specified object, location, data,
317 * restart mode, and port, and <code>null</code> for both client and
318 * server socket factories, and then returns the resulting activation
319 * identifier.
320 *
321 * @param obj the object being exported
322 * @param location the object's code location
323 * @param data the object's bootstrapping data
324 * @param restart if true, the object is restarted (reactivated) when
325 * either the activator is restarted or the object's activation group
326 * is restarted after an unexpected crash; if false, the object is only
327 * activated on demand. Specifying <code>restart</code> to be
328 * <code>true</code> does not force an initial immediate activation of
329 * a newly registered object; initial activation is lazy.
330 * @param port the port on which the object is exported (an anonymous
331 * port is used if port=0)
332 * @return the activation identifier obtained from registering the
333 * descriptor, <code>desc</code>, with the activation system
334 * the wrong group
335 * @exception ActivationException if activation group is not active
|