/** * 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. If a binding under the supplied name already exists it will be unbound first. 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.CORBA.SystemException One of a fixed set of CORBA system exceptions. * @see doBind */ public void rebind(NameComponent[] n, org.omg.CORBA.Object obj) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName { if (obj == null) { updateLogger.warning(LogKeywords.NAMING_REBIND_FAILURE + " NULL Object cannot be Bound "); throw wrapper.objectIsNull(); } try { // doBind implements all four flavors of binding NamingContextDataStore impl = (NamingContextDataStore) this; doBind(impl, n, obj, true, BindingType.nobject); } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) { updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE + NamingUtils.getDirectoryStructuredName(n) + " is already bound to a Naming Context"); // This should not happen throw wrapper.namingCtxRebindAlreadyBound(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)); } }