org.sapia.ubik.rmi.server.gc
Class ClientGC

java.lang.Object
  extended by org.sapia.ubik.rmi.server.gc.ClientGC
All Implemented Interfaces:
MBeanFactory, ClientGCMBean, Task

public class ClientGC
extends java.lang.Object
implements Task, ClientGCMBean, MBeanFactory

This class implements a the client-side distributed garbage collection algorithm.

Author:
Yanick Duchesne 2002-09-02

Field Summary
static long GC_CLEAN_INTERVAL
           
static int GC_CLEAN_SIZE
           
 
Constructor Summary
ClientGC(TaskManager taskman)
          Creates a new ClientGC instance.
 
Method Summary
 MBeanContainer createMBean()
          Internally creates a MBean and its ObjectName, that are returned in a MBeanContainer.
 void exec(TaskContext ctx)
           
 int getBatchSize()
           
 double getForcedGcPerHour()
           
 double getGcPerMin()
           
 long getInterval()
           
 int getLastGcCount()
           
 java.util.Date getLastPingDate()
           
 int getRemoteObjectCount()
           
 int getThreshold()
           
 boolean register(ServerAddress address, OID oid, java.lang.Object remote)
          Registers an object identifier, associated to a stub.
 void setBatchSize(int size)
           
 void setThreshold(int t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GC_CLEAN_INTERVAL

public static final long GC_CLEAN_INTERVAL
See Also:
Constant Field Values

GC_CLEAN_SIZE

public static final int GC_CLEAN_SIZE
See Also:
Constant Field Values
Constructor Detail

ClientGC

public ClientGC(TaskManager taskman)
Creates a new ClientGC instance.

Parameters:
taskman -
Method Detail

register

public boolean register(ServerAddress address,
                        OID oid,
                        java.lang.Object remote)
Registers an object identifier, associated to a stub. These mappings are kept by server(every remote object is kept internally on a per-server basis).

Parameters:
address - the ServerAddress representing the server from which the remote instance comes from.
oid - the OID of the remote instance to keep.
remote - the remote instance (a stub) to track.

exec

public void exec(TaskContext ctx)
Specified by:
exec in interface Task
Parameters:
ctx - this instance's TaskContext

setBatchSize

public void setBatchSize(int size)
Specified by:
setBatchSize in interface ClientGCMBean

getBatchSize

public int getBatchSize()
Specified by:
getBatchSize in interface ClientGCMBean
See Also:
Consts.CLIENT_GC_BATCHSIZE

setThreshold

public void setThreshold(int t)
Specified by:
setThreshold in interface ClientGCMBean

getThreshold

public int getThreshold()
Specified by:
getThreshold in interface ClientGCMBean
See Also:
Consts.CLIENT_GC_THRESHOLD

getInterval

public long getInterval()
Specified by:
getInterval in interface ClientGCMBean
See Also:
Consts.CLIENT_GC_INTERVAL

getRemoteObjectCount

public int getRemoteObjectCount()
Specified by:
getRemoteObjectCount in interface ClientGCMBean
Returns:
the current number of remote objects referred to by the client GC.

getLastPingDate

public java.util.Date getLastPingDate()
Specified by:
getLastPingDate in interface ClientGCMBean
Returns:
the Date at which the Client GC last contacted the server(s).

getGcPerMin

public double getGcPerMin()
Specified by:
getGcPerMin in interface ClientGCMBean
Returns:
the number of remote objects that are cleaned up by the Client GC, per hour.

getForcedGcPerHour

public double getForcedGcPerHour()
Specified by:
getForcedGcPerHour in interface ClientGCMBean
Returns:
the number times explicity JVM GC is triggered, per hour (according to threshold).
See Also:
ClientGCMBean.getThreshold()

getLastGcCount

public int getLastGcCount()
Specified by:
getLastGcCount in interface ClientGCMBean
Returns:
the number of remote objects that were GC'ed at the last run.

createMBean

public MBeanContainer createMBean()
                           throws java.lang.Exception
Description copied from interface: MBeanFactory
Internally creates a MBean and its ObjectName, that are returned in a MBeanContainer.

Specified by:
createMBean in interface MBeanFactory
Returns:
a MBeanContainer
Throws:
java.lang.Exception - if a problem occurs while creating the MBean or its object name.


Copyright © 2010 Sapia OSS. All Rights Reserved.