KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > rmi > activation > ActivationMonitor


1 /*
2  * @(#)ActivationMonitor.java 1.15 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.rmi.activation;
9
10 import java.rmi.MarshalledObject JavaDoc;
11 import java.rmi.activation.UnknownObjectException JavaDoc;
12 import java.rmi.activation.UnknownGroupException JavaDoc;
13 import java.rmi.Remote JavaDoc;
14 import java.rmi.RemoteException JavaDoc;
15
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.15, 12/19/03
27  * @see Activator
28  * @see ActivationSystem
29  * @see ActivationGroup
30  * @since 1.2
31  */

32 public interface ActivationMonitor extends Remote JavaDoc {
33
34    /**
35      * An activation group calls its monitor's
36      * <code>inactiveObject</code> method when an object in its group
37      * becomes inactive (deactivates). An activation group discovers
38      * that an object (that it participated in activating) in its VM
39      * is no longer active, via calls to the activation group's
40      * <code>inactiveObject</code> method. <p>
41      *
42      * The <code>inactiveObject</code> call informs the
43      * <code>ActivationMonitor</code> that the remote object reference
44      * it holds for the object with the activation identifier,
45      * <code>id</code>, is no longer valid. The monitor considers the
46      * reference associated with <code>id</code> as a stale reference.
47      * Since the reference is considered stale, a subsequent
48      * <code>activate</code> call for the same activation identifier
49      * results in re-activating the remote object.<p>
50      *
51      * @param id the object's activation identifier
52      * @exception UnknownObjectException if object is unknown
53      * @exception RemoteException if remote call fails
54      * @since 1.2
55      */

56     public void inactiveObject(ActivationID JavaDoc id)
57     throws UnknownObjectException JavaDoc, RemoteException JavaDoc;
58
59     /**
60      * Informs that an object is now active. An <code>ActivationGroup</code>
61      * informs its monitor if an object in its group becomes active by
62      * other means than being activated directly (i.e., the object
63      * is registered and "activated" itself).
64      *
65      * @param id the active object's id
66      * @param obj the marshalled form of the object's stub
67      * @exception UnknownObjectException if object is unknown
68      * @exception RemoteException if remote call fails
69      * @since 1.2
70      */

71     public void activeObject(ActivationID JavaDoc id, MarshalledObject JavaDoc obj)
72     throws UnknownObjectException JavaDoc, RemoteException JavaDoc;
73
74     /**
75      * Informs that the group is now inactive. The group will be
76      * recreated upon a subsequent request to activate an object
77      * within the group. A group becomes inactive when all objects
78      * in the group report that they are inactive.
79      *
80      * @param id the group's id
81      * @param incarnation the group's incarnation number
82      * @exception UnknownGroupException if group is unknown
83      * @exception RemoteException if remote call fails
84      * @since 1.2
85      */

86     public void inactiveGroup(ActivationGroupID JavaDoc id,
87                   long incarnation)
88     throws UnknownGroupException JavaDoc, RemoteException JavaDoc;
89
90 }
91
92
93
Popular Tags