|
||||||||||
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 endpoints
that
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 endpoint so that it can be
looked up via #lookup(String) . |
java.util.List<ThreadProxy> |
getProxiesInUseBy(URL nodeName)
Get a reference to the List of 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 endpoint for 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 endpoint from 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 proxy
to add.public java.util.List<ThreadProxy> getProxiesInUseBy(URL nodeName)
List
of proxies used by the node with
nodeName
.
url
- The url of the node.
List
of proxies
that 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)
endpoint
so that it can be
looked up via #lookup(String)
.
endpoint
- The ThreadEndpoint
to register.public void unbind(ThreadEndpoint endpoint)
endpoint
from the registry.
endpoint
- ThreadEndpoint
to remove.public ThreadEndpoint lookup(URL url)
endpoint
for the
node with the given
name. If no endpoint is found null
is returned.
url
- The url of the node, for which the
endpoint
is looked up.
endpoint
of 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.Object
public void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |