|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.uniba.wiai.lspi.chord.com.local.Registry
public final class Registry
This class represents a registry for endpointsthat
can be used to build up a chord network within the same JVM with help of Java
Threads. This Registry is a singleton so that there is only one instance of
this in the JVM. A reference to the singleton can be obtained by invocation
of getRegistryInstance().
| Method Summary | |
|---|---|
void |
addProxyUsedBy(URL url,
ThreadProxy proxy)
Add the given proxy used by the node with nodeName. |
void |
bind(ThreadEndpoint endpoint)
Register the given endpointso that it can be
looked up via #lookup(String). |
java.util.List<ThreadProxy> |
getProxiesInUseBy(URL nodeName)
Get a reference to the Listof proxies used by the node with
nodeName. |
static Registry |
getRegistryInstance()
Get a reference to the registry singleton. |
ThreadEndpoint |
lookup(URL url)
This method looks up the endpointfor the
node with the given
name. |
java.util.Map<URL,ThreadEndpoint> |
lookupAll()
Returns an array of all registered endpoints. |
void |
removeProxiesInUseBy(URL nodeName)
Removes the proxies used by the node
with nodeName. |
void |
shutdown()
Shutdown this registry. |
java.lang.String |
toString()
Overwritten from Object. |
void |
unbind(ThreadEndpoint endpoint)
Remove the given endpointfrom the registry. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void addProxyUsedBy(URL url,
ThreadProxy proxy)
nodeName.
url - The url of the node that uses the proxy.proxy - The proxyto add.public java.util.List<ThreadProxy> getProxiesInUseBy(URL nodeName)
Listof proxies used by the node with
nodeName.
url - The url of the node.
Listof proxiesthat are used by the
node with nodeName. May return null
if there are no proxies in use by the node.public void removeProxiesInUseBy(URL nodeName)
proxies used by the node
with nodeName.
url - The url of the node, for that the proxies
should be removed.public void bind(ThreadEndpoint endpoint)
endpointso that it can be
looked up via #lookup(String).
endpoint - The ThreadEndpointto register.public void unbind(ThreadEndpoint endpoint)
endpointfrom the registry.
endpoint - ThreadEndpointto remove.public ThreadEndpoint lookup(URL url)
endpointfor the
node with the given
name. If no endpoint is found null is returned.
url - The url of the node, for which the
endpointis looked up.
endpointof node with
name "name". May be null if no
such reference exists.public java.util.Map<URL,ThreadEndpoint> lookupAll()
endpoints. If no
endpoint is registered an array of length 0 is returned.public static Registry getRegistryInstance()
public java.lang.String toString()
Object.
toString in class java.lang.Objectpublic void shutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||