code: public void bind() throws Throwable
     {
        if (name == null)
           throw new IllegalArgumentException("Name is null");
  
        if (obj == null)
           throw new IllegalArgumentException("Obj is null");
  
        if (trace)
           log.trace("Binding " + obj.getClass().getName() + " under " + name);
  
        Properties properties = new Properties();
        properties.setProperty(Context.PROVIDER_URL, jndiProtocol + "://" + jndiHost + ":" + jndiPort);
        Context context = new InitialContext(properties);
  
        try
        {
           String className = obj.getClass().getName();
           Reference ref = new Reference(className,
                                         new StringRefAddr("class", className),
                                         JndiBinder.class.getName(),
                                         null);
           ref.add(new StringRefAddr("name", name));
  
           objs.put(name, obj);
  
           Util.bind(context, name, ref);
  
           if (log.isDebugEnabled())
              log.debug("Bound " + obj.getClass().getName() + " under " + name);
        }
        finally
        {
           if (context != null)
           {
              try
              {
                 context.close();
              }
              catch (NamingException ne)
              {
                 // Ignore
              }
           }
        }
     }
docs: Bind
  @exception Throwable Thrown in case of an error