Package org.omg.CORBA

Examples of org.omg.CORBA.NVList


        CorbaStreamable arg = message.createStreamableObject(obj1, objName);       
        arguments[0] = arg;
        arguments[0].setMode(org.omg.CORBA.ARG_OUT.value);
       
        CorbaConduit conduit = setupCorbaConduit(false);
        NVList list = conduit.getArguments(message);
        assertNotNull("list should not be null", list != null);
       
        message.setStreamableArguments(arguments);
        NVList listArgs = (NVList)conduit.getArguments(message);
        assertNotNull("listArgs should not be null", listArgs != null);
        assertNotNull("listArgs Item should not be null", listArgs.item(0) != null);
        assertEquals("Name should be equal", listArgs.item(0).name(), "object");
        assertEquals("flags should be 2", listArgs.item(0).flags(), 2);
        assertNotNull("Any Value should not be null", listArgs.item(0).value() != null);       
    }
View Full Code Here


        org.omg.CORBA.Object obj = control.createMock(org.omg.CORBA.Object.class);
        EasyMock.expect(message.get(CorbaConstants.CORBA_ENDPOINT_OBJECT)).andReturn(obj);
       
        //msg.put(CorbaConstants.CORBA_ENDPOINT_OBJECT, obj);       
        Request r = control.createMock(Request.class);       
        NVList nvList = (NVList)orb.create_list(0);
        NamedValue ret = control.createMock(NamedValue.class);
        ExceptionList exList = control.createMock(ExceptionList.class);       
       
        EasyMock.expect(obj._create_request((Context)EasyMock.anyObject(),
                            EasyMock.eq("greetMe"),
View Full Code Here

        Exchange exg = msg.getExchange();       
        ServerRequest request = exg.get(ServerRequest.class);
        try {
            if (!exg.isOneWay()) {               
                CorbaMessage inMsg = (CorbaMessage)msg.getExchange().getInMessage();
                NVList list = inMsg.getList();

                if (msg.getStreamableException() != null) {                   
                    Any exAny = CorbaAnyHelper.createAny(orb);
                    CorbaStreamable exception = msg.getStreamableException();
                    exAny.insert_Streamable(exception);
                    request.set_exception(exAny);
                    if (msg.getExchange() != null) {
                        msg.getExchange().setOutFaultMessage(msg);
                    }
                } else {
                    CorbaStreamable[] arguments = msg.getStreamableArguments();
                    if (arguments != null) {
                        for (int i = 0; i < arguments.length; ++i) {
                            if (list.item(i).flags() != org.omg.CORBA.ARG_IN.value) {
                                arguments[i].getObject().setIntoAny(list.item(i).value(),
                                                                    arguments[i], true);
                            }  
                        }
                    }
View Full Code Here

        return endpointInfo.getAddress();
    }
       
    public void buildRequest(CorbaMessage message, OperationType opType) throws Exception {       
        ServiceInfo service = message.getExchange().get(ServiceInfo.class);
        NVList nvlist = getArguments(message);
        NamedValue ret = getReturn(message);
        Map<TypeCode, RaisesType> exceptions = getOperationExceptions(opType, typeMap);
        ExceptionList exList = getExceptionList(exceptions, message, opType);
        Request request = getRequest(message, opType.getName(), nvlist, ret, exList);
        if (request == null) {
View Full Code Here

    public NVList getArguments(CorbaMessage message) {
        if (orb == null) {
            prepareOrb();
        }
        // Build the list of DII arguments, returns, and exceptions
        NVList list = null;
        if (message.getStreamableArguments() != null) {
            CorbaStreamable[] arguments = message.getStreamableArguments();
            list = orb.create_list(arguments.length);

            for (CorbaStreamable argument : arguments) {
                Any value = CorbaAnyHelper.createAny(orb);
                argument.getObject().setIntoAny(value, argument, true);
                list.add_value(argument.getName(), value, argument.getMode());
            }
        } else {
            list = orb.create_list(0);
        }
View Full Code Here

        }
        return result;
    }

    public static NVList nvListFromStreamables(ORB orb, CorbaStreamable[] streamables) {
        NVList list = null;
        if (streamables != null && streamables.length > 0) {
            list = orb.create_list(streamables.length);
            for (int i = 0; i < streamables.length; ++i) {
                Any value = orb.create_any();
                value.insert_Streamable(streamables[i]);
                list.add_value(streamables[i].getName(), value, streamables[i].getMode());
            }
        } else {
            list = orb.create_list(0);
        }
        return list;
View Full Code Here

        }
        return result;
    }

    public static NVList nvListFromStreamables(ORB orb, CorbaStreamable[] streamables) {
        NVList list = null;
        if (streamables != null && streamables.length > 0) {
            list = orb.create_list(streamables.length);
            for (int i = 0; i < streamables.length; ++i) {
                Any value = orb.create_any();
                value.insert_Streamable(streamables[i]);
                list.add_value(streamables[i].getName(), value, streamables[i].getMode());
            }
        } else {
            list = orb.create_list(0);
        }
        return list;
View Full Code Here

        Exchange exg = msg.getExchange();       
        ServerRequest request = exg.get(ServerRequest.class);
        try {
            if (!exg.isOneWay()) {               
                CorbaMessage inMsg = (CorbaMessage)msg.getExchange().getInMessage();
                NVList list = inMsg.getList();

                if (msg.getStreamableException() != null) {                   
                    Any exAny = CorbaAnyHelper.createAny(orb);
                    CorbaStreamable exception = msg.getStreamableException();
                    exAny.insert_Streamable(exception);
                    request.set_exception(exAny);
                    if (msg.getExchange() != null) {
                        msg.getExchange().setOutFaultMessage(msg);
                    }
                } else {
                    CorbaStreamable[] arguments = msg.getStreamableArguments();
                    if (arguments != null) {
                        for (int i = 0; i < arguments.length; ++i) {
                            if (list.item(i).flags() != org.omg.CORBA.ARG_IN.value) {
                                arguments[i].getObject().setIntoAny(list.item(i).value(),
                                                                    arguments[i], true);
                            }  
                        }
                    }
View Full Code Here

        return endpointInfo.getAddress();
    }
       
    public void buildRequest(CorbaMessage message, OperationType opType) throws Exception {       
        ServiceInfo service = message.getExchange().get(ServiceInfo.class);
        NVList nvlist = getArguments(message);
        NamedValue ret = getReturn(message);
        Map<TypeCode, RaisesType> exceptions = getOperationExceptions(opType, typeMap);
        ExceptionList exList = getExceptionList(exceptions, message, opType);
        Request request = getRequest(message, opType.getName(), nvlist, ret, exList);
        if (request == null) {
View Full Code Here

    public NVList getArguments(CorbaMessage message) {
        if (orb == null) {
            prepareOrb();
        }
        // Build the list of DII arguments, returns, and exceptions
        NVList list = null;
        if (message.getStreamableArguments() != null) {
            CorbaStreamable[] arguments = message.getStreamableArguments();
            list = orb.create_list(arguments.length);

            for (CorbaStreamable argument : arguments) {
                Any value = CorbaAnyHelper.createAny(orb);
                argument.getObject().setIntoAny(value, argument, true);
                list.add_value(argument.getName(), value, argument.getMode());
            }
        } else {
            list = orb.create_list(0);
        }
View Full Code Here

TOP

Related Classes of org.omg.CORBA.NVList

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.