Package org.omg.CORBA

Examples of org.omg.CORBA.Object


public class Client {
    static int run(ORB orb, String[] args) throws UserException {

        // Get "hello" object
        Object obj = orb.string_to_object("corbaloc::localhost:40000/hw");
        if(obj == null) {
            System.err.println("Client: Could not resolve target object");
            return 1;
        }
View Full Code Here


public class Client {
    static int run(ORB orb, String[] args) throws UserException {

        // Get "hello" object
  Object obj = orb.string_to_object("corbaloc::localhost:40000/hw");
  if(obj == null) {
      System.err.println("Client: Could not resolve target object");
      return 1;
  }
View Full Code Here

            handleException(e);
        }
    }

    public Object lookup(String uri) throws CorbaHostException {
        Object result = null;
        try {
            CorbanameURL url = new CorbanameURL(uri);
            NamingContextExt context = getNamingContext(url.getNameService());
            result = context.resolve_str(url.getName());
        } catch (Exception e) {
View Full Code Here

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

            InvocationProxy proxy = new ComponentInvocationProxy((RuntimeEndpoint) service.getEndpoints().get(0), javaClass);
            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
            String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests:1.0"};
            servant.setIds(ids);
            bindServant(servant, "ArraysUnions");
            Object reference = bindReference("ArraysUnions");
            ArraysUnionsTests objRef = ArraysUnionsTestsHelper.narrow(reference);
            String[][] stringArray = {{"Hello", "World"}, {"Hi", "Again"}};
            String[][] result = objRef.passStringArray(stringArray);
            for (int i = 0; i < stringArray.length; i++) {
                for (int j = 0; j < stringArray[i].length; j++) {
View Full Code Here

            } catch (Throwable e) {
                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();
View Full Code Here

* @version $Rev: 697647 $ $Date: 2008-09-22 01:52:08 +0100 (Mon, 22 Sep 2008) $
*/
public class ReferenceTypeHelper implements TypeHelper {

    public java.lang.Object read(TypeTreeNode node, InputStream is) {
        Object reference = is.read_Object();
        return (java.lang.Object)InterfaceInstanceCreator.createInstance(reference, node.getJavaClass());
    }
View Full Code Here

        // with the ORB
        poa_Servant tester = new poa_Servant();

        POA rootPOA =
          POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        Object object = rootPOA.servant_to_reference(tester);

        // IOR must contain custom fragment, inserted by interceptor.
        // Sun 1.4 had a bug that was fixed in 1.5.
        String ior = orb.object_to_string(object);

        assertTrue("IOR custom component (bug in 1.4, fixed in 1.5)",
          ior.indexOf(
            "45257200000020000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
          ) > 0
        );

        // Create the forwarding target and register it
        // with the ORB
        poa_Servant forw = new poa_Servant();

        tester.theField(15);
        forw.theField(16);

        // Another orb without interceptors.
        final ORB orbf = ORB.init(new String[ 0 ], null);

        POA rootPOA2 =
          POAHelper.narrow(orbf.resolve_initial_references("RootPOA"));

        Object fobject = rootPOA2.servant_to_reference(forw);

        // Storing the IOR reference for general communication.
        fior = fobject;

        rootPOA.the_POAManager().activate();
        rootPOA2.the_POAManager().activate();

        // Intercepting server ready and waiting ...
        new Thread()
          {
            public void run()
            {
              // wait for invocations from clients
              orb.run();
            }
          }.start();

        new Thread()
          {
            public void run()
            {
              // wait for invocations from clients
              orbf.run();
            }
          }.start();

        // Make pause and do a local call.
        Thread.sleep(1000);

        // Saying local hello.
        poa_comTester Tester = poa_comTesterHelper.narrow(object);

        Any a0 = orb.create_any();
        a0.insert_string("Initial value for slot 0");

        Any a1 = orb.create_any();
        a1.insert_string("Initial value for slot 1");

        ORB orb2 = ORB.init(new String[ 0 ], initialisers);

        try
          {
            // Set the initial slot values.
            Current current =
              CurrentHelper.narrow(orb.resolve_initial_references("PICurrent"));
            Current current2 =
              CurrentHelper.narrow(orb2.resolve_initial_references("PICurrent"));

            current.set_slot(ucInitialiser.slot_0, a0);
            current.set_slot(ucInitialiser.slot_1, a1);

            current2.set_slot(ucInitialiser.slot_0, a0);
            current2.set_slot(ucInitialiser.slot_1, a1);
          }
        catch (Exception e)
          {
            fail("Exception " + e + " while setting slots.");
            e.printStackTrace();
          }

        String lHello = Tester.sayHello();

        // Saying remote hello.
        Object object2 = orb2.string_to_object(ior);

        poa_comTester Tester2 = poa_comTesterHelper.narrow(object2);

        String hello = Tester2.sayHello();
View Full Code Here

    ICosManagedProcess process = null;
    try
    {
      //Object obj = orb_.string_to_object(ior);
      Object obj = CorbaHelper.stringToObject(ior);
      process = ICosManagedProcessHelper.narrow(obj);
    }
    catch (Exception ex)
    {
      logger_.error("Can not get reference to process manager: " + ior + ". "
View Full Code Here

   
    String ior = "corbaloc::localhost:" + managerPort_ + "/"
            + STR_PROCESS_MANAGER.value; 
    try
    {
      Object obj = orb_.string_to_object(ior);
      mgrRef_ = ICosProcessManagerHelper.narrow(obj);
    }
    catch (Exception ex)
    {
      logger_.warn("Can not get reference to local process manager.");
View Full Code Here

TOP

Related Classes of org.omg.CORBA.Object

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.