org.openejb.core.ivm.naming
Class NameNode

java.lang.Object
  extended by org.openejb.core.ivm.naming.NameNode
All Implemented Interfaces:
java.io.Serializable

public class NameNode
extends java.lang.Object
implements java.io.Serializable

This class is a combination linked list and binary tree for resolving name-object lookups and binding objects to names. The linked list (subTree) hold subcontexts while the binary tree (lessTree/grtrTree) allows for quick navigation of the a hierarchical path used in the \ JNDI ENC. Resolving paths requires the use of the ParsedName class. Navigation through the binary tree is determined by the hashCode of the ParsedName components as compared to the atomicName of the NameNode. When the hashcodes and String values are equal navigation proceeds down the subtree or the name is immediately resolved if its the last component in the ParsedName. When a hashcode is greater or when the hashcodes are equal but the objects are not equal navigation proceeds down the grtrTree. When the hashcode of the component is less then the atomicName navigation proceeds down the lessTree.

See Also:
Serialized Form

Field Summary
 int atomicHash
           
 java.lang.String atomicName
           
 NameNode grtrTree
           
 NameNode lessTree
           
 IvmContext myContext
           
 java.lang.Object myObject
           
 NameNode parent
           
 NameNode subTree
           
 
Constructor Summary
NameNode(NameNode parent, ParsedName name, java.lang.Object obj)
           
 
Method Summary
 void bind(ParsedName name, java.lang.Object obj)
           
 IvmContext createSubcontext(ParsedName name)
           
 java.lang.Object getBinding()
           
 java.lang.Object resolve(ParsedName name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

atomicName

public java.lang.String atomicName

atomicHash

public int atomicHash

lessTree

public NameNode lessTree

grtrTree

public NameNode grtrTree

subTree

public NameNode subTree

parent

public NameNode parent

myObject

public java.lang.Object myObject

myContext

public transient IvmContext myContext
Constructor Detail

NameNode

public NameNode(NameNode parent,
                ParsedName name,
                java.lang.Object obj)
Method Detail

getBinding

public java.lang.Object getBinding()

resolve

public java.lang.Object resolve(ParsedName name)
                         throws javax.naming.NameNotFoundException
Throws:
javax.naming.NameNotFoundException

bind

public void bind(ParsedName name,
                 java.lang.Object obj)
          throws javax.naming.NameAlreadyBoundException
Throws:
javax.naming.NameAlreadyBoundException

createSubcontext

public IvmContext createSubcontext(ParsedName name)
                            throws javax.naming.NameAlreadyBoundException
Throws:
javax.naming.NameAlreadyBoundException


Copyright © 1999-2011 OpenEJB. All Rights Reserved.