home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / rmi / activation / ActivationSystem.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  5.6 KB  |  137 lines

  1. /*
  2.  * @(#)ActivationSystem.java    1.6 98/03/18
  3.  *
  4.  * Copyright 1997, 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.  
  15. package java.rmi.activation;
  16.  
  17. import java.rmi.Remote;
  18. import java.rmi.RemoteException;
  19. import java.rmi.activation.UnknownGroupException;
  20. import java.rmi.activation.UnknownObjectException;
  21.  
  22. /**
  23.  * The <code>ActivationSystem</code> provides a means for registering
  24.  * groups and "activatable" objects to be activated within those groups.
  25.  * The <code>ActivationSystem</code> works closely with the
  26.  * <code>Activator</code>, which activates objects registered via the
  27.  * <code>ActivationSystem</code>, and the <code>ActivationMonitor</code>,
  28.  * which obtains information about active and inactive objects,
  29.  * and inactive groups.
  30.  *
  31.  * @author     Ann Wollrath
  32.  * @version    1.6, 03/18/98
  33.  * @see        Activator
  34.  * @see        ActivationMonitor
  35.  * @since    JDK1.2
  36.  */
  37. public interface ActivationSystem extends Remote {
  38.  
  39.     /** The port to lookup the activation system */
  40.     public static final int SYSTEM_PORT = 1098;
  41.     
  42.     /**
  43.      * The <code>registerObject</code> method is used to register an
  44.      * activation descriptor, <code>desc</code>, and obtain an
  45.      * activation identifier for a activatable remote object. The
  46.      * <code>ActivationSystem</code> creates an
  47.      * <code>ActivationID</code> (a activation identifier) for the
  48.      * object specified by the descriptor, <code>desc</code>, and
  49.      * records, in stable storage, the activation descriptor and its
  50.      * associated identifier for later use. When the <code>Activator</code>
  51.      * receives an <code>activate</code> request for a specific identifier, it
  52.      * looks up the activation descriptor (registered previously) for
  53.      * the specified identifier and uses that information to activate
  54.      * the object. <p>
  55.      *
  56.      * @param desc the object's activation descriptor
  57.      * @return the activation id that can be used to activate the object
  58.      * @exception ActivationException if registration fails (e.g., database
  59.      * update failure, etc).
  60.      * @exception UnknownGroupException if group referred to in
  61.      * <code>desc</code> is not registered with this system
  62.      * @exception RemoteException if remote call fails
  63.      */
  64.     public ActivationID registerObject(ActivationDesc desc)
  65.     throws ActivationException, UnknownGroupException, RemoteException;
  66.     
  67.     /**
  68.      * Remove the activation id and associated descriptor previously
  69.      * registered with the <code>ActivationSystem</code>; the object
  70.      * can no longer be activated via the object's activation id.
  71.      *
  72.      * @param id the object's activation id (from previous registration)
  73.      * @exception ActivationException if unregister fails (e.g., database
  74.      * update failure, etc).
  75.      * @exception UnknownObjectException if object is unknown (not registered)
  76.      * @exception RemoteException if remote call fails
  77.      */
  78.     public void unregisterObject(ActivationID id)
  79.     throws ActivationException, UnknownObjectException, RemoteException;
  80.     
  81.     /**
  82.      * Register the activation group. An activation group must be
  83.      * registered with the <code>ActivationSystem</code> before objects
  84.      * can be registered within that group.
  85.      *
  86.      * @param desc the group's descriptor
  87.      * @return an identifier for the group
  88.      * @exception ActivationException if group registration fails
  89.      * @exception RemoteException if remote call fails
  90.      */
  91.     public ActivationGroupID registerGroup(ActivationGroupDesc desc)
  92.     throws ActivationException, RemoteException;
  93.  
  94.     /**
  95.      * Callback to inform activation system that group is now
  96.      * active. This call is made internally by the
  97.      * <code>ActivationGroup.createGroup</code> method to inform
  98.      * the <code>ActivationSystem</code> that the group is now
  99.      * active.
  100.      *
  101.      * @param id the activation group's identifier
  102.      * @param group the group's instantiator
  103.      * @param incarnation the group's incarnation number
  104.      *
  105.      * @exception UnknownGroupException if group is not registered
  106.      * @exception ActivationException if group is already active
  107.      * @exception RemoteException if remote call fails
  108.      */
  109.     public ActivationMonitor activeGroup(ActivationGroupID id,
  110.                      ActivationInstantiator group,
  111.                      long incarnation)
  112.     throws UnknownGroupException, ActivationException, RemoteException;
  113.     
  114.     /**
  115.      * Remove the activation group. An activation group makes this call back
  116.      * to inform the activator that the group should be removed (destroyed).
  117.      * If this call completes successfully, objects can no longer be
  118.      * registered or activated within the group. All information of the
  119.      * group and its associated objects is removed from the system.
  120.      *
  121.      * @param id the activation group's identifier
  122.      * @exception ActivationException if unregister fails (e.g., database
  123.      * update failure, etc).
  124.      * @exception UnknownGroupException if group is not registered
  125.      * @exception RemoteException if remote call fails
  126.      */
  127.     public void unregisterGroup(ActivationGroupID id)
  128.     throws ActivationException, UnknownGroupException, RemoteException;
  129.  
  130.     /**
  131.      * Shutdown the activation system. Destroys all groups spawned by
  132.      * the activation daemon and exits the activation daemon.
  133.      */
  134.     public void shutdown() throws RemoteException;
  135.  
  136. }
  137.