org.objectweb.kilim.model.services
Interface NamingContext

All Known Implementing Classes:
DefaultNamingContext

public interface NamingContext

This interface defines the method to be used when dealing which naming contexts.

Author:
horn

Method Summary
 void addBoundName(java.lang.String aName, ComponentElement aElement)
          adds a new lname in the naming context.
 void addChildNamingContext(java.lang.String aName, NamingContext aContext)
          adds a child naming context.
 java.util.Iterator getBoundNames()
          returns as an iterator all names known in the naming context.
 java.util.Iterator getChildNamingContexts()
          returns as an iterator the names of child naming contexts.
 ExternalValueReferences getExternalReferenceMap()
          gets the ExternalReferenceMap associated to the naming context.
 java.lang.String getLocalName()
          returns the local name of the context.
 NamingContext getParentNamingContext()
          Naming contexts follow a tree-like structure.
 java.lang.String getQualifiedName()
          returns the qualified name of the context.
 void removeBoundName(java.lang.String aName)
          removes a name from the naming context.
 void removeChildNamingContext(java.lang.String aName)
          removes a child naming context.
 ComponentElement resolveReference(java.lang.String aName, Component aOrigin)
          returns the element associated to a name.
 void setExternalReferences(ExternalValueReferences xReferences)
          A map of external references can be associated to each naming context.
 void setParentNamingContext(NamingContext aContext)
          sets a new parent naming context.
 

Method Detail

getParentNamingContext

public NamingContext getParentNamingContext()
Naming contexts follow a tree-like structure. This method returns the parent context of the current context. It returns null when applied to the root context.

Returns:
ComponentFactory

setParentNamingContext

public void setParentNamingContext(NamingContext aContext)
sets a new parent naming context.

Parameters:
aContext - : the parent context. Is null for making thje current context a root context.

addChildNamingContext

public void addChildNamingContext(java.lang.String aName,
                                  NamingContext aContext)
                           throws KilimException
adds a child naming context.

Parameters:
aName - : the local name of the naming context.
aContext - : the naming context
Throws:
KilimException - : generated if aName is null, if aName is already used, if aContext is null.

removeChildNamingContext

public void removeChildNamingContext(java.lang.String aName)
                              throws KilimException
removes a child naming context.

Parameters:
aName - : the name of the naming context to be removed.
Throws:
KilimException - : generated if aName is null or unknown.

getChildNamingContexts

public java.util.Iterator getChildNamingContexts()
returns as an iterator the names of child naming contexts.

Returns:
Iterator

setExternalReferences

public void setExternalReferences(ExternalValueReferences xReferences)
A map of external references can be associated to each naming context. This method sets an ExternalReferenceMap.

Parameters:
xReferences - : the external references map.

getExternalReferenceMap

public ExternalValueReferences getExternalReferenceMap()
gets the ExternalReferenceMap associated to the naming context.

Returns:
HashMap

getQualifiedName

public java.lang.String getQualifiedName()
returns the qualified name of the context.

Returns:
String

getLocalName

public java.lang.String getLocalName()
returns the local name of the context.

Returns:
String

addBoundName

public void addBoundName(java.lang.String aName,
                         ComponentElement aElement)
                  throws KilimException
adds a new lname in the naming context.

Parameters:
aName - : the name to be bound.
aElement - : the element.
Throws:
KilimException - : generated if aName is null or is already known.

removeBoundName

public void removeBoundName(java.lang.String aName)
                     throws KilimException
removes a name from the naming context.

Parameters:
aName - : the name of the context to remove.
Throws:
KilimException - : generated if aName is null or unknown in the naming context.

getBoundNames

public java.util.Iterator getBoundNames()
returns as an iterator all names known in the naming context.

Returns:
Iterator

resolveReference

public ComponentElement resolveReference(java.lang.String aName,
                                         Component aOrigin)
                                  throws KilimException
returns the element associated to a name.

Parameters:
aName - : the name to be resolved.
aOrigin - : the component from which the resolve request is performed (required for printing error messages)
Returns:
ComponentElement
Throws:
KilimException - : generated if aName is null or unknown.