home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / VCAFE.3.0A / Main.bin / DGC.java < prev    next >
Text File  |  1998-09-22  |  4KB  |  93 lines

  1. /*
  2.  * @(#)DGC.java    1.6 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14. package java.rmi.dgc;
  15.  
  16. import java.rmi.*;
  17. import java.rmi.server.ObjID;
  18.  
  19. /**
  20.  * The DGC abstraction is used for the server side of the distributed
  21.  * garbage collection algorithm. This interface contains the two
  22.  * methods: dirty and clean. A dirty call is made when a remote
  23.  * reference is unmarshaled in a client (the client is indicated by
  24.  * its VMID). A corresponding clean call is made when no more
  25.  * references to the remote reference exist in the client. A failed
  26.  * dirty call must schedule a strong clean call so that the call's
  27.  * sequence number can be retained in order to detect future calls
  28.  * received out of order by the distributed garbage collector.
  29.  *
  30.  * A reference to a remote object is leased for a period of time by
  31.  * the client holding the reference. The lease period starts when the
  32.  * dirty call is received. It is the client's responsibility to renew
  33.  * the leases, by making additional dirty calls, on the remote
  34.  * references it holds before such leases expire. If the client does
  35.  * not renew the lease before it expires, the distributed garbage
  36.  * collector assumes that the remote object is no longer referenced by
  37.  * that client.
  38.  *
  39.  * @author Ann Wollrath
  40.  */
  41. public interface DGC extends Remote {
  42.  
  43.     /**
  44.      * The dirty call requests leases for the remote object references
  45.      * associated with the object identifiers contained in the array
  46.      * 'ids'. The 'lease' contains a client's unique VM identifier (VMID)
  47.      * and a requested lease period. For each remote object exported
  48.      * in the local VM, the garbage collector maintains a reference
  49.      * list-a list of clients that hold references to it. If the lease
  50.      * is granted, the garbage collector adds the client's VMID to the
  51.      * reference list for each remote object indicated in 'ids'. The
  52.      * 'sequenceNum' parameter is a sequence number that is used to
  53.      * detect and discard late calls to the garbage collector. The
  54.      * sequence number should always increase for each subsequent call
  55.      * to the garbage collector.
  56.      *
  57.      * Some clients are unable to generate a VMID, since a VMID is a
  58.      * universally unique identifier that contains a host address
  59.      * which some clients are unable to obtain due to security
  60.      * restrictions. In this case, a client can use a VMID of null,
  61.      * and the distributed garbage collector will assign a VMID for
  62.      * the client.
  63.      *
  64.      * The dirty call returns a Lease object that contains the VMID
  65.      * used and the lease period granted for the remote references (a
  66.      * server may decide to grant a smaller lease period than the
  67.      * client requests). A client must use the VMID the garbage
  68.      * collector uses in order to make corresponding clean calls when
  69.      * the client drops remote object references.
  70.      *
  71.      * A client VM need only make one initial dirty call for each
  72.      * remote reference referenced in the VM (even if it has multiple
  73.      * references to the same remote object). The client must also
  74.      * make a dirty call to renew leases on remote references before
  75.      * such leases expire. When the client no longer has any
  76.      * references to a specific remote object, it must schedule a
  77.      * clean call for the object ID associated with the reference.
  78.      */
  79.     Lease dirty(ObjID[] ids, long sequenceNum, Lease lease)
  80.     throws RemoteException;
  81.  
  82.     /**
  83.      * The clean call removes the 'vmid' from the reference list of
  84.      * each remote object indicated in 'id's.  The sequence number is
  85.      * used to detect late clean calls.  If the argument 'strong' is
  86.      * true, then the clean call is a result of a failed dirty call,
  87.      * thus the sequence number for the client 'vmid' needs to be
  88.      * remembered.
  89.      */
  90.     void clean(ObjID[] ids, long sequenceNum, VMID vmid, boolean strong)
  91.     throws RemoteException;
  92. }
  93.