Registers an activation descriptor (with the specified location,
data, and restart mode) for the specified object, and exports that
object with the specified port, and the specified client and server
socket factories.
Registers an activation descriptor (with the specified location,
data, and restart mode) for the specified object, and exports that
object with the specified port, and the specified client and server
socket factories.
Note: Using this method (as well as the
Activatable
constructors that both register and export
an activatable remote object) is strongly discouraged because the
actions of registering and exporting the remote object are
not guaranteed to be atomic. Instead, an application should
register an activation descriptor and export a remote object
separately, so that exceptions can be handled properly.
This method first registers an activation descriptor for the
specified object as follows. It obtains the activation system by
invoking the method ActivationGroup.getSystem
. This method then obtains an ActivationID
for the object by invoking the activation system's
registerObject
method with
an ActivationDesc
constructed with the specified object's
class name, and the specified location, data, and restart mode. If
an exception occurs obtaining the activation system or registering
the activation descriptor, that exception is thrown to the caller.
Next, this method exports the object by invoking the exportObject
method with the specified remote object, the
activation identifier obtained from registration, the specified
port, and the specified client and server socket factories. If an
exception occurs exporting the object, this method attempts to
unregister the activation identifier (obtained from registration) by
invoking the activation system's unregisterObject
method with the
activation identifier. If an exception occurs unregistering the
identifier, that exception is ignored, and the original exception
that occurred exporting the object is thrown to the caller.
Finally, this method invokes the activeObject
method on the activation
group in this VM with the activation identifier and the specified
remote object, and returns the activation identifier to the caller.
Returns:
the activation identifier obtained from registering the
descriptor with the activation system
Parameters:
- obj - the object being exported
- location - the object's code location
- data - the object's bootstrapping data
- restart - if true, the object is restarted (reactivated) when
either the activator is restarted or the object's activation group
is restarted after an unexpected crash; if false, the object is only
activated on demand. Specifying restart
to be
true
does not force an initial immediate activation of
a newly registered object; initial activation is lazy.
- port - the port on which the object is exported (an anonymous
port is used if port=0)
- csf - the client-side socket factory for making calls to the
remote object
- ssf - the server-side socket factory for receiving remote calls
Throws:
- ActivationException - if activation group is not active
- RemoteException - if object registration or export fails
Since:
1.2