Log.info("Bound "+absoluteObjectNameString); Log.info("Bound "+absoluteNamingEntryNameString);
Log.debug("Bound "+absoluteObjectNameString); Log.debug("Bound "+absoluteNamingEntryNameString);
    public NamingEntry (String jndiName, Object object)    throws NamingException    {        this.jndiName = jndiName;        this.objectToBind = object;        InitialContext icontext = new InitialContext();              //if a threadlocal is set indicating we are inside a        //webapp, then bind naming entries to the webapp's        //context instead of the global context        switch (getScope())        {            case SCOPE_GLOBAL:             {                context = icontext;                isGlobal = true;                break;            }            case SCOPE_LOCAL:            {                context = (Context)icontext.lookup("java:comp/env");                isGlobal = false;                break;            }        }                       NameParser parser = context.getNameParser("");        Name contextName = parser.parse(context.getNameInNamespace());                Name name = parser.parse("");        name.add(getClass().getName());        name.add(getJndiName());        namingEntryNameString = name.toString();        //bind this NameEntry in the given context so we can access it later        NamingUtil.bind(context, namingEntryNameString, this);        String absoluteNamingEntryNameString = (isGlobal()?"":"java:")+name.addAll(0,contextName).toString();                //bind the object itself in the given context so that we can get it later        Name objectName = parser.parse(getJndiName());        objectNameString = objectName.toString();        NamingUtil.bind(context, objectNameString, getObjectToBind());                      //remember the full name of the bound object so that it can be used in        //link references later        Name fullName = objectName.addAll(0,contextName);        absoluteObjectNameString = (isGlobal()?"":"java:")+fullName.toString();                        Log.info("Bound "+absoluteObjectNameString);        Log.info("Bound "+absoluteNamingEntryNameString);    }