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