Package gnu.cajo
Class Cajo.Registrar
java.lang.Object
gnu.cajo.Cajo.Registrar
- Enclosing class:
Cajo
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method is called either when a Cajo instance starts up, or exports an object reference.void
This method is called either by remote JVMs to provide a copy of their registry, in response to a startup or export announcement.request()
This method allows remote JVMs to request the contents of the registry.
-
Field Details
-
items
-
-
Constructor Details
-
Registrar
-
-
Method Details
-
multicast
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
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
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
-