code: public void bind(String jndiName, Object o) throws NamingException
     {
        if (jndiName == null)
           throw new NamingException();
  
        if (o == null)
           throw new NamingException();
  
        Context context = createContext();
        try
        {
           String className = o.getClass().getName();
  
           if (trace)
              log.trace("Binding " + className + " under " + jndiName);
  
           Reference ref = new Reference(className,
                                         new StringRefAddr("class", className),
                                         JNPStrategy.class.getName(),
                                         null);
           ref.add(new StringRefAddr("name", jndiName));
  
           if (objs.putIfAbsent(qualifiedName(jndiName, className), o) != null)
           {
              throw new NamingException(bundle.deploymentFailedSinceJndiNameHasDeployed(className, jndiName));
           }
  
           if (o instanceof Referenceable)
           {
              Referenceable referenceable = (Referenceable)o;
              referenceable.setReference(ref);
           }
              
           Util.bind(context, jndiName, o);
  
           if (log.isDebugEnabled())
              log.debug("Bound " + className + " under " + jndiName);
        }
        finally
        {
           if (context != null)
           {
              try
              {
                 context.close();
              }
              catch (NamingException ne)
              {
                 // Ignore
              }
           }
        }
     }
docs: {@inheritDoc}