Package org.omg.CosNaming

Examples of org.omg.CosNaming.NameComponent


    @Test
    public void test_arraysPassing_tuscanyAsService() {
        try {
            org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
            NamingContext ncRef = NamingContextHelper.narrow(objRef);
            NameComponent nc = new NameComponent(TUSCANY_SERVICE_NAME, "");
            NameComponent path[] = {nc};
            ScenarioSix ref = ScenarioSixHelper.narrow(ncRef.resolve(path));
            String[][] stringArg = getStringArray();
            String[][] stringRes = ref.passStringArray(stringArg);
            assertTrue(areArraysEqual(stringArg, stringRes));
            AnnotatedStruct structArg = new AnnotatedStruct();
View Full Code Here


    @Test
    public void test_unionsPassing_tuscanyAsService() {
        try {
            org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
            NamingContext ncRef = NamingContextHelper.narrow(objRef);
            NameComponent nc = new NameComponent(TUSCANY_SERVICE_NAME, "");
            NameComponent path[] = {nc};
            ScenarioSix ref = ScenarioSixHelper.narrow(ncRef.resolve(path));
            RichUnion arg = new RichUnion();
            InnerUnion inner = new InnerUnion();
            inner.y(20f);
            arg.iu(inner);
View Full Code Here

                    Assert.fail("The naming server cannot be started");
                }
                orb = server.getORB();
                org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
                NamingContext ncRef = NamingContextHelper.narrow(objRef);
                NameComponent nc = new NameComponent(GENERATED_SERVICE_NAME, "");
                NameComponent path[] = {nc};
                ScenarioTwo scenarioTwo = new ScenarioTwoServant();
                ncRef.rebind(path, scenarioTwo);
            } catch (Throwable e) {
                e.printStackTrace();
                Assert.fail(e.getMessage());
View Full Code Here

    public void test_getneratedGetSetAttribute() {
        try {
            orb = server.getORB();
            org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
            NamingContext ncRef = NamingContextHelper.narrow(objRef);
            NameComponent nc = new NameComponent(TUSCANY_SERVICE_NAME, "");
            NameComponent path[] = {nc};
            ScenarioTwo st = ScenarioTwoHelper.narrow(ncRef.resolve(path));
            st.stringField("");
            assertEquals("", st.stringField());
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

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

    public void registerServant(String uri, Object servantObject) throws CorbaHostException {
        CorbanameURL details = CorbaHostUtils.getServiceDetails(uri);
        try {
            NamingContext namingCtx = getNamingContext(details.getNameService());
            for (int i = 0; i < details.getNamePath().size() - 1; i++) {
                NameComponent nc = new NameComponent(details.getNamePath().get(i), "");
                NameComponent[] path = new NameComponent[] {nc};
                try {
                    namingCtx = NamingContextHelper.narrow(namingCtx.resolve(path));
                } catch (Exception e) {
                    namingCtx = namingCtx.bind_new_context(path);
                }
            }
            NameComponent finalName =
                new NameComponent(details.getNamePath().get(details.getNamePath().size() - 1), "");
            try {
                namingCtx.resolve(new NameComponent[] {finalName});
                // no exception means that some object is already registered
                // under this name, we need to crash here
                throw new CorbaHostException(CorbaHostException.BINDING_IN_USE);
View Full Code Here

            NameComponent[] subName = extractSubName(n);

            // now pass this along to the next context for the real bind operation.
            context.bind(subName, obj);
        } else {
            NameComponent name = n[0];
            // we need the resolveObject() and bindObject() calls to be consistent, so
            // synchronize on this
            synchronized (this) {
                // see if we have this bound already...can't replace these.
                BindingTypeHolder type = new BindingTypeHolder();
View Full Code Here

            NameComponent[] subName = extractSubName(n);

            // now pass this along to the next context for the real bind operation.
            context.rebind(subName, obj);
        } else {
            NameComponent name = n[0];
            // we need the resolveObject() and bindObject() calls to be consistent, so
            // synchronize on this
            synchronized (this) {
                // see if we have this bound already...can't replace these.
                BindingTypeHolder type = new BindingTypeHolder();
View Full Code Here

            NameComponent[] subName = extractSubName(n);

            // now pass this along to the next context for the real bind operation.
            context.bind_context(subName, nc);
        } else {
            NameComponent name = n[0];
            // we need the resolveObject() and bindObject() calls to be consistent, so
            // synchronize on this
            synchronized (this) {
                // see if we have this bound already...can't replace these.
                BindingTypeHolder type = new BindingTypeHolder();
View Full Code Here

            NameComponent[] subName = extractSubName(n);

            // now pass this along to the next context for the real bind operation.
            context.rebind_context(subName, nc);
        } else {
            NameComponent name = n[0];
            // we need the resolveObject() and bindObject() calls to be consistent, so
            // synchronize on this
            synchronized (this) {
                // see if we have this bound already...can't replace these.
                BindingTypeHolder type = new BindingTypeHolder();
View Full Code Here

TOP

Related Classes of org.omg.CosNaming.NameComponent

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.