private void setOrbAndRootContext(ORB orb, org.omg.CORBA.Object ncRef) throws NamingException { _orb = orb; try { _nc = NamingContextHelper.narrow(ncRef); if (_nc == null) { throw IIOPLogger.ROOT_LOGGER.errorConvertingIORToNamingCtx(ncRef.toString()); } } catch (org.omg.CORBA.COMM_FAILURE e) { NamingException ne = IIOPLogger.ROOT_LOGGER.errorConnectingToORB(); ne.setRootCause(e); throw ne; } }
/** * (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); }
/** * Does the job of calling the COS Naming API, * resolve, and performs the exception mapping. If the resolved * object is a COS Naming Context (sub-context), then this function * returns a new JNDI naming context object. * * @param path the NameComponent[] object. * @return Resolved object returned by the COS Name Server. * @throws NotFound No objects under the name. * @throws org.omg.CosNaming.NamingContextPackage.CannotProceed Unable to obtain a continuation context * @throws org.omg.CosNaming.NamingContextPackage.InvalidName Name not understood. */ java.lang.Object callResolve(NameComponent[] path) throws NamingException { try { org.omg.CORBA.Object obj = _nc.resolve(path); try { NamingContext nc = NamingContextHelper.narrow(obj); if (nc != null) { return new CNCtx(_orb, nc, _env, makeFullName(path)); } else { return obj; } } catch (org.omg.CORBA.SystemException e) { return obj; } } catch (Exception e) { throw org.wildfly.iiop.openjdk.naming.jndi.ExceptionMapper.mapException(e, this, path); } }
NamingContext nobj = NamingContextHelper.narrow((org.omg.CORBA.Object) obj); if (rebind) _nc.rebind_context(pth, nobj);
try { org.omg.CORBA.Object obj = _nc.resolve(_name); _nc = NamingContextHelper.narrow(obj); if (_nc == null) { throw IIOPLogger.ROOT_LOGGER.notANamingContext(insName);
ncRef = _orb.resolve_initial_references("NameService"); _nc = NamingContextHelper.narrow(ncRef); if (_nc == null) { if (ncIor != null) {
public org.omg.CosNaming.NamingContext _this(org.omg.CORBA.ORB orb) { org.omg.CORBA.Object __o = _this_object(orb) ; org.omg.CosNaming.NamingContext __r = org.omg.CosNaming.NamingContextHelper.narrow(__o); return __r; } public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler)
public static org.omg.CosNaming.NamingContext read (org.omg.CORBA.portable.InputStream istream) { return narrow (istream.read_Object (_NamingContextStub.class)); }
public NamingContext _this() { return NamingContextHelper.narrow( super._this_object()); }
public NamingContext _this() { return NamingContextHelper.narrow( super._this_object()); }
public org.omg.CosNaming.NamingContext _this(org.omg.CORBA.ORB orb) { org.omg.CORBA.Object __o = _this_object(orb) ; org.omg.CosNaming.NamingContext __r = org.omg.CosNaming.NamingContextHelper.narrow(__o); return __r; } public NamingContextOperations _delegate()
public NamingContext _this() { return NamingContextHelper.narrow( super._this_object()); }
public NamingContext _this(org.omg.CORBA.ORB orb) { return NamingContextHelper.narrow( super._this_object(orb)); }
public static NamingContext read(final org.omg.CORBA.portable.InputStream in) { return narrow(in.read_Object(org.omg.CosNaming._NamingContextStub.class)); } public static void write(final org.omg.CORBA.portable.OutputStream _out, final org.omg.CosNaming.NamingContext s)
public org.omg.CosNaming.NamingContext _this(org.omg.CORBA.ORB orb) { org.omg.CORBA.Object __o = _this_object(orb) ; org.omg.CosNaming.NamingContext __r = org.omg.CosNaming.NamingContextHelper.narrow(__o); return __r; } public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler)
public org.omg.CosNaming.NamingContext _this() { org.omg.CORBA.Object __o = _this_object() ; org.omg.CosNaming.NamingContext __r = org.omg.CosNaming.NamingContextHelper.narrow(__o); return __r; } public org.omg.CosNaming.NamingContext _this(org.omg.CORBA.ORB orb)
public static NamingContext read(final org.omg.CORBA.portable.InputStream in) { return narrow(in.read_Object(org.omg.CosNaming._NamingContextStub.class)); } public static void write(final org.omg.CORBA.portable.OutputStream _out, final org.omg.CosNaming.NamingContext s)
public org.omg.CosNaming.NamingContext _this(org.omg.CORBA.ORB orb) { org.omg.CORBA.Object __o = _this_object(orb) ; org.omg.CosNaming.NamingContext __r = org.omg.CosNaming.NamingContextHelper.narrow(__o); return __r; } public NamingContextOperations _delegate()
public org.omg.CosNaming.NamingContext _this() { org.omg.CORBA.Object __o = _this_object() ; org.omg.CosNaming.NamingContext __r = org.omg.CosNaming.NamingContextHelper.narrow(__o); return __r; } public org.omg.CosNaming.NamingContext _this(org.omg.CORBA.ORB orb)
public NamingContext _this(org.omg.CORBA.ORB orb) { return NamingContextHelper.narrow( super._this_object(orb)); }