uka.karmi.dgc
Class HierarchicalDGC

java.lang.Object
  extended byuka.karmi.rmi.DGC
      extended byuka.karmi.dgc.HierarchicalDGC

public final class HierarchicalDGC
extends DGC

A DGC that counts the references to a server object. A reference is counted whenever it marshaled to another address space.

This algorithm does not need any registration messages when a reference reaches a VM. For reference counting purpose this implementation uses a hierarchical structure of references to other references.

Author:
Christian Nester, Bernhard Haumacher
See Also:
HierarchicalDGC.MarshalContext.proxyRequired(SingleRemoteClientRef)

Nested Class Summary
(package private)  class HierarchicalDGC.Counter
          Counts remote references and prevents the local server implementation form being garbage collected by keeping a local reference to it.
(package private)  class HierarchicalDGC.MarshalContext
          Marshaling context for a hierarchical DGC implementation.
(package private)  class HierarchicalDGC.UnmarshalContext
          UnmarshalContext for hierarchical DGC implementation.
 
Field Summary
private static int FINAL
           
(package private)  java.util.Hashtable objTable
           
 
Constructor Summary
HierarchicalDGC()
           
 
Method Summary
 void doAsyncDGCCall(ExportPoint ep, int customId, java.lang.Object argument)
          Caller does not wait for the end of the call.
 java.lang.Object doDGCCall(ExportPoint ep, int customId, java.lang.Object argument)
          Called from a different address space.
 DGCMarshalContext newDGCMarshalContext()
          Factory method for a new DGCMarshalContext.
 DGCUnmarshalContext newDGCUnmarshalContext()
          Factory method for a new DGCUnmarshalContext.
 void remoteFinalize(ObjectId dgcId, java.lang.Object dgcInfo)
          Called during the finalization of a SingleRemoteClientRef object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FINAL

private static final int FINAL
See Also:
Constant Field Values

objTable

java.util.Hashtable objTable
Constructor Detail

HierarchicalDGC

public HierarchicalDGC()
Method Detail

remoteFinalize

public void remoteFinalize(ObjectId dgcId,
                           java.lang.Object dgcInfo)
Called during the finalization of a SingleRemoteClientRef object.

Specified by:
remoteFinalize in class DGC
See Also:
SingleRemoteClientRef.finalize()

newDGCMarshalContext

public DGCMarshalContext newDGCMarshalContext()
Factory method for a new DGCMarshalContext.

Specified by:
newDGCMarshalContext in class DGC

newDGCUnmarshalContext

public DGCUnmarshalContext newDGCUnmarshalContext()
Factory method for a new DGCUnmarshalContext.

Specified by:
newDGCUnmarshalContext in class DGC

doDGCCall

public java.lang.Object doDGCCall(ExportPoint ep,
                                  int customId,
                                  java.lang.Object argument)
                           throws java.lang.Throwable
Description copied from class: DGC
Called from a different address space. Remote references are not allowed neither in the argument object nor in the result!

Specified by:
doDGCCall in class DGC
Throws:
java.lang.Throwable
See Also:
Technology.dgcCall(UTID utid, int methodId, Object argument)

doAsyncDGCCall

public void doAsyncDGCCall(ExportPoint ep,
                           int customId,
                           java.lang.Object argument)
                    throws java.lang.Throwable
Description copied from class: DGC
Caller does not wait for the end of the call.

Specified by:
doAsyncDGCCall in class DGC
Throws:
java.lang.Throwable
See Also:
DGC.doDGCCall(ExportPoint, int, Object)