KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > rmi > server > gc > GcEvent


1 package org.sapia.ubik.rmi.server.gc;
2
3 import org.sapia.ubik.net.ServerAddress;
4 import org.sapia.ubik.rmi.interceptor.Event;
5
6
7 /**
8  * A server-side event that can be intercepted for various purposes,
9  * mainly monitoring: it signals that a client GC has synchronized
10  * with the server GC.
11  *
12  * @see org.sapia.ubik.rmi.server.gc.ClientGC
13  * @see org.sapia.ubik.rmi.server.gc.ServerGC
14  *
15  * @author Yanick
16  * 2002-03-12
17  */

18 public class GcEvent implements Event {
19   private ServerAddress _origin;
20   private int _count;
21
22   /**
23    * Creates an instance of this class with the given parameters.
24    *
25    * @param origin the <code>HostID</code> of the client from which
26    * the GC event comes.
27    *
28    */

29   GcEvent(ServerAddress origin, int objCount) {
30     _origin = origin;
31     _count = objCount;
32   }
33
34   /**
35    * Returns the identifier of the host from which the GC synchronized
36    * called comes.
37    *
38    * @return a <code>HostID</code>.
39    */

40   public ServerAddress getOrigin() {
41     return _origin;
42   }
43
44   /**
45    * Returns the number of objects that where garbage collected at
46    * the client.
47    *
48    * @return a number of GC'ed objects.
49    */

50   public int getCleanedCount() {
51     return _count;
52   }
53 }
54
Popular Tags