Package org.jacorb.naming

Examples of org.jacorb.naming.Name


            throw new CannotProceed();

        if (nc == null || nc.length == 0)
            throw new InvalidName();

        Name n = new Name(nc);
        Name ctx = n.ctxName();
        NameComponent nb = n.baseNameComponent();

        if (ctx == null) {
            if (this.names.containsKey(n)) {
                org.omg.CORBA.Object ref = (org.omg.CORBA.Object) this.names.remove(n);
                ref._release();
                JacORBLogger.ROOT_LOGGER.debugUnboundObject(n.toString());
            } else if (this.contexts.containsKey(n)) {
                org.omg.CORBA.Object ref = (org.omg.CORBA.Object) this.contexts.remove(n);
                ref._release();
                // remove the context from the implementation cache.
                String oid = this.getObjectOID(ref);
                if (oid != null)
                    contextImpls.remove(oid);

                JacORBLogger.ROOT_LOGGER.debugUnboundObject(n.toString());
            } else {
                JacORBLogger.ROOT_LOGGER.failedToUnbindObject(n.toString());
                throw new NotFound(NotFoundReason.not_context, n.components());
            }
        } else {
            NameComponent[] ncx = new NameComponent[]{nb};
            org.omg.CORBA.Object context = this.resolve(ctx.components());

            // try first to call the context implementation object directly.
            String contextOID = this.getObjectOID(context);
            CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID));
            if (jbossContext != null)
View Full Code Here


            throw new InvalidName();

        if (obj == null)
            throw new org.omg.CORBA.BAD_PARAM();

        Name n = new Name(nc);
        Name ctx = n.ctxName();
        NameComponent nb = n.baseNameComponent();

        if (ctx == null) {
            if (this.names.containsKey(n)) {
                // if the name is still in use, try to ping the object
                org.omg.CORBA.Object ref = (org.omg.CORBA.Object) this.names.get(n);
                if (isDead(ref)) {
                    rebind(n.components(), obj);
                    return;
                }
                throw new AlreadyBound();
            } else if (this.contexts.containsKey(n)) {
                // if the name is still in use, try to ping the object
                org.omg.CORBA.Object ref = (org.omg.CORBA.Object) this.contexts.get(n);
                if (isDead(ref))
                    unbind(n.components());
                throw new AlreadyBound();
            }

            if ((this.names.put(n, obj)) != null)
                throw new CannotProceed(_this(), n.components());

            JacORBLogger.ROOT_LOGGER.debugBoundName(n.toString());
        } else {
            NameComponent[] ncx = new NameComponent[]{nb};
            org.omg.CORBA.Object context = this.resolve(ctx.components());

            // try first to call the context implementation object directly.
            String contextOID = this.getObjectOID(context);
            CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID));
            if (jbossContext != null)
View Full Code Here

    }
      }
  }
  if (node.getAllowsChildren())
  {
      Name bindname = new Name(name);
      if( context == null )
    System.err.println("context null ");

      if( bindname.components() == null )
    System.err.println("name is null ");

      context.bind_new_context(bindname.components());
      update();
  }
  else
  {
      JOptionPane.showMessageDialog(this,
View Full Code Here

    }
      }
  }
  if (node.getAllowsChildren())
  {
      Name bindname = new Name(name);
      if( context == null )
    System.err.println("context null ");

      if( bindname.components() == null )
    System.err.println("name is null ");
                                                  
            try
            {                                                  
                context.bind( bindname.components(), orb.string_to_object( ior ));
            }
            catch( AlreadyBound ab )
            {
                if (isRebind)
                    context.rebind( bindname.components(), orb.string_to_object( ior ));
                else
                    throw ab;
            }
      update();
  }
View Full Code Here

            throw new InvalidName();

        if (obj == null)
            throw new org.omg.CORBA.BAD_PARAM();

        Name n = new Name(nc);
        Name ctx = n.ctxName();
        NameComponent nb = n.baseNameComponent();

        if (ctx == null) {
            if (this.names.containsKey(n)) {
                // if the name is still in use, try to ping the object
                org.omg.CORBA.Object ref = (org.omg.CORBA.Object) this.names.get(n);
                if (isDead(ref)) {
                    rebind(n.components(), obj);
                    return;
                }
                throw new AlreadyBound();
            } else if (this.contexts.containsKey(n)) {
                // if the name is still in use, try to ping the object
                org.omg.CORBA.Object ref = (org.omg.CORBA.Object) this.contexts.get(n);
                if (isDead(ref))
                    unbind(n.components());
                throw new AlreadyBound();
            }

            if ((this.names.put(n, obj)) != null)
                throw new CannotProceed(_this(), n.components());

            JacORBLogger.ROOT_LOGGER.debugBoundName(n.toString());
        } else {
            NameComponent[] ncx = new NameComponent[]{nb};
            org.omg.CORBA.Object context = this.resolve(ctx.components());

            // try first to call the context implementation object directly.
            String contextOID = this.getObjectOID(context);
            CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID));
            if (jbossContext != null)
View Full Code Here

    public void bind_context(NameComponent[] nc, NamingContext obj) throws NotFound, CannotProceed, InvalidName,
            AlreadyBound {
        if (this.destroyed)
            throw new CannotProceed();

        Name n = new Name(nc);
        Name ctx = n.ctxName();
        NameComponent nb = n.baseNameComponent();

        if (ctx == null) {
            if (this.names.containsKey(n)) {
                // if the name is still in use, try to ping the object
                org.omg.CORBA.Object ref = (org.omg.CORBA.Object) this.names.get(n);
                if (isDead(ref))
                    unbind(n.components());
                else
                    throw new AlreadyBound();
            } else if (this.contexts.containsKey(n)) {
                // if the name is still in use, try to ping the object
                org.omg.CORBA.Object ref = (org.omg.CORBA.Object) this.contexts.get(n);
                if (isDead(ref)) {
                    rebind_context(n.components(), obj);
                    return;
                }
                throw new AlreadyBound();
            }

            if ((this.contexts.put(n, obj)) != null)
                throw new CannotProceed(_this(), n.components());

            JacORBLogger.ROOT_LOGGER.debugBoundContext(n.toString());
        } else {
            NameComponent[] ncx = new NameComponent[]{nb};
            org.omg.CORBA.Object context = this.resolve(ctx.components());

            // try first to call the context implementation object directly.
            String contextOID = this.getObjectOID(context);
            CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID));
            if (jbossContext != null)
View Full Code Here

            throw new InvalidName();

        if (obj == null)
            throw new org.omg.CORBA.BAD_PARAM();

        Name n = new Name(nc);
        Name ctx = n.ctxName();
        NameComponent nb = n.baseNameComponent();

        if (ctx == null) {
            // the name is bound, but it is bound to a context - the client should have been using rebind_context!
            if (this.contexts.containsKey(n))
                throw new NotFound(NotFoundReason.not_object, new NameComponent[]{nb});

            // try remove an existing binding.
            org.omg.CORBA.Object ref = (org.omg.CORBA.Object) this.names.remove(n);
            if (ref != null)
                ref._release();

            // do the rebinding in this context
            this.names.put(n, obj);
            JacORBLogger.ROOT_LOGGER.debugBoundName(n.toString());
        } else {
            // rebind in the correct context
            NameComponent[] ncx = new NameComponent[]{nb};
            org.omg.CORBA.Object context = this.resolve(ctx.components());

            // try first to call the context implementation object directly.
            String contextOID = this.getObjectOID(context);
            CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID));
            if (jbossContext != null)
View Full Code Here

            throw new InvalidName();

        if (obj == null)
            throw new org.omg.CORBA.BAD_PARAM();

        Name n = new Name(nc);
        Name ctx = n.ctxName();
        NameComponent nb = n.baseNameComponent();

        if (ctx == null) {
            // the name is bound, but it is bound to an object - the client should have been using rebind().
            if (this.names.containsKey(n))
                throw new NotFound(NotFoundReason.not_context, new NameComponent[]{nb});

            // try to remove an existing context binding.
            org.omg.CORBA.Object ref = (org.omg.CORBA.Object) this.contexts.remove(n);
            if (ref != null) {
                ref._release();
                // remove the old context from the implementation cache.
                String oid = this.getObjectOID(ref);
                if (oid != null)
                    contextImpls.remove(oid);
            }

            this.contexts.put(n, obj);
            JacORBLogger.ROOT_LOGGER.debugBoundContext(n.baseNameComponent().id);
        } else {
            // rebind in the correct context
            NameComponent[] ncx = new NameComponent[]{nb};
            org.omg.CORBA.Object context = this.resolve(ctx.components());

            // try first to call the context implementation object directly.
            String contextOID = this.getObjectOID(context);
            CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID));
            if (jbossContext != null)
View Full Code Here

            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;
        }
    }
View Full Code Here

            throw new CannotProceed();

        if (nc == null || nc.length == 0)
            throw new InvalidName();

        Name n = new Name(nc);
        Name ctx = n.ctxName();
        NameComponent nb = n.baseNameComponent();

        if (ctx == null) {
            if (this.names.containsKey(n)) {
                org.omg.CORBA.Object ref = (org.omg.CORBA.Object) this.names.remove(n);
                ref._release();
                JacORBLogger.ROOT_LOGGER.debugUnboundObject(n.toString());
            } else if (this.contexts.containsKey(n)) {
                org.omg.CORBA.Object ref = (org.omg.CORBA.Object) this.contexts.remove(n);
                ref._release();
                // remove the context from the implementation cache.
                String oid = this.getObjectOID(ref);
                if (oid != null)
                    contextImpls.remove(oid);

                JacORBLogger.ROOT_LOGGER.debugUnboundObject(n.toString());
            } else {
                JacORBLogger.ROOT_LOGGER.failedToUnbindObject(n.toString());
                throw new NotFound(NotFoundReason.not_context, n.components());
            }
        } else {
            NameComponent[] ncx = new NameComponent[]{nb};
            org.omg.CORBA.Object context = this.resolve(ctx.components());

            // try first to call the context implementation object directly.
            String contextOID = this.getObjectOID(context);
            CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID));
            if (jbossContext != null)
View Full Code Here

TOP

Related Classes of org.jacorb.naming.Name

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.