/**
  * Bind a NamingContext under a name in this NamingContext. If the name contains multiple (n)
  * components, the first n-1 components will be resolved in this NamingContext and the object
  * bound in resulting NamingContext. If a binding under the supplied name already exists it will
  * be unbound first. The NamingContext will participate in recursive resolving.
  *
  * @param n a sequence of NameComponents which is the name under which the object will be bound.
  * @param obj the object reference to be bound.
  * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple components was
  *     supplied, but the first component could not be resolved.
  * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed in resolving
  *     the n-1 components of the supplied name.
  * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name is invalid
  *     (i.e., has length less than 1).
  * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
  * @see doBind
  */
 public void rebind_context(NameComponent[] n, NamingContext nc)
     throws org.omg.CosNaming.NamingContextPackage.NotFound,
         org.omg.CosNaming.NamingContextPackage.CannotProceed,
         org.omg.CosNaming.NamingContextPackage.InvalidName {
   if (nc == null) {
     updateLogger.warning(LogKeywords.NAMING_REBIND_FAILURE + " NULL Context cannot be Bound ");
     throw wrapper.objectIsNull();
   }
   try {
     // doBind implements all four flavors of binding
     NamingContextDataStore impl = (NamingContextDataStore) this;
     doBind(impl, n, nc, true, BindingType.ncontext);
   } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
     // This should not happen
     updateLogger.warning(
         LogKeywords.NAMING_REBIND_FAILURE
             + NamingUtils.getDirectoryStructuredName(n)
             + " is already bound to a CORBA Object");
     throw wrapper.namingCtxRebindctxAlreadyBound(ex);
   }
   if (updateLogger.isLoggable(Level.FINE)) {
     // isLoggable call to make sure that we save some precious
     // processor cycles, if there is no need to log.
     updateLogger.fine(
         LogKeywords.NAMING_REBIND_SUCCESS
             + " Name = "
             + NamingUtils.getDirectoryStructuredName(n));
   }
 }
 /**
  * Create a new NamingContext, bind it in this Naming Context and return its object reference.
  * This is equivalent to using new_context() followed by bind_context() with the supplied name and
  * the object reference for the newly created NamingContext.
  *
  * @param n a sequence of NameComponents which is the name to be unbound.
  * @return an object reference for a new NamingContext object implemented by this Name Server,
  *     bound to the supplied name.
  * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object is already bound under
  *     the supplied name.
  * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple components was
  *     supplied, but the first component could not be resolved.
  * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed in resolving
  *     the n-1 components of the supplied name.
  * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name is invalid
  *     (i.e., has length less than 1).
  * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
  * @see new_context
  * @see bind_context
  */
 public NamingContext bind_new_context(NameComponent[] n)
     throws org.omg.CosNaming.NamingContextPackage.NotFound,
         org.omg.CosNaming.NamingContextPackage.AlreadyBound,
         org.omg.CosNaming.NamingContextPackage.CannotProceed,
         org.omg.CosNaming.NamingContextPackage.InvalidName {
   NamingContext nc = null;
   NamingContext rnc = null;
   try {
     if (debug) dprint("bind_new_context " + nameToString(n));
     // The obvious solution:
     nc = this.new_context();
     this.bind_context(n, nc);
     rnc = nc;
     nc = null;
   } finally {
     try {
       if (nc != null) nc.destroy();
     } catch (org.omg.CosNaming.NamingContextPackage.NotEmpty e) {
     }
   }
   if (updateLogger.isLoggable(Level.FINE)) {
     // isLoggable call to make sure that we save some precious
     // processor cycles, if there is no need to log.
     updateLogger.fine(
         LogKeywords.NAMING_BIND
             + "New Context Bound To "
             + NamingUtils.getDirectoryStructuredName(n));
   }
   return rnc;
 }
 private static void dprint(String msg) {
   NamingUtils.dprint(
       "NamingContextImpl("
           + Thread.currentThread().getName()
           + " at "
           + System.currentTimeMillis()
           + " ems): "
           + msg);
 }
 /**
  * Resolve a name in this NamingContext and return the object reference bound to the name. If the
  * name contains multiple (n) components, the first component will be resolved in this
  * NamingContext and the remaining components resolved in the resulting NamingContext, provided
  * that the NamingContext bound to the first component of the name was bound with bind_context().
  *
  * @param n a sequence of NameComponents which is the name to be resolved.
  * @return the object reference bound under the supplied name.
  * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple components was
  *     supplied, but the first component could not be resolved.
  * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed in resolving
  *     the n-1 components of the supplied name.
  * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name is invalid
  *     (i.e., has length less than 1).
  * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
  * @see doResolve
  */
 public org.omg.CORBA.Object resolve(NameComponent[] n)
     throws org.omg.CosNaming.NamingContextPackage.NotFound,
         org.omg.CosNaming.NamingContextPackage.CannotProceed,
         org.omg.CosNaming.NamingContextPackage.InvalidName {
   // doResolve actually resolves
   NamingContextDataStore impl = (NamingContextDataStore) this;
   org.omg.CORBA.Object obj = doResolve(impl, n);
   if (obj != null) {
     if (readLogger.isLoggable(Level.FINE)) {
       readLogger.fine(
           LogKeywords.NAMING_RESOLVE_SUCCESS
               + " Name: "
               + NamingUtils.getDirectoryStructuredName(n));
     }
   } else {
     readLogger.warning(
         LogKeywords.NAMING_RESOLVE_FAILURE
             + " Name: "
             + NamingUtils.getDirectoryStructuredName(n));
   }
   return obj;
 }
 /**
  * Remove a binding from this NamingContext. If the name contains multiple (n) components, the
  * first n-1 components will be resolved from this NamingContext and the final component unbound
  * in the resulting NamingContext.
  *
  * @param n a sequence of NameComponents which is the name to be unbound.
  * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple components was
  *     supplied, but the first component could not be resolved.
  * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed in resolving
  *     the n-1 components of the supplied name.
  * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name is invalid
  *     (i.e., has length less than 1).
  * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
  * @see doUnbind
  */
 public void unbind(NameComponent[] n)
     throws org.omg.CosNaming.NamingContextPackage.NotFound,
         org.omg.CosNaming.NamingContextPackage.CannotProceed,
         org.omg.CosNaming.NamingContextPackage.InvalidName {
   // doUnbind actually unbinds
   NamingContextDataStore impl = (NamingContextDataStore) this;
   doUnbind(impl, n);
   if (updateLogger.isLoggable(Level.FINE)) {
     // isLoggable call to make sure that we save some precious
     // processor cycles, if there is no need to log.
     updateLogger.fine(
         LogKeywords.NAMING_UNBIND_SUCCESS
             + " Name: "
             + NamingUtils.getDirectoryStructuredName(n));
   }
 }
 /**
  * Bind a NamingContext under a name in this NamingContext. If the name contains multiple (n)
  * components, n-1 will be resolved in this NamingContext and the object bound in resulting
  * NamingContext. An exception is thrown if a binding with the supplied name already exists. The
  * NamingContext will participate in recursive resolving.
  *
  * @param n a sequence of NameComponents which is the name under which the object will be bound.
  * @param obj the NamingContect object reference to be bound.
  * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple components was
  *     supplied, but the first component could not be resolved.
  * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed in resolving
  *     the n-1 components of the supplied name.
  * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name is invalid
  *     (i.e., has length less than 1).
  * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object is already bound under
  *     the supplied name.
  * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
  * @see doBind
  */
 public void bind_context(NameComponent[] n, NamingContext nc)
     throws org.omg.CosNaming.NamingContextPackage.NotFound,
         org.omg.CosNaming.NamingContextPackage.CannotProceed,
         org.omg.CosNaming.NamingContextPackage.InvalidName,
         org.omg.CosNaming.NamingContextPackage.AlreadyBound {
   if (nc == null) {
     updateLogger.warning(LogKeywords.NAMING_BIND_FAILURE + " NULL Context cannot be Bound ");
     throw new BAD_PARAM("Naming Context should not be null ");
   }
   // doBind implements all four flavors of binding
   NamingContextDataStore impl = (NamingContextDataStore) this;
   doBind(impl, n, nc, false, BindingType.ncontext);
   if (updateLogger.isLoggable(Level.FINE)) {
     // isLoggable call to make sure that we save some precious
     // processor cycles, if there is no need to log.
     updateLogger.fine(
         LogKeywords.NAMING_BIND_SUCCESS + " Name = " + NamingUtils.getDirectoryStructuredName(n));
   }
 }
 /**
  * Bind an object under a name in this NamingContext. If the name contains multiple (n)
  * components, n-1 will be resolved in this NamingContext and the object bound in resulting
  * NamingContext. An exception is thrown if a binding with the supplied name already exists. If
  * the object to be bound is a NamingContext it will not participate in a recursive resolve.
  *
  * @param n a sequence of NameComponents which is the name under which the object will be bound.
  * @param obj the object reference to be bound.
  * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple components was
  *     supplied, but the first component could not be resolved.
  * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed in resolving
  *     the n-1 components of the supplied name.
  * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name is invalid
  *     (i.e., has length less than 1).
  * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object is already bound under
  *     the supplied name.
  * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
  * @see doBind
  */
 public void bind(NameComponent[] n, org.omg.CORBA.Object obj)
     throws org.omg.CosNaming.NamingContextPackage.NotFound,
         org.omg.CosNaming.NamingContextPackage.CannotProceed,
         org.omg.CosNaming.NamingContextPackage.InvalidName,
         org.omg.CosNaming.NamingContextPackage.AlreadyBound {
   if (obj == null) {
     updateLogger.warning(
         LogKeywords.NAMING_BIND + " unsuccessful because NULL Object cannot be Bound ");
     throw wrapper.objectIsNull();
   }
   // doBind implements all four flavors of binding
   NamingContextDataStore impl = (NamingContextDataStore) this;
   doBind(impl, n, obj, false, BindingType.nobject);
   if (updateLogger.isLoggable(Level.FINE)) {
     // isLoggable call to make sure that we save some precious
     // processor cycles, if there is no need to log.
     updateLogger.fine(
         LogKeywords.NAMING_BIND_SUCCESS + " Name = " + NamingUtils.getDirectoryStructuredName(n));
   }
 }