Voyager ORB

com.objectspace.voyager.mobility
Interface IMobile


public abstract interface IMobile

Sometimes an object needs to know that it is about to move or has just been moved. For example, a persistent mobile object may need to remove itself from the origin's persistent store and add itself to the destination's persistent store. Voyager provides this capability through the IMobile interface. If an object or any of its parts implements the IMobile interface, then it will receive callbacks during a move in the following order: preDeparture(), preArrival(), postArrival(), postDeparture().

Version:
3.0

Method Summary
 void postArrival()
          At this point, the copy of the object has become the real object, the object at the source has become the stale object, and the move is deemed successful and cannot be aborted.
 void postDeparture()
          This method is executed on the original stale object at the source, and is typically defined to perform activities such as removing the stale object from persistence.
 void preArrival()
          This method is executed on the copy of the object at the destination.
 void preDeparture(java.lang.String source, java.lang.String destination)
          This method is executed on the original object at the source.
 

Method Detail

preDeparture

public void preDeparture(java.lang.String source,
                         java.lang.String destination)
                  throws MobilityException
This method is executed on the original object at the source. If the method throws a MobilityException, the move is aborted and no more IMobile callbacks occur.

postDeparture

public void postDeparture()
This method is executed on the original stale object at the source, and is typically defined to perform activities such as removing the stale object from persistence. Messages sent to the stale object via a proxy will be redirected to the new object, so postDeparture() should not utilize proxies to the original object or any of its facets. Note that because the user-supplied callback on the new object is executed using a fresh thread, it is possible for this postDeparture() to be executing concurrently with the user-supplied callback.

preArrival

public void preArrival()
                throws MobilityException
This method is executed on the copy of the object at the destination. If the method throws a MobilityException, the move is aborted and no more IMobile callbacks occur.

postArrival

public void postArrival()
At this point, the copy of the object has become the real object, the object at the source has become the stale object, and the move is deemed successful and cannot be aborted. postArrival() is executed on the copy of object at the destination immediately prior to the user-supplied callback, and is typically defined to perform activities such as adding the new object into persistent storage.

ObjectSpace Inc.

(c) Copyright 1997-1999 ObjectSpace, Inc.
14850 Quorum Drive, Suite 500
Dallas, Texas 75240