jgroup.relacs.rmi
Class ServerMethodTable

java.lang.Object
  extended by jgroup.relacs.rmi.ServerMethodTable

public final class ServerMethodTable
extends java.lang.Object

Helper class usueful to associate a "method hash" to each of the methods contained in a set of interfaces. The method hash is a long containing the first 64 bits of the SHA digest from the UTF encoded string of the method name and descriptor. The table maintains two hash table, one for methods and another for hash numbers. (Partly copied from Java 2 SDK 1.3)

Since:
Jgroup 0.9
Author:
Alberto Montresor, Hein Meling

Constructor Summary
ServerMethodTable()
          Creates a new ServerMethodTable instance, with empty tables.
 
Method Summary
 void addMethods(java.lang.Object server, java.lang.Class gmiListenerClass)
          Add methods from the given GMI interface implemented by the provided server.
 java.lang.reflect.Method get(long hash)
          Get the method associated with the given hash value.
 long get(java.lang.reflect.Method m)
          Get the hash value associated with the given method.
 java.lang.Object getServer(long hash)
          Get the server associated with the given hash value representing a method.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerMethodTable

public ServerMethodTable()
Creates a new ServerMethodTable instance, with empty tables.

Method Detail

addMethods

public void addMethods(java.lang.Object server,
                       java.lang.Class gmiListenerClass)
Add methods from the given GMI interface implemented by the provided server. For each remote method in the given GMI interfaces, a mapping is created between a hash of the method and the java.lang.reflect.Method object (and the reverse mapping). In addition, the hash of the method is also associated with the server object that is actually implementing these methods. The latter is used to enable multiple listeners (servers/layers) to receive method invocations, through the same EGMI/IGMI layer.


get

public java.lang.reflect.Method get(long hash)
Get the method associated with the given hash value.


get

public long get(java.lang.reflect.Method m)
Get the hash value associated with the given method.


getServer

public java.lang.Object getServer(long hash)
Get the server associated with the given hash value representing a method.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.