How JNDI Names Work
by, 07-07-2012 at 04:15 PM (1086 Views)
Children name of any Context is being allowed to be listed by list() method. It has just been seen that children name could be listed of a Context when list() method is called by usage of empty string, as a parameter. Now let us assume again that Contextobject is there for naming the subdirectories which are present under javax.
Result that would come out would be NamingEnumeration which holds objects like NameClassPair presenting all naming children, including directory “directory”.Java Code:NamingEnumeration childrenOfNaming = namingContext.list("");
A name shall be passed to list() for listing the children names of arbitrary child of some context. Let us assume that directory children could be listed when string directory is being specified as parameter, to list():
NamingEnumeration is the result which hold NameClassPair that present directory children.Java Code:NamingEnumeration childrenOfDirectory = namingContext.list("directory");