com.neeve.link
Class LnkRegistry

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.link.LnkObject
          extended by com.neeve.link.LnkRegistry

public final class LnkRegistry
extends LnkObject

Stores operating link peer endpoints in a Neeve application.

The link registry is a singleton class that stores links operating in a Neeve application. The registry is partitioned into multiple link containers of type {#link LnkContainer} each uniquely identified by name. Link containers add themselves to the registry when created. Link peer endpoints add and remove themselves from containers in the registry when created and closed respectively.

Threading:
This class is safe for concurrent access by multiple threads.

Method Summary
 void addContainer(LnkContainer container)
          Add a link container to the registry.
 LnkContainer getContainer(String name)
          Get a link container from the registry.
 cern.colt.list.ObjectArrayList getContainers()
          Get the link containers in the registry.
static LnkRegistry getInstance()
          Return the singleton link registry instance
 LnkContainer removeContainer(String name)
          Remove a link container from the registry.
 
Methods inherited from class com.neeve.root.RootObject
getChecked, getThreaded, getTracer, setChecked, setTracer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static LnkRegistry getInstance()
Return the singleton link registry instance

Returns:
Returns the link registry
Threading:
This method is safe for concurrent access by multiple threads

addContainer

public final void addContainer(LnkContainer container)
                        throws ELnkAlreadyPresentException
Add a link container to the registry.

Parameters:
container - The container to add.
Throws:
ELnkAlreadyPresentException - Thrown if a container with the provided name is already present in the registry.

This method adds a container to the registry. It uses the container name as the key to identify the container.

Threading:
This method is safe for concurrent access by multiple threads

getContainer

public final LnkContainer getContainer(String name)
Get a link container from the registry.

Parameters:
name - The container name.

This method uses the supplied name to lookup a container in the registry. A null value is returned in case the container with the specified name is not present in the registry.

Threading:
This method is safe for concurrent access by multiple threads

getContainers

public final cern.colt.list.ObjectArrayList getContainers()
Get the link containers in the registry.

Returns:
Returns the list of containers in the registry.

This method returns a copy of the list of link containers in the registry. The user is free to modify the returned list. Modification of the returned list will not modify the contents of the registry.

Threading:
This method is safe for concurrent access by multiple threads

removeContainer

public final LnkContainer removeContainer(String name)
Remove a link container from the registry.

Parameters:
name - The container name.
Returns:
Returns the container removed from the registry. This method returns null in case a container with the specified name was not found.

This method uses the supplied name to find and remove a container from the registry.

Threading:
This method is safe for concurrent access by multiple threads


Copyright © 2015 Neeve Research, LLC. All Rights Reserved.