Examples of NamingContext


Examples of org.omg.CosNaming.NamingContext

        // do we need to push through to a deeper naming context first?
        if (n.length > 1) {
            // resolve the top level name to a context, and have that context
            // resolve the rest.
            NamingContext context = resolveContext(n[0]);
            NameComponent[] subName = extractSubName(n);

            // now pass this along to the next context for the real bind operation.
            return context.resolve(subName);
        }
        else {
            NameComponent name = n[0];
            // see if we have this bound already...can't replace these.
            BindingTypeHolder type = new BindingTypeHolder();
View Full Code Here

Examples of org.omg.CosNaming.NamingContext

        // do we need to push through to a deeper naming context first?
        if (n.length > 1) {
            // resolve the top level name to a context, and have that context
            // resolve the rest.
            NamingContext context = resolveContext(n[0]);
            NameComponent[] subName = extractSubName(n);

            // now pass this along to the next context for the real bind operation.
            context.unbind(subName);
        }
        else {
            NameComponent name = n[0];
            synchronized (this) {
                // see if we have this bound already...can't replace these.
View Full Code Here

Examples of org.omg.CosNaming.NamingContext

     * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
     */
    public synchronized org.omg.CosNaming.NamingContext bind_new_context(org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.AlreadyBound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName {
        logNameComponent("bind_new_context() name", n);

        NamingContext context = new_context();
        try {
            bind_context(n, context);
            NamingContext returnContext = context;
            // transfer this to another variable so the finally block doesn't try to destroy this.
            context = null;
            return returnContext;
        } finally {
            // if there is a bind failure on this, we need to ensure the context has
View Full Code Here

Examples of org.omg.CosNaming.NamingContext

     * Binds servant implementation to name
     */
    private void bindServant(DynaCorbaServant servant, String name) {
        try {
            Object nameService = orb.resolve_initial_references("NameService");
            NamingContext namingContext = NamingContextHelper.narrow(nameService);

            NameComponent nc = new NameComponent(name, "");
            NameComponent[] path = new NameComponent[] {nc};
            namingContext.rebind(path, servant);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

Examples of org.omg.CosNaming.NamingContext

     * @return
     */
    private org.omg.CORBA.Object bindReference(String name) {
        try {
            org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
            NamingContext ncRef = NamingContextHelper.narrow(objRef);
            NameComponent nc = new NameComponent(name, "");
            NameComponent path[] = {nc};
            return ncRef.resolve(path);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
View Full Code Here

Examples of org.omg.CosNaming.NamingContext

                e.printStackTrace();
                Assert.fail(e.getMessage());
            }

            Object nameService = orb.resolve_initial_references("NameService");
            NamingContext namingContext = NamingContextHelper.narrow(nameService);

            PrimitivesSetterServant singleSetter = new PrimitivesSetterServant();
            ArraysSetterServant arraysSetter = new ArraysSetterServant();
            TestObjectServant complexObject = new TestObjectServant();
            CalcServant calcObject = new CalcServant();
            ObjectManagerServant objectManager = new ObjectManagerServant();
            EnumManagerServant enumManager = new EnumManagerServant();
            ArraysUnionsServant arraysUnions = new ArraysUnionsServant();

            orb.connect(singleSetter);
            orb.connect(arraysSetter);

            NameComponent nc;
            NameComponent[] path;

            nc = new NameComponent("PrimitivesSetter", "");
            path = new NameComponent[] {nc};
            namingContext.rebind(path, singleSetter);

            nc = new NameComponent("ArraysSetter", "");
            path = new NameComponent[] {nc};
            namingContext.rebind(path, arraysSetter);

            nc = new NameComponent("TestObject", "");
            path = new NameComponent[] {nc};
            namingContext.rebind(path, complexObject);

            nc = new NameComponent("CalcObject", "");
            path = new NameComponent[] {nc};
            namingContext.rebind(path, calcObject);

            nc = new NameComponent("ObjectManager", "");
            path = new NameComponent[] {nc};
            namingContext.rebind(path, objectManager);

            nc = new NameComponent("EnumManager", "");
            path = new NameComponent[] {nc};
            namingContext.rebind(path, enumManager);

            nc = new NameComponent("ArraysUnions", "");
            path = new NameComponent[] {nc};
            namingContext.rebind(path, arraysUnions);

            NamingContextExt nce = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));

            refArraysSetter = nce.resolve(nce.to_name("ArraysSetter"));
            refPrimitivesSetter = nce.resolve(nce.to_name("PrimitivesSetter"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.