In the current activation API, there is no way for an activatable object to
determine when it should save its persistent state when it becomes inactive.
When becoming inactive, an activatable object needs to know when all pending
calls to it are complete so that it can save its persistent state. Since the
activatable object cannot determine this information in the current framework,
the object may save its persistent state before all calls have been processed.
Thus, an object is unable to obtain a consistent snapshot of its state before
shutting down.
A new API should be added to enable an object to be called back when that
object has been quiesced by the RMI runtime. The proposed changes are
as follows:
* add a new interface java.rmi.activation.Unexported with a single
method unexported. If an activatable object implements the Unexported
interface, its unexported method is called during a call to
Activatable.inactive when all pending calls to that object have
completed. Note that the object cannot be synchronized when calling
Activatable.inactive or it may deadlock.
* change the semantics of the UnicastRemoteObject.unexportObject method
to return only after all pending calls to the remote object have
completed.
* if an ActivationGroup receives a request to activate an object that is
in the process of becoming inactive, it must wait until the object has
completed becoming inactive before reactivating the object. The
ActivationGroup should not report back the current object's reference
since the object reference is being unexported and may cause a
NoSuchObjectException to show up to the client.
determine when it should save its persistent state when it becomes inactive.
When becoming inactive, an activatable object needs to know when all pending
calls to it are complete so that it can save its persistent state. Since the
activatable object cannot determine this information in the current framework,
the object may save its persistent state before all calls have been processed.
Thus, an object is unable to obtain a consistent snapshot of its state before
shutting down.
A new API should be added to enable an object to be called back when that
object has been quiesced by the RMI runtime. The proposed changes are
as follows:
* add a new interface java.rmi.activation.Unexported with a single
method unexported. If an activatable object implements the Unexported
interface, its unexported method is called during a call to
Activatable.inactive when all pending calls to that object have
completed. Note that the object cannot be synchronized when calling
Activatable.inactive or it may deadlock.
* change the semantics of the UnicastRemoteObject.unexportObject method
to return only after all pending calls to the remote object have
completed.
* if an ActivationGroup receives a request to activate an object that is
in the process of becoming inactive, it must wait until the object has
completed becoming inactive before reactivating the object. The
ActivationGroup should not report back the current object's reference
since the object reference is being unexported and may cause a
NoSuchObjectException to show up to the client.