/** * (Re)binds an object to a name in a given CORBA naming context, creating * any non-existent intermediate contexts along the way. * <p/> * This method is synchronized on the class object, if multiple services attempt to bind the * same context name at once it will fail * * @param ctx a reference to the COSNaming service. * @param strName the name under which the CORBA object is to be bound. * @param obj the CORBA object to be bound. * @throws Exception if an error occurs while binding the object. */ public static synchronized void rebind(final NamingContextExt ctx, final String strName, final org.omg.CORBA.Object obj) throws Exception { final NameComponent[] name = ctx.to_name(strName); NamingContext intermediateCtx = ctx; for (int i = 0; i < name.length - 1; i++) { final NameComponent[] relativeName = new NameComponent[]{name[i]}; try { intermediateCtx = NamingContextHelper.narrow( intermediateCtx.resolve(relativeName)); } catch (NotFound e) { intermediateCtx = intermediateCtx.bind_new_context(relativeName); } } intermediateCtx.rebind(new NameComponent[]{name[name.length - 1]}, obj); }
_nc.rebind(pth, (org.omg.CORBA.Object) obj); else _nc.bind(pth, (org.omg.CORBA.Object) obj);
@Override public void initializeRemoteNaming(Remote remoteNamingProvider) throws Exception { try { org.omg.CORBA.Object provider = getRemoteNamingReference( remoteNamingProvider ) ; // put object in NameService org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService"); NamingContext ncRef = NamingContextHelper.narrow(objRef); // XXX use constant for SerialContextProvider name NameComponent nc = new NameComponent("SerialContextProvider", ""); NameComponent path[] = {nc}; ncRef.rebind(path, provider); } catch (Exception ex) { _logger.log(Level.SEVERE, "enterprise_naming.excep_in_insertserialcontextprovider",ex); RemoteException re = new RemoteException("initSerialCtxProvider error", ex); throw re; } }
_nc.rebind(pth,(org.omg.CORBA.Object)obj); else _nc.bind(pth,(org.omg.CORBA.Object)obj);
public synchronized void registerName(String nameId, String nameKind) throws NotFound, CannotProceed, InvalidName, org.omg.CORBA.ORBPackage.InvalidName { if (nameId == null) { return; } namingContext_ = NamingContextHelper.narrow(getORB().resolve_initial_references("NameService")); NameComponent[] _name = new NameComponent[] { new NameComponent(nameId, nameKind) }; if (logger_.isInfoEnabled()) { logger_.info("namingContext.rebind(" + format(_name) + " => " + getCorbaLoc() + ")"); } namingContext_.rebind(_name, thisRef_); registeredName_ = _name; }
_nc.rebind(pth, (org.omg.CORBA.Object) obj); else _nc.bind(pth, (org.omg.CORBA.Object) obj);
contextName[0] = new NameComponent(serviceName, kind); rootContext.rebind(contextName, objRef);
_nc.rebind(pth, (org.omg.CORBA.Object) obj); else _nc.bind(pth, (org.omg.CORBA.Object) obj);
contextName[0] = new NameComponent(serviceName, kind); rootContext.rebind(contextName, objRef);
context.rebind(tail,obj); else context.bind(tail,obj);
/** * (Re)binds an object to a name in a given CORBA naming context, creating * any non-existent intermediate contexts along the way. * <p/> * This method is synchronized on the class object, if multiple services attempt to bind the * same context name at once it will fail * * @param ctx a reference to the COSNaming service. * @param strName the name under which the CORBA object is to be bound. * @param obj the CORBA object to be bound. * @throws Exception if an error occurs while binding the object. */ public static synchronized void rebind(final NamingContextExt ctx, final String strName, final org.omg.CORBA.Object obj) throws Exception { final NameComponent[] name = ctx.to_name(strName); NamingContext intermediateCtx = ctx; for (int i = 0; i < name.length - 1; i++) { final NameComponent[] relativeName = new NameComponent[]{name[i]}; try { intermediateCtx = NamingContextHelper.narrow( intermediateCtx.resolve(relativeName)); } catch (NotFound e) { intermediateCtx = intermediateCtx.bind_new_context(relativeName); } } intermediateCtx.rebind(new NameComponent[]{name[name.length - 1]}, obj); }
context.rebind(tail,obj); else context.bind(tail,obj);
contextName[0] = new NameComponent(serviceName, kind); rootContext.rebind(contextName, objRef);
context.rebind (bindname.components (), orb.string_to_object (ior)); else throw ab;
NameComponent nc = new NameComponent(TransactionFactoryHelper.id(), ""); NameComponent path[] = { nc }; namingContext.rebind(path, thisRef); } catch (Exception exc) { _logger.log(Level.WARNING,"jts.cannot_register_with_orb",
NameComponent nc = new NameComponent(TransactionFactoryHelper.id(),""); NameComponent path[] = {nc}; namingContext.rebind(path,factory);
context.rebind(subName, obj);
context.rebind(subName, obj); } else { NameComponent name = n[0];