Classes |
class | JNDIElementEnumeration |
Public Member Functions |
| JNDIContext (Logger logger) |
| JNDIContext (String name, String elements, Logger logger) |
Object | lookup (Name name) throws NamingException |
Object | lookup (String name) throws NamingException |
NamingEnumeration | list (Name name) throws NamingException |
NamingEnumeration | list (String name) throws NamingException |
void | bind (Name name, Object obj) throws NamingException |
void | bind (String name, Object obj) throws NamingException |
void | rebind (Name name, Object obj) throws NamingException |
void | rebind (String name, Object obj) throws NamingException |
void | unbind (Name name) throws NamingException |
void | unbind (String name) throws NamingException |
void | rename (Name oldName, Name newName) throws NamingException |
void | rename (String oldName, String newName) throws NamingException |
NamingEnumeration | listBindings (Name name) throws NamingException |
NamingEnumeration | listBindings (String name) throws NamingException |
void | destroySubcontext (Name name) throws NamingException |
void | destroySubcontext (String name) throws NamingException |
Context | createSubcontext (Name name) throws NamingException |
Context | createSubcontext (String name) throws NamingException |
Object | lookupLink (Name name) throws NamingException |
Object | lookupLink (String name) throws NamingException |
NameParser | getNameParser (Name name) throws NamingException |
NameParser | getNameParser (String name) throws NamingException |
Name | composeName (Name name, Name prefix) throws NamingException |
String | composeName (String name, String prefix) throws NamingException |
Object | addToEnvironment (String propName, Object propVal) throws NamingException |
Object | removeFromEnvironment (String propName) throws NamingException |
Hashtable | getEnvironment () throws NamingException |
void | close () throws NamingException |
String | getNameInNamespace () throws NamingException |
Static Public Member Functions |
static void | setDal (DAL dal) |
static void | setOrb (ORB orb) |
Protected Attributes |
final Logger | logger |
String | name |
String | elements |
Static Protected Attributes |
static ORB | orb |
static DAL | dal |
Object com.cosylab.cdb.jdal.JNDIContext.lookup |
( |
Name |
name |
) |
throws NamingException |
- See also:
- Context.lookup(Name) THIS IS OLD CDB implementation public Object lookup(Name name) throws NamingException { System.out.println("CDBContext lookup on " + this.name + " for " + name.toString()); String nameToLookup = this.name + "/" + name; String recordName = nameToLookup.substring(nameToLookup.lastIndexOf('/')+1); get list from the server String elements = dal.list_nodes(nameToLookup); try { if (elements.indexOf(recordName + ".xml") != -1) { String xml = dal.get_DAO(nameToLookup); return new JNDIXMLContext(nameToLookup, elements, xml); } else { if (elements.length() == 0 ) { // inside a XML? int slashIndex = nameToLookup.lastIndexOf('/'); String newName; while( slashIndex != -1 ) { newName = nameToLookup.substring(0,slashIndex); recordName = newName.substring(newName.lastIndexOf('/')+1); elements = dal.list_nodes(newName); if (elements.indexOf(recordName + ".xml") != -1) { String xml = dal.get_DAO(newName); recordName = nameToLookup.substring(slashIndex+1); return new JNDIXMLContext(newName, elements, xml).lookup(recordName); } slashIndex = newName.lastIndexOf('/'); } throw new NamingException("No name " + nameToLookup ); } return new JNDIContext(nameToLookup, elements); } } catch (CDBRecordDoesNotExistEx e) { if it does not exists then it is just a context return new JNDIContext(nameToLookup, elements); } catch (CDBXMLErrorEx e) { AcsJCDBXMLErrorEx acse = new AcsJCDBXMLErrorEx(e); throw new NamingException(acse.getFilename()); } } This methos returns either a new JNDI_Context or a new JNDI_XMLContxt obj.
Reimplemented in com.cosylab.cdb.jdal.JNDIXMLContext, com.cosylab.cdb.browser.BrowserJNDIContext, and com.cosylab.cdb.browser.BrowserJNDIXMLContext.
References com.cosylab.cdb.jdal.JNDIContext.dal, com.cosylab.cdb.jdal.JNDIContext.elements, com.cosylab.cdb.jdal.JNDIContext.JNDIContext(), com.cosylab.cdb.jdal.JNDIContext.logger, and com.cosylab.cdb.jdal.JNDIContext.name.
Referenced by com.cosylab.cdb.jdal.JNDIContext.list(), and com.cosylab.cdb.jdal.JNDIContext.lookup().