Package org.omg.CosNaming

Examples of org.omg.CosNaming.NamingContext


            org.omg.CORBA.Object obj = orb.resolve_initial_references("NameService");
            initialContext = NamingContextExtHelper.narrow(obj);
            String[] names = tssLink.getJndiNames();
            for (int i = 0; i < names.length; i++) {
                NameComponent[] nameComponent = initialContext.to_name(names[i]);
                NamingContext currentContext = initialContext;
                NameComponent[] nc = new NameComponent[1];
                int lastComponent = nameComponent.length - 1;
                for (int j = 0; j < lastComponent; ++j) {
                    nc[0] = nameComponent[j];
                    try {
                        currentContext = NamingContextHelper.narrow(currentContext.resolve(nc));
                    } catch (NotFound nf) {
                        currentContext = currentContext.bind_new_context(nc);
                    }
                }
                nc[0] = nameComponent[lastComponent];
                currentContext.rebind(nc, homeReference);
            }
        } catch (Exception e) {
            throw new CORBAException(e);
        }
View Full Code Here


                initialContext.unbind(nameComponent);

                for (int j = nameComponent.length - 1; 0 < j; --j) {
                    NameComponent[] nc = new NameComponent[j];
                    System.arraycopy(nameComponent, 0, nc, 0, j);
                    NamingContext currentContext = NamingContextHelper.narrow(initialContext.resolve(nc));
                    try {
                        currentContext.destroy();
                    } catch (NotEmpty ne) {
                        break;
                    }
                }
            }
View Full Code Here

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

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

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

            }

        } else if (e instanceof CannotProceed) {

            ne = new CannotProceedException();
            NamingContext nc = ((CannotProceed) e).cxt;
            NameComponent[] rest = ((CannotProceed) e).rest_of_name;

            // %%% We assume that rest returns *all* unprocessed components.
            // Don't' know if that is a good assumption, given
            // NotFound doesn't set rest as expected. -RL
View Full Code Here

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

                // Use naming context object reference
                obj = ((CNCtx) obj)._nc;
            }

            if (obj instanceof org.omg.CosNaming.NamingContext) {
                NamingContext nobj = NamingContextHelper.narrow((org.omg.CORBA.Object) obj);
                if (rebind)
                    _nc.rebind_context(pth, nobj);
                else
                    _nc.bind_context(pth, nobj);
View Full Code Here

     */
    public void destroySubcontext(Name name)
            throws NamingException {
        if (_nc == null)
            throw JacORBMessages.MESSAGES.notANamingContext(name.toString());
        NamingContext the_nc = _nc;
        NameComponent[] path = org.jboss.as.jacorb.naming.jndi.CNNameParser.nameToCosName(name);
        if (name.size() > 0) {
            try {
                javax.naming.Context ctx =
                        (javax.naming.Context) callResolve(path);
View Full Code Here

    private javax.naming.Context callBindNewContext(NameComponent[] path)
            throws NamingException {
        if (_nc == null)
            throw JacORBMessages.MESSAGES.notANamingContext(path.toString());
        try {
            NamingContext nctx = _nc.bind_new_context(path);
            return new CNCtx(_orb, nctx, _env, makeFullName(path));
        } catch (Exception e) {
            throw org.jboss.as.jacorb.naming.jndi.ExceptionMapper.mapException(e, this, path);
        }
    }
View Full Code Here

TOP

Related Classes of org.omg.CosNaming.NamingContext

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.