org.sapia.ubik.rmi.server
Class ObjectTable

java.lang.Object
  extended by org.sapia.ubik.rmi.server.ObjectTable
All Implemented Interfaces:
MBeanFactory, ObjectTableMBean

public class ObjectTable
extends java.lang.Object
implements ObjectTableMBean, MBeanFactory

A server-side class that performs reference counting and that is used in distributed garbage collection.

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site

Nested Class Summary
protected static class ObjectTable.Ref
           
 
Method Summary
 void clear()
           
 void clear(OID oid)
           
 MBeanContainer createMBean()
          Internally creates a MBean and its ObjectName, that are returned in a MBeanContainer.
 void dereference(OID oid, int decrement)
          Decrements the reference count of the object whose identifier is given.
 java.lang.Object getObjectFor(OID oid)
          Returns the object whose identifier is passed in.
 int getRefCount()
           
 int getRefCount(OID oid)
          Returns the reference count of the object whose identifier is given.
 java.util.Map getRefs()
           
 void reference(OID oid)
          Increases the reference count of the object whose identifier is passed as a parameter.
 void register(OID oid, java.lang.Object o)
          Registers the given object (for which a stub will eventually be sent on the client side) with the given object identifier.
 boolean remove(java.lang.ClassLoader loader)
          Removes all objects whose class was loaded by the given classloader.
 boolean remove(java.lang.Object o)
          Removes the given object from this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

register

public void register(OID oid,
                     java.lang.Object o)
Registers the given object (for which a stub will eventually be sent on the client side) with the given object identifier.

Parameters:
oid - the OID of the object passed in.
o - the object whose stub will be sent to the client.

reference

public void reference(OID oid)
Increases the reference count of the object whose identifier is passed as a parameter.

Parameters:
oid - the OID of the object whose reference count should be incremented.

dereference

public void dereference(OID oid,
                        int decrement)
Decrements the reference count of the object whose identifier is given.

Parameters:
oid - the OID of an object whose reference count is to be decremented.
decrement - the value that should be substracted from the OID's reference count.

getObjectFor

public java.lang.Object getObjectFor(OID oid)
                              throws java.rmi.NoSuchObjectException
Returns the object whose identifier is passed in.

Parameters:
oid - the identifier of the object to return
Throws:
java.rmi.NoSuchObjectException - if no object exists for the given identifier

remove

public boolean remove(java.lang.Object o)
Removes the given object from this instance.

Returns:
true if the given object was removed from this instance.

remove

public boolean remove(java.lang.ClassLoader loader)
Removes all objects whose class was loaded by the given classloader.

Parameters:
loader - a ClassLoader.
Returns:
true if any objects were removed that correspond to the given classloader.

getRefCount

public int getRefCount(OID oid)
Returns the reference count of the object whose identifier is given.

Returns:
the reference count of the object corresponding to the OID passed in.

getRefCount

public int getRefCount()
Specified by:
getRefCount in interface ObjectTableMBean

clear

public void clear()

getRefs

public java.util.Map getRefs()

clear

public void clear(OID oid)

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.