Examples of ORB


Examples of org.omg.CORBA.ORB

    }

    // Standalone program initialization
    public static void main(String args[]) {
  int status = 0;
  ORB orb = null;

    java.util.Properties props = new Properties();
    props.putAll(System.getProperties());
  props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB");
  props.put("org.omg.CORBA.ORBSingletonClass",
      "org.apache.yoko.orb.CORBA.ORBSingleton");
  props.put("yoko.orb.id", "HelloWorld-Client");

  try {
            orb = ORB.init(args, props);
      status = run(orb, args);
  } catch(Exception ex) {
      ex.printStackTrace();
      status = 1;
  }

  if(orb != null) {
      try {
    orb.destroy();
      } catch(Exception ex) {
    ex.printStackTrace();
    status = 1;
      }
  }
View Full Code Here

Examples of org.omg.CORBA.ORB

        } catch (Exception ex) {
            ex.printStackTrace();           
        }
        OutputStream os = message.getContent(OutputStream.class);
        assertTrue("OutputStream should not be null", os != null);       
        ORB orb = (ORB)message.get("orb");
        assertTrue("Orb should not be null", orb != null);
        Object obj = message.get("endpoint");
        assertTrue("EndpointReferenceType should not be null", obj != null);
        destination.shutdown();
    }
View Full Code Here

Examples of org.omg.CORBA.ORB

        props.put("yoko.orb.id", "HelloWorld-Server");
        // for this demo, start on localhost, port 40000
        props.put("yoko.orb.oa.endpoint", "iiop --host localhost --port 40000");

        int status = 0;
        ORB orb = null;

        try {
            orb = ORB.init(args, props);
            status = run(orb, args);
        } catch(Exception ex) {
            ex.printStackTrace();
            status = 1;
        }

        if(orb != null) {
            try {
                orb.destroy();
            } catch(Exception ex) {
                ex.printStackTrace();
                status = 1;
            }
        }
View Full Code Here

Examples of org.omg.CORBA.ORB

    public void testInterface( )
        throws Exception
    {
        String name = "mark.comps.Add";
        String ref[] = { "-ORBInitRef", getCORBALoc(name) };
        ORB orb = ORB.init( ref, null );

        System.out.println( "corbaloc = " + ref[1] );
        System.out.println( "orb = " + orb );

        org.omg.CORBA.Object obj = orb.resolve_initial_references( name );
        System.out.println( "obj = " + obj );

        Add a = AddHelper.narrow( obj );
        System.out.println( "a = " + a );
View Full Code Here

Examples of org.omg.CORBA.ORB

    //                     "-ORBInitialHost", _host };

        String name = "NameService";
        String ref[] = { "-ORBInitRef", getCORBALoc(name) };

        ORB orb = ORB.init( ref, null );

        NamingContext nctx = NamingContextHelper.narrow( orb.resolve_initial_references(name) );
        System.out.println( "nctx = " + nctx );

        if (nctx != null)
        {
            //NameComponent nc = new NameComponent( "RMI:mark.comps.Add:0000000000000000", "mark.comps.Add" );
View Full Code Here

Examples of org.omg.CORBA.ORB

    }

    public void testIOR( )
        throws Exception
    {
        ORB orb = ORB.init( (String[])null, null );
        System.out.println( "orb = " + orb );

        org.omg.CORBA.Object obj = orb.string_to_object( _ior );
        System.out.println( "obj = " + obj );

        Add a = AddHelper.narrow( obj );
        System.out.println( "a = " + a );
View Full Code Here

Examples of org.omg.CORBA.ORB

                    if (obj instanceof PortableRemoteObject && obj instanceof Remote) {
                        Tie tie = javax.rmi.CORBA.Util.getTie((Remote) obj);
                        if (tie == null) {
                            throw new IOException("Unable to serialize PortableRemoteObject; object has not been exported: " + obj);
                        }
                        ORB orb = getORB();
                        tie.orb(orb);
                        obj = PortableRemoteObject.toStub((Remote) obj);
                    }
                    out.write(L);
                    out.writeObject(type);
View Full Code Here

Examples of org.omg.CORBA.ORB

                    case L:
                        clazz = (Class) in.readObject();
                        obj = in.readObject();
                        if (obj instanceof Stub) {
                            Stub stub = (Stub) obj;
                            ORB orb = getORB();
                            stub.connect(orb);
                        }
                        break;
                    default:
                        throw new IOException("Unkown data type: " + type);
View Full Code Here

Examples of org.omg.CORBA.ORB

     *
     * @return An ORB instance configured for the CORBABean.
     * @exception ConfigException
     */
    public ORB createServerORB(CORBABean serverthrows ConfigException {
        ORB orb = createORB(server.getURI(), server, translateToArgs(server), translateToProps(server));

        // check the tss config for a transport mech definition.  If we have one, then
        // the port information will be passed in that config, and the port in the IIOP profile
        // needs to be zero.
        TSSConfig config = server.getTssConfig();
        TSSTransportMechConfig transportMech = config.getTransport_mech();
        if (transportMech != null) {
            if (transportMech instanceof TSSSSLTransportConfig) {
                Any any = orb.create_any();
                any.insert_boolean(true);

                try {
                    Policy portPolicy = orb.create_policy(ZERO_PORT_POLICY_ID.value, any);
                    Policy[] overrides = new Policy [] { portPolicy };
                    server.setPolicyOverrides(overrides);
                } catch (org.omg.CORBA.PolicyError e) {
                    // shouldn't happen, but we'll let things continue with no policy set.
                }
View Full Code Here

Examples of org.omg.CORBA.ORB

     *
     * @return An ORB instance configured for the CORBABean.
     * @exception ConfigException
     */
    public ORB createServerORB(CORBABean serverthrows ConfigException {
        ORB orb = createORB(server.getURI(), server, translateToArgs(server), translateToProps(server));

        // check the tss config for a transport mech definition.  If we have one, then
        // the port information will be passed in that config, and the port in the IIOP profile
        // needs to be zero.
        TSSConfig config = server.getTssConfig();
        TSSTransportMechConfig transportMech = config.getTransport_mech();
        if (transportMech != null) {
            if (transportMech instanceof TSSSSLTransportConfig) {
                Any any = orb.create_any();
                any.insert_boolean(true);

                try {
                    Policy portPolicy = orb.create_policy(ZERO_PORT_POLICY_ID.value, any);
                    Policy[] overrides = new Policy [] { portPolicy };
                    server.setPolicyOverrides(overrides);
                } catch (org.omg.CORBA.PolicyError e) {
                    // shouldn't happen, but we'll let things continue with no policy set.
                }
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.