Package gnu.cajo

Class Cajo.Registrar

java.lang.Object
gnu.cajo.Cajo.Registrar
Enclosing class:
Cajo

public static final class Cajo.Registrar extends Object
This internal use only helper class maintains a registry of exported objects. It cannot be instantiated outside this class, it is made public only because it is being invoked reflectively. It uses UDP multicasts to find other instances of registries, and shares references between them.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Vector
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    multicast(Multicast multicast)
    This method is called either when a Cajo instance starts up, or exports an object reference.
    void
    register(Vector elements)
    This method is called either by remote JVMs to provide a copy of their registry, in response to a startup or export announcement.
    This method allows remote JVMs to request the contents of the registry.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • items

      private final Vector items
  • Constructor Details

    • Registrar

      private Registrar(Vector items)
  • Method Details

    • multicast

      public Object multicast(Multicast multicast) throws Exception
      This method is called either when a Cajo instance starts up, or exports an object reference. All operating servers will request the collection of references owned by the remote JVM, and correspondingly send a copy of their registries.
      Parameters:
      multicast - A reference to the announcing JVM
      Returns:
      null To keep the multicast object listening
      Throws:
      Exception - if the request for remote references failed, or the sending its reference collection failed, for either network, or application specific reasons.
    • register

      public void register(Vector elements)
      This method is called either by remote JVMs to provide a copy of their registry, in response to a startup or export announcement. The registries will be merged, and duplicate references discarded.
      Parameters:
      elements - A collection of remote object references
    • request

      public Vector request()
      This method allows remote JVMs to request the contents of the registry. The contents of the registry are dynamic, changing with the exports, and shutdowns, of remote servers.
      Returns:
      The collection of remote object references currently registered