Package org.omg.CORBA

Examples of org.omg.CORBA.Request


       
        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(EasyMock.isA(Context.class),
                            EasyMock.eq("greetMe"),
                            EasyMock.isA(NVList.class),
                            EasyMock.isA(NamedValue.class),
                            EasyMock.isA(ExceptionList.class),
                            EasyMock.isA(ContextList.class)));
        EasyMock.expectLastCall().andReturn(r);
        r.invoke();
        EasyMock.expectLastCall();
       
        control.replay();
        Request request = conduit.getRequest(message, "greetMe", nvList, ret, exList);
        request.invoke();
        control.verify();
       
          /* try {
                ContextList ctxList = orb.create_context_list();
                Context ctx = orb.get_default_context();
View Full Code Here


       
        NVList nvlist = getArguments(message);
        NamedValue ret = getReturn(message);
        Map<TypeCode, RaisesType> exceptions = getOperationExceptions(opType, typeMaps);
        ExceptionList exList = getExceptionList(exceptions, message, opType, typeMaps);
        Request request = getRequest(message, opType.getName(), nvlist, ret, exList);
        if (request == null) {
            throw new CorbaBindingException("Couldn't build the corba request");
        }
        request.invoke();
        Exception ex = request.env().exception();
        if (ex != null) {
            if (ex instanceof UnknownUserException) {
                UnknownUserException userEx = (UnknownUserException) ex;
                Any except = userEx.except;
                RaisesType raises = exceptions.get(except.type());
View Full Code Here

                                 String opName,
                                 org.omg.CORBA.NVList nvlist,
                                 org.omg.CORBA.NamedValue ret,
                                 org.omg.CORBA.ExceptionList exList)
        throws Exception {
        Request request = null;
        ContextList ctxList = orb.create_context_list();
        Context ctx = orb.get_default_context();           

        org.omg.CORBA.Object targetObj =
            (org.omg.CORBA.Object)message.get(CorbaConstants.CORBA_ENDPOINT_OBJECT);
View Full Code Here

    public ModelParticipant[] contents() {
    if (counterPart!=null) {
            IRAttribute[] allFields = (IRAttribute[])((Interface)this.typeSystemNode).getAllFields();
            ObjectRepresentant[] result = new ObjectRepresentant[allFields.length];
            for (int i=0; i<allFields.length; i++) {
                Request request = ((org.omg.CORBA.Object)counterPart)._request("_get_"+allFields[i].getName());
                IRNode associatedNode = (IRNode)allFields[i].getAssociatedTypeSystemNode();
                request.set_return_type(associatedNode.getTypeCode())// was ist mit Alias-Typen?
                try {
                    request.invoke();
                }
                catch (Exception e) {
                    e.printStackTrace();
                }
                Any any = request.return_value();
                if (any!=null) {
                    result[i] = ObjectRepresentantFactory.create(
                                                                 ObjectRepresentantFactory.objectFromAny(any),
                                                                 allFields[i].getAssociatedTypeSystemNode(),
                                                                 allFields[i]);
View Full Code Here

     * @param op org.jacorb.ir;.gui.typesystem.remote.IROperation
     * @param params java.lang.String[]
     */
    public java.lang.Object invokeOperation(IROperation op, String[] params) {
    ModelParticipant[] irParams = op.contents();
    Request request =  ((org.omg.CORBA.Object)counterPart)._request(op.getName());
    IRNode associatedNode = (IRNode)op.getAssociatedTypeSystemNode();
    request.set_return_type(associatedNode.getTypeCode())// was ist mit Alias-Typen?
    for (int i=0; i<irParams.length; i++) {
            IRParameter irParam = (IRParameter)irParams[i];
            switch (irParam.getMode().value()) {
            case ParameterMode._PARAM_IN:
                ObjectRepresentantFactory.insertFromString(request.add_in_arg(),params[i],irParam.getTypeCode().kind());
                break;
            case ParameterMode._PARAM_OUT:
                ObjectRepresentantFactory.insertFromString(request.add_out_arg(),params[i],irParam.getTypeCode().kind());
                break;
            case ParameterMode._PARAM_INOUT:
                ObjectRepresentantFactory.insertFromString(request.add_inout_arg(),params[i],irParam.getTypeCode().kind());
                break;
            }
    }
    request.invoke();
    Any any = request.return_value();
    if (any!=null) {
            return ObjectRepresentantFactory.objectFromAny(any);
    }
    return null;
    }
View Full Code Here

        final String[] _tryPullOperations = getTryPullOperations();
        final Map _successFulRequests = new HashMap();

        for (int x = 0; x < _tryPullOperations.length; ++x)
        {
            Request _request = prepareRequest(_tryPullOperations[x]);

            if (logger_.isDebugEnabled())
            {
                logger_.debug("invoke " + _tryPullOperations[x]);
            }

            try
            {
                _request.invoke();

                Any _result = _request.result().value();

                boolean _success = _result.extract_boolean();

                if (_success)
                {
View Full Code Here

        final Map _successfulRequests = (Map) data.data_;

        for (Iterator i = _successfulRequests.keySet().iterator(); i.hasNext();)
        {
            String _operationNameWithoutTry = (String) i.next();
            Request _request = (Request) _successfulRequests.get(_operationNameWithoutTry);
            String _operationName = getFullQualifiedName(_operationNameWithoutTry);

            Message _mesg = getMessageFactory().newMessage(supportedInterface_, _operationName,
                    _request.arguments(), this);

            checkMessageProperties(_mesg);

            processMessage(_mesg);
        }
View Full Code Here

        return _fullQualifiedName;
    }

    private Request prepareRequest(String operation)
    {
        final Request _request = typedPullSupplier_._request(operation);

        final NVList _args = _request.arguments();

        final OperationDescription _operationDescription = getOperationDescription(operation);

        for (int x = 0; x < _operationDescription.parameters.length; ++x)
        {
            final Any _any = getORB().create_any();

            _any.type(_operationDescription.parameters[x].type);

            _args.add_value(_operationDescription.parameters[x].name, _any, ARG_OUT.value);
        }

        _request.set_return_type(_operationDescription.result);

        return _request;
    }
View Full Code Here

            }

            final int _idx = _fullQualifiedOperation.lastIndexOf("::");
            final String _operation = _fullQualifiedOperation.substring(_idx + 2);

            final Request _request = typedConsumer_._request(_operation);

            final NVList _arguments = _request.arguments();

            for (int x = 1; x < _props.length; ++x)
            {
                _arguments.add_value(_props[x].name, _props[x].value, ARG_IN.value);
            }

            _request.set_return_type(TYPE_CODE_VOID);

            try
            {
                deliverMessageInternal(_request);
               
View Full Code Here

        catch (ourUserException ex)
          {
            t.check(64, ex.ourField, "LOCAL: user exception field value");
          }

        Request rq =
          s._create_request(null, "passCharacters", orb.create_list(2), null);
        rq.add_in_arg().insert_wstring("wide string");
        rq.add_in_arg().insert_string("narrow string");

        rq.set_return_type(orb.get_primitive_tc(TCKind.tk_wstring));

        rq.invoke();

        String rt = rq.result().value().extract_wstring();
        t.check("return 'narrow string' and 'wide string'", rt, "LOCAL:DII:");

        poa_comTesterHelper.narrow(sub).sayHello();

        s.theField(55);
View Full Code Here

TOP

Related Classes of org.omg.CORBA.Request

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.