public NamingContext new_context() { try { // create and initialize a new context. CorbaNamingContext newContextImpl = new CorbaNamingContext(); newContextImpl.init(this.poa, this.doPurge, this.noPing); // create the oid for the new context and activate it with the naming service POA. String oid = new String(this.poa.servant_to_id(this), StandardCharsets.UTF_8) + "/ctx" + (++this.childCount); this.poa.activate_object_with_id(oid.getBytes(StandardCharsets.UTF_8), newContextImpl); // add the newly-created context to the cache. contextImpls.put(oid, newContextImpl); return NamingContextExtHelper.narrow(this.poa.create_reference_with_id(oid.getBytes(StandardCharsets.UTF_8), "IDL:omg.org/CosNaming/NamingContextExt:1.0")); } catch (Exception e) { IIOPLogger.ROOT_LOGGER.failedToCreateNamingContext(e); return null; } }
if (isDead(ref)) unbind(n.components()); else throw new AlreadyBound(); if (isDead(ref)) { rebind_context(n.components(), obj); return; throw new CannotProceed(_this(), n.components()); org.omg.CORBA.Object context = this.resolve(ctx.components()); String contextOID = this.getObjectOID(context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) jbossContext.bind_context(ncx, obj); else NamingContextExtHelper.narrow(context).bind_context(ncx, obj);
if (isDead(ref)) { rebind(n.components(), obj); return; if (isDead(ref)) unbind(n.components()); throw new AlreadyBound(); throw new CannotProceed(_this(), n.components()); org.omg.CORBA.Object context = this.resolve(ctx.components()); String contextOID = this.getObjectOID(context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) jbossContext.bind(ncx, obj); else NamingContextExtHelper.narrow(context).bind(ncx, obj);
/** * <p> * Cleanup bindings, i.e. ping every object and remove bindings to non-existent objects. * </p> */ private void cleanup() { // Check if object purging enabled if (!this.doPurge) return; for (Name key : this.names.keySet()) { if (isDead(((org.omg.CORBA.Object) this.names.get(key)))) { this.names.remove(key); } } for (Name key : this.contexts.keySet()) { org.omg.CORBA.Object object = (org.omg.CORBA.Object) this.contexts.get(key); if (isDead(object)) { this.contexts.remove(key); String oid = this.getObjectOID(object); if (oid != null) contextImpls.remove(oid); } } }
public NamingContext bind_new_context(NameComponent[] nc) throws NotFound, CannotProceed, InvalidName, AlreadyBound { if (this.destroyed) throw new CannotProceed(); if (nc == null || nc.length == 0) throw new InvalidName(); NamingContext context = new_context(); if (context == null) throw new CannotProceed(); bind_context(nc, context); return context; }
public org.omg.CORBA.Object resolve(NameComponent[] nc) throws NotFound, CannotProceed, InvalidName { if (this.destroyed) throw new CannotProceed(); if (nc == null || nc.length == 0) throw new InvalidName(); Name n = new Name(nc[0]); if (nc.length > 1) { org.omg.CORBA.Object next_context = (org.omg.CORBA.Object) this.contexts.get(n); if ((next_context == null) || (isDead(next_context))) throw new NotFound(NotFoundReason.missing_node, nc); NameComponent[] nc_prime = new NameComponent[nc.length - 1]; System.arraycopy(nc, 1, nc_prime, 0, nc_prime.length); // try first to call the context implementation object directly. String contextOID = this.getObjectOID(next_context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) return jbossContext.resolve(nc_prime); else return NamingContextExtHelper.narrow(next_context).resolve(nc_prime); } else { org.omg.CORBA.Object result = (org.omg.CORBA.Object) this.contexts.get(n); if (result == null) result = (org.omg.CORBA.Object) this.names.get(n); if (result == null) throw new NotFound(NotFoundReason.missing_node, n.components()); if (!noPing && isDead(result)) throw new NotFound(NotFoundReason.missing_node, n.components()); return result; } }
org.omg.CORBA.Object context = this.resolve(ctx.components()); String contextOID = this.getObjectOID(context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) jbossContext.rebind(ncx, obj); else NamingContextExtHelper.narrow(context).rebind(ncx, obj);
ref._release(); String oid = this.getObjectOID(ref); if (oid != null) contextImpls.remove(oid); org.omg.CORBA.Object context = this.resolve(ctx.components()); String contextOID = this.getObjectOID(context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) jbossContext.rebind_context(ncx, obj); else NamingContextExtHelper.narrow(context).rebind_context(ncx, obj);
ref._release(); String oid = this.getObjectOID(ref); if (oid != null) contextImpls.remove(oid); org.omg.CORBA.Object context = this.resolve(ctx.components()); String contextOID = this.getObjectOID(context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) jbossContext.unbind(ncx); else NamingContextExtHelper.narrow(context).unbind(ncx);
public org.omg.CORBA.Object resolve(NameComponent[] nc) throws NotFound, CannotProceed, InvalidName { if (this.destroyed) throw new CannotProceed(); if (nc == null || nc.length == 0) throw new InvalidName(); Name n = new Name(nc[0]); if (nc.length > 1) { org.omg.CORBA.Object next_context = (org.omg.CORBA.Object) this.contexts.get(n); if ((next_context == null) || (isDead(next_context))) throw new NotFound(NotFoundReason.missing_node, nc); NameComponent[] nc_prime = new NameComponent[nc.length - 1]; System.arraycopy(nc, 1, nc_prime, 0, nc_prime.length); // try first to call the context implementation object directly. String contextOID = this.getObjectOID(next_context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) return jbossContext.resolve(nc_prime); else return NamingContextExtHelper.narrow(next_context).resolve(nc_prime); } else { org.omg.CORBA.Object result = (org.omg.CORBA.Object) this.contexts.get(n); if (result == null) result = (org.omg.CORBA.Object) this.names.get(n); if (result == null) throw new NotFound(NotFoundReason.missing_node, n.components()); if (!noPing && isDead(result)) throw new NotFound(NotFoundReason.missing_node, n.components()); return result; } }
org.omg.CORBA.Object context = this.resolve(ctx.components()); String contextOID = this.getObjectOID(context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) jbossContext.rebind(ncx, obj); else NamingContextExtHelper.narrow(context).rebind(ncx, obj);
ref._release(); String oid = this.getObjectOID(ref); if (oid != null) contextImpls.remove(oid); org.omg.CORBA.Object context = this.resolve(ctx.components()); String contextOID = this.getObjectOID(context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) jbossContext.rebind_context(ncx, obj); else NamingContextExtHelper.narrow(context).rebind_context(ncx, obj);
ref._release(); String oid = this.getObjectOID(ref); if (oid != null) contextImpls.remove(oid); org.omg.CORBA.Object context = this.resolve(ctx.components()); String contextOID = this.getObjectOID(context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) jbossContext.unbind(ncx); else NamingContextExtHelper.narrow(context).unbind(ncx);
public NamingContext bind_new_context(NameComponent[] nc) throws NotFound, CannotProceed, InvalidName, AlreadyBound { if (this.destroyed) throw new CannotProceed(); if (nc == null || nc.length == 0) throw new InvalidName(); NamingContext context = new_context(); if (context == null) throw new CannotProceed(); bind_context(nc, context); return context; }
/** * <p> * Cleanup bindings, i.e. ping every object and remove bindings to non-existent objects. * </p> */ private void cleanup() { // Check if object purging enabled if (!this.doPurge) return; for (Name key : this.names.keySet()) { if (isDead(((org.omg.CORBA.Object) this.names.get(key)))) { this.names.remove(key); } } for (Name key : this.contexts.keySet()) { org.omg.CORBA.Object object = (org.omg.CORBA.Object) this.contexts.get(key); if (isDead(object)) { this.contexts.remove(key); String oid = this.getObjectOID(object); if (oid != null) contextImpls.remove(oid); } } }
if (isDead(ref)) unbind(n.components()); else throw new AlreadyBound(); if (isDead(ref)) { rebind_context(n.components(), obj); return; throw new CannotProceed(_this(), n.components()); org.omg.CORBA.Object context = this.resolve(ctx.components()); String contextOID = this.getObjectOID(context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) jbossContext.bind_context(ncx, obj); else NamingContextExtHelper.narrow(context).bind_context(ncx, obj);
if (isDead(ref)) { rebind(n.components(), obj); return; if (isDead(ref)) unbind(n.components()); throw new AlreadyBound(); throw new CannotProceed(_this(), n.components()); org.omg.CORBA.Object context = this.resolve(ctx.components()); String contextOID = this.getObjectOID(context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) jbossContext.bind(ncx, obj); else NamingContextExtHelper.narrow(context).bind(ncx, obj);
public org.omg.CORBA.Object resolve(NameComponent[] nc) throws NotFound, CannotProceed, InvalidName { if (this.destroyed) throw new CannotProceed(); if (nc == null || nc.length == 0) throw new InvalidName(); Name n = new Name(nc[0]); if (nc.length > 1) { org.omg.CORBA.Object next_context = (org.omg.CORBA.Object) this.contexts.get(n); if ((next_context == null) || (isDead(next_context))) throw new NotFound(NotFoundReason.missing_node, nc); NameComponent[] nc_prime = new NameComponent[nc.length - 1]; System.arraycopy(nc, 1, nc_prime, 0, nc_prime.length); // try first to call the context implementation object directly. String contextOID = this.getObjectOID(next_context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) return jbossContext.resolve(nc_prime); else return NamingContextExtHelper.narrow(next_context).resolve(nc_prime); } else { org.omg.CORBA.Object result = (org.omg.CORBA.Object) this.contexts.get(n); if (result == null) result = (org.omg.CORBA.Object) this.names.get(n); if (result == null) throw new NotFound(NotFoundReason.missing_node, n.components()); if (!noPing && isDead(result)) throw new NotFound(NotFoundReason.missing_node, n.components()); return result; } }