Package org.omg.CosNaming

Examples of org.omg.CosNaming.NameComponent


            // 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();
            org.omg.CORBA.Object obj = resolveObject(name, type);
            if (obj == null) {
                // Object was not found
View Full Code Here


            // 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.
                BindingTypeHolder type = new BindingTypeHolder();
                org.omg.CORBA.Object obj = unbindObject(name);
                if (obj == null) {
View Full Code Here

                else {
                    // we have an id already, pull off the kind
                    kind = component.toString();
                }
                // add the parsed name component
                components.add(new NameComponent(id, kind));
                // make sure these are all reset after pulling off a component
                component.setLength(0);
                id = null;
                kind = null;
            }
            else {
                component.append(ch);
            }
        }

        // parse the last section
        // not seen a id/kind separator yet?  This is an id with no kind
        if (id == null) {
            id = component.toString();
            kind = "";
        }
        else {
            // we have an id already, pull off the kind
            kind = component.toString();
        }
        // add the parsed name component
        components.add(new NameComponent(id, kind));

        // and turn this into a component array
        return (NameComponent[])components.toArray(new NameComponent[components.size()]);
    }
View Full Code Here

        if (n.length < 1) {
            throw new InvalidName();
        }

        // we have at least one name, so validate the toplevel item
        NameComponent name = n[0];

        // more name validation
        if (name.id.length() == 0 && name.kind.length() == 0) {
            throw new InvalidName();
        }
View Full Code Here

        if (hasMore) {
            InternalBindingKey theBindingKey =
                 ((InternalBindingKey)theEnumeration.nextElement());
            InternalBindingValue theElement =
                (InternalBindingValue)theHashtable.get( theBindingKey );
            NameComponent n = new NameComponent( theBindingKey.id, theBindingKey.kind );
            NameComponent[] nlist = new NameComponent[1];
            nlist[0] = n;
            BindingType theType = theElement.theBindingType;

            b.value =
View Full Code Here

                id = "";
        }
        if( kind == null ) {
                kind = "";
        }
        return new NameComponent( id, kind );
   }
View Full Code Here

            SMSGatewayServant smsGateway = new SMSGatewayServant();
            Object smsGatewayRef = rootPoa.servant_to_reference(smsGateway);

            String corbaServerName = "SMSGatewayCORBAService";
            NameComponent[] name = {new NameComponent(corbaServerName, "")};
            namingCtx.rebind(name, smsGatewayRef);

            System.out.println("CORBA server running - press Enter to shutdown");
            System.in.read();
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

    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

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.