Package org.omg.CORBA

Examples of org.omg.CORBA.Object


    logger_.info("IOR: " + ior);

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


    {
      String ior = "corbaloc::" + fepHost1_ + ":" + fepPort1_ + "/"
              + STR_PROCESS_MANAGER.value; 
      try
      {
        Object obj = orb_.string_to_object(ior);
        mgrRef1_ = ICosProcessManagerHelper.narrow(obj);
      }
      catch (Exception ex)
      {
        logger_.warn("Can not get reference to process manager: " + fepHost1_);
        mgrRef1_ = null;
      }
    }
   
    if (fepHost2_.length() > 0)
    {
      String ior = "corbaloc::" + fepHost2_ + ":" + fepPort2_ + "/"
              + STR_PROCESS_MANAGER.value; 
      try
      {
        Object obj = orb_.string_to_object(ior);
        mgrRef2_ = ICosProcessManagerHelper.narrow(obj);
      }
      catch (Exception ex)
      {
        logger_.warn("Can not get reference to process manager: " + fepHost2_);
View Full Code Here

            // NamingContextDataStore throws appropriate exception if
            // required.
            return null;
        }

        Object theObjectFromStringifiedReference = null;
        bth.value = value.theBindingType;

        try {
            // Check whether the entry found in the Hashtable starts with NC
            // Which means it's a name context. So get the NamingContext reference
View Full Code Here

                return null;
            }

            if( value.strObjectRef.startsWith( "NC" ) ) {
                theServantManagerImplHandle.readInContext( value.strObjectRef );
                Object theObjectFromStringfiedReference =
                theNameServiceHandle.getObjectReferenceFromKey( value.strObjectRef );
                return theObjectFromStringfiedReference;
            } else {
                Object theObjectFromStringifiedReference = value.getObjectRef( );

                if( theObjectFromStringifiedReference == null ) {
                    theObjectFromStringifiedReference =
                    orb.string_to_object( value.strObjectRef );
                }
View Full Code Here

        String[] orbArgs = {"-ORBInitialPort", "5080"};
        ORB orb = ORB.init(orbArgs, null);

        String ior = "corbaname::localhost:5080#CurrencyConverterCORBAService";
        Object obj = orb.string_to_object(ior);
        CurrencyConverter converter = CurrencyConverterHelper.narrow(obj);

        System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP"));
        System.out.println("100 USD = " + converter.convert("USD", "GBP", 100.0) + "GBP");
    }
View Full Code Here

            String[] orbArgs = {"-ORBInitialPort", "5080"};
            ORB orb = ORB.init(orbArgs, null);

            NamingContextExt namingCtx;
            try {
                Object objRef = orb.resolve_initial_references("NameService");
                namingCtx = NamingContextExtHelper.narrow(objRef);
            } catch (Exception ex) {
                System.err.println("ERROR: Failed to resolve Name Service.");
                //System.err.println("Don't forget to run it with:");
                //System.err.println("  tnameserv -ORBInitialPort 5080");
                return;
            }

            Object rootPoaRef = orb.resolve_initial_references("RootPOA");
            POA rootPoa = POAHelper.narrow(rootPoaRef);
            rootPoa.the_POAManager().activate();

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

            String corbaServerName = "SMSGatewayCORBAService";
            NameComponent[] name = {new NameComponent(corbaServerName, "")};
            namingCtx.rebind(name, smsGatewayRef);
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(service, service.getRuntimeWire(null), 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

            handleException(e);
        }
    }

    public Object lookup(String uri) throws CorbaHostException {
        Object result = null;
        try {
            CorbanameURL url = new CorbanameURL(uri);
            ORB orb = createORB(url.getHost(), url.getPort(), false);
            NamingContextExt context = getNamingContext(orb, url.getNameService());
            result = context.resolve_str(url.getName());
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.