org.objectweb.jac.core
Class NameRepository

java.lang.Object
  |
  +--org.objectweb.jac.util.Repository
        |
        +--org.objectweb.jac.util.WeakRepository
              |
              +--org.objectweb.jac.core.NameRepository

public class NameRepository
extends WeakRepository

Provides a naming repository within a running JAC system.

All the JAC objects are seamlessly registered by NamingAC when they are instantiated.

See Also:
NamingAC

Field Summary
protected static NameRepository nameRepository
          Store the sole instance of name repository.
 
Fields inherited from class org.objectweb.jac.util.Repository
names, objects, repository
 
Constructor Summary
NameRepository()
          The default constructor will set the nameRepository field to the right value.
 
Method Summary
static Repository get()
          Get the sole instance of name repository.
 Object getObject(String logicalName)
          Return a registered object for a given logical name.
static Collection getObjects(Collection exprs)
           
static Collection getObjects(String expr)
          Gets the set of JAC objects whose names match an expression.
static Collection getObjects(String[] exprs)
           
 
Methods inherited from class org.objectweb.jac.util.WeakRepository
init
 
Methods inherited from class org.objectweb.jac.util.Repository
dump, getName, getNames, getObjects, getPrintableString, isRegistered, register, unregister, unregisterObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nameRepository

protected static NameRepository nameRepository
Store the sole instance of name repository.

Constructor Detail

NameRepository

public NameRepository()
The default constructor will set the nameRepository field to the right value.

Method Detail

get

public static Repository get()
Get the sole instance of name repository.

Returns:
the name repository

getObject

public Object getObject(String logicalName)
Description copied from class: Repository
Return a registered object for a given logical name.

Return null if the name does not correspond to any registered object or if logicalName is null.

Reverse operation is getName(Object).

Overrides:
getObject in class Repository
Parameters:
logicalName - the key that allows to find the object
Returns:
the corresponding object, null if not registered
See Also:
Repository.register(String,Object), Repository.getName(Object)

getObjects

public static Collection getObjects(String expr)
Gets the set of JAC objects whose names match an expression.

Parameters:
expr - a regular expression
Returns:
the objects set

getObjects

public static Collection getObjects(String[] exprs)

getObjects

public static Collection getObjects(Collection exprs)