Package org.omg.CORBA

Examples of org.omg.CORBA.NamedValue


        try {
            OutputStream $out = delegate.request(null, _opName, !_isOneWay);
            // Marshal args
            try {
                for (int i=0; i<_arguments.count() ; i++) {
                    NamedValue nv = _arguments.item(i);
                    switch (nv.flags()) {
                    case ARG_IN.value:
                        nv.value().write_value($out);
                        break;
                    case ARG_OUT.value:
                        break;
                    case ARG_INOUT.value:
                        nv.value().write_value($out);
                        break;
                    }
                }
            } catch ( org.omg.CORBA.Bounds ex ) {
                throw _wrapper.boundsErrorInDiiRequest( ex ) ;
View Full Code Here


        }

        // Now unmarshal the out/inout args
        try {
            for ( int i=0; i<_arguments.count() ; i++) {
                NamedValue nv = _arguments.item(i);
                switch( nv.flags() ) {
                case ARG_IN.value:
                    break;
                case ARG_OUT.value:
                case ARG_INOUT.value:
                    Any any = nv.value();
                    any.read_value(is, any.type());
                    break;
                }
            }
        }
View Full Code Here

            ContextList ctxList = orb.create_context_list();
            Context ctx = orb.get_default_context();

            CorbaStreamable retVal = mc.getMessage().getStreamableReturn();
            NamedValue ret = null;
            if (retVal != null) {
                Any returnAny = orb.create_any();
                returnAny.insert_Streamable(retVal);
                ret = orb.create_named_value(retVal.getName(), returnAny, org.omg.CORBA.ARG_OUT.value);
            } else {
                // TODO: REVISIT: for some reason, the yoko ORB does not like to have a null NamedValue
                // return value. Create this 'empty' one if a void return type is used.
                ret = orb.create_named_value("return", orb.create_any(), org.omg.CORBA.ARG_OUT.value);
            }

            // Get the typecodes for the exceptions this operation can throw.  These are defined in the
            // operation definition from WSDL.
            ExceptionList exList = orb.create_exception_list();
            OperationType operation = CorbaUtils.getCorbaOperationType(callback.getOperationName(),
                                                                       bus,
                                                                       endpointRef);

            if (operation == null) {
                throw new CorbaBindingException("Unable to obtain operation definition");
            }

            Map<TypeCode, RaisesType> exceptions = getOperationExceptions(operation);
            Object[] tcs = exceptions.keySet().toArray();
            for (int i = 0; i < exceptions.size(); ++i) {
                exList.add((TypeCode) tcs[i]);
            }

            Request request =
                target._create_request(ctx,
                                       (String)objectCtx.get(ObjectMessageContext.WSDL_OPERATION),
                                       list,
                                       ret,
                                       exList,
                                       ctxList);
            request.invoke();

            mc.put(ObjectMessageContext.MESSAGE_INPUT, Boolean.FALSE);
            java.lang.Exception ex = request.env().exception();
            if (ex == null) {
                if (retVal != null) {
                    message.setStreamableReturnValue(retVal.getObject());
                }

                for (int i = 0; i < list.count(); ++i) {
                    NamedValue arg = (NamedValue) list.item(i);
                    if (arg.flags() != org.omg.CORBA.ARG_IN.value) {
                        CorbaStreamable streamable = (CorbaStreamable)arg.value().extract_Streamable();
                        message.setStreamableArgumentValue(streamable.getObject(), i);
                    }
                }
                corbaBinding.unmarshal(mc, objectCtx, callback);
            } else if (ex instanceof UnknownUserException) {
View Full Code Here

            ContextList ctxList = orb.create_context_list();
            Context ctx = orb.get_default_context();

            // TODO: This doen't really apply to a oneway since we are not expecting a return.
            CorbaStreamable retVal = mc.getMessage().getStreamableReturn();
            NamedValue ret = null;
            if (retVal != null) {
                Any returnAny = orb.create_any();
                returnAny.insert_Streamable(retVal);
                ret = orb.create_named_value(retVal.getName(), returnAny, org.omg.CORBA.ARG_OUT.value);
            } else {
View Full Code Here

        try {
            OutputStream $out = delegate.request(null, _opName, !_isOneWay);
            // Marshal args
            try {
                for (int i=0; i<_arguments.count() ; i++) {
                    NamedValue nv = _arguments.item(i);
                    switch (nv.flags()) {
                    case ARG_IN.value:
                        nv.value().write_value($out);
                        break;
                    case ARG_OUT.value:
                        break;
                    case ARG_INOUT.value:
                        nv.value().write_value($out);
                        break;
                    }
                }
            } catch ( org.omg.CORBA.Bounds ex ) {
                throw _wrapper.boundsErrorInDiiRequest( ex ) ;
View Full Code Here

        }

        // Now unmarshal the out/inout args
        try {
            for ( int i=0; i<_arguments.count() ; i++) {
                NamedValue nv = _arguments.item(i);
                switch( nv.flags() ) {
                case ARG_IN.value:
                    break;
                case ARG_OUT.value:
                case ARG_INOUT.value:
                    Any any = nv.value();
                    any.read_value(is, any.type());
                    break;
                }
            }
        }
View Full Code Here

        if (args == null )
            throw _wrapper.argumentsCalledNullArgs() ;

        _paramsCalled = true;

        NamedValue arg = null;
        for (int i=0; i < args.count() ; i++) {
            try {
                arg = args.item(i);
            } catch (Bounds e) {
                throw _wrapper.boundsCannotOccur(e) ;
            }

            try {
                if ((arg.flags() == org.omg.CORBA.ARG_IN.value) ||
                    (arg.flags() == org.omg.CORBA.ARG_INOUT.value)) {
                    // unmarshal the value into the Any
                    arg.value().read_value(_ins, arg.value().type());
                }
            } catch ( Exception ex ) {
                throw _wrapper.badArgumentsNvlist( ex ) ;
            }
        }
View Full Code Here

    {
        // marshal the operation return value
        _resultAny.write_value(os);

        // marshal the inouts/outs
        NamedValue arg = null;

        for (int i=0; i < _arguments.count() ; i++) {
            try {
                arg = _arguments.item(i);
            } catch (Bounds e) {}

            if ((arg.flags() == org.omg.CORBA.ARG_OUT.value) ||
                (arg.flags() == org.omg.CORBA.ARG_INOUT.value)) {
                arg.value().write_value(os);
            }
        }
    }
View Full Code Here

        return _namedValues.size();
    }

    public NamedValue add(int flags)
    {
        NamedValue tmpVal = new NamedValueImpl(orb, "", new AnyImpl(orb), flags);
        _namedValues.addElement(tmpVal);
        return tmpVal;
    }
View Full Code Here

        return tmpVal;
    }

    public NamedValue add_item(String itemName, int flags)
    {
        NamedValue tmpVal = new NamedValueImpl(orb, itemName, new AnyImpl(orb),
                                               flags);
        _namedValues.addElement(tmpVal);
        return tmpVal;
    }
View Full Code Here

TOP

Related Classes of org.omg.CORBA.NamedValue

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.