src/main/java/org/jboss/util/naming/Util.java
/** Unbinds a name from ctx, and removes parents if they are empty
    @param ctx the parent JNDI Context under which the name will be unbound
    @param name The name to unbind
    @throws NamingException for any error
    */
Unbinds a name from ctx, and removes parents if they are empty
Unbinds a name from ctx and removes parents if they are empty
public static void unbind(Context ctx, Name name) throws NamingException
   {
      ctx.unbind(name); 
      int sz = name.size();
      while (--sz > 0)
      {
         Name pname = name.getPrefix(sz);
         try
         {
            ctx.destroySubcontext(pname);
         }
         catch (NamingException e)
         {
            log.trace("Unable to remove context " + pname, e);
            break;
         }
      }
   }
public static void unbind ( Context ctx , Name name ) throws NamingException { ctx . unbind ( name ) ; int sz = name . size ( ) ; while ( -- sz > 0 ) { Name pname = name . getPrefix ( sz ) ; try { ctx . destroySubcontext ( pname ) ; } catch ( NamingException e ) { log . trace ( "Unable to remove context " + pname , e ) ; break ; } } }
Unbinds a name from ctx, and removes parents if they are empty
Unbinds a name from ctx and removes parents if they are empty
//unbind the end node in the name // walk the tree backwards, stopping at the domain