コード例 #1
0
 /**
  * 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));
   }
 }
コード例 #2
0
 /**
  * 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));
   }
 }