1. /*
  2. * @(#)ActivationMonitor.java 1.12 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.rmi.activation;
  11. import java.rmi.MarshalledObject;
  12. import java.rmi.activation.UnknownObjectException;
  13. import java.rmi.activation.UnknownGroupException;
  14. import java.rmi.Remote;
  15. import java.rmi.RemoteException;
  16. /**
  17. * An <code>ActivationMonitor</code> is specific to an
  18. * <code>ActivationGroup</code> and is obtained when a group is
  19. * reported active via a call to
  20. * <code>ActivationSystem.activeGroup</code> (this is done
  21. * internally). An activation group is responsible for informing its
  22. * <code>ActivationMonitor</code> when either: its objects become active or
  23. * inactive, or the group as a whole becomes inactive.
  24. *
  25. * @author Ann Wollrath
  26. * @version 1.12, 02/02/00
  27. * @see Activator
  28. * @see ActivationSystem
  29. * @see ActivationGroup
  30. * @since 1.2
  31. */
  32. public interface ActivationMonitor extends Remote {
  33. /**
  34. * An activation group calls its monitor's
  35. * <code>inactiveObject</code> method when an object in its group
  36. * becomes inactive (deactivates). An activation group discovers
  37. * that an object (that it participated in activating) in its VM
  38. * is no longer active, via calls to the activation group's
  39. * <code>inactiveObject</code> method. <p>
  40. *
  41. * The <code>inactiveObject</code> call informs the
  42. * <code>ActivationMonitor</code> that the remote object reference
  43. * it holds for the object with the activation identifier,
  44. * <code>id</code>, is no longer valid. The monitor considers the
  45. * reference associated with <code>id</code> as a stale reference.
  46. * Since the reference is considered stale, a subsequent
  47. * <code>activate</code> call for the same activation identifier
  48. * results in re-activating the remote object.<p>
  49. *
  50. * @param id the object's activation identifier
  51. * @exception UnknownObjectException if object is unknown
  52. * @exception RemoteException if remote call fails
  53. * @since 1.2
  54. */
  55. public void inactiveObject(ActivationID id)
  56. throws UnknownObjectException, RemoteException;
  57. /**
  58. * Informs that an object is now active. An <code>ActivationGroup</code>
  59. * informs its monitor if an object in its group becomes active by
  60. * other means than being activated directly (i.e., the object
  61. * is registered and "activated" itself).
  62. *
  63. * @param id the active object's id
  64. * @param obj the marshalled form of the object's stub
  65. * @exception UnknownObjectException if object is unknown
  66. * @exception RemoteException if remote call fails
  67. * @since 1.2
  68. */
  69. public void activeObject(ActivationID id, MarshalledObject obj)
  70. throws UnknownObjectException, RemoteException;
  71. /**
  72. * Informs that the group is now inactive. The group will be
  73. * recreated upon a subsequent request to activate an object
  74. * within the group. A group becomes inactive when all objects
  75. * in the group report that they are inactive.
  76. *
  77. * @param id the group's id
  78. * @param incarnation the group's incarnation number
  79. * @exception UnknownGroupException if group is unknown
  80. * @exception RemoteException if remote call fails
  81. * @since 1.2
  82. */
  83. public void inactiveGroup(ActivationGroupID id,
  84. long incarnation)
  85. throws UnknownGroupException, RemoteException;
  86. }