Package org.omg.CORBA

Examples of org.omg.CORBA.NamedValue


        do {
            OutputStream out = (OutputStream)
                    target._request(operation, responseExpected);

            for (int i = 0; i < arguments.count(); i++) {
                NamedValue nv = null;

                try {
                    nv = arguments.item(i);
                }
                catch (org.omg.CORBA.Bounds ex) {
                    throw new org.omg.CORBA.INTERNAL("concurrent modification");
                }

                switch (nv.flags()) {
                    case ARG_IN.value:
                    case ARG_INOUT.value:
                        Any value = nv.value();
                        value.write_value(out);
                }
            }

            InputStream in = null;
            try {
                in = (InputStream) target._invoke(out);

                if (!responseExpected) {
                    return;
                }

                org.omg.CORBA.Any return_value = return_value();
                TypeCode tc = return_value.type();
                if (return_value != null && tc != null) {
                    // create return value
                    return_value.read_value(in, tc);
                }

                for (int i = 0; i < arguments.count(); i++) {
                    NamedValue nv = null;

                    try {
                        nv = arguments.item(i);
                    }
                    catch (org.omg.CORBA.Bounds ex) {
                        throw new org.omg.CORBA.INTERNAL("concurrent modification");
                    }

                    switch (nv.flags()) {
                        case ARG_OUT.value:
                        case ARG_INOUT.value:
                            org.omg.CORBA.Any value = nv.value();
                            value.read_value(in, value.type());
                    }
                }

            }
View Full Code Here


            Property[] _props = new Property[args.count()];

            for (int x = 0; x < _props.length; ++x)
            {
                NamedValue _nv = args.item(x);

                _props[x] = new Property(_nv.name(), _nv.value());
            }

            _mesg.setTypedEvent(interfaceName, operationName, _props);

            _mesg.setFilterStage(consumer.getFirstStage());
View Full Code Here

        arguments = new org.omg.Dynamic.Parameter[request.arguments.count()];
        for (int i = 0; i < arguments.length; i++)
        {
            try
            {
                NamedValue value = request.arguments.item(i);

                ParameterMode mode = null;
                if (value.flags() == ARG_IN.value)
                {
                    mode = ParameterMode.PARAM_IN;
                }
                else if (value.flags() == ARG_OUT.value)
                {
                    mode = ParameterMode.PARAM_OUT;
                }
                else if (value.flags() == ARG_INOUT.value)
                {
                    mode = ParameterMode.PARAM_INOUT;
                }

                arguments[i] = new org.omg.Dynamic.Parameter(value.value(), mode);
            }
            catch (Exception e)
            {
                logger.debug("unexpected exception", e);
            }
View Full Code Here

            Property[] _props = new Property[args.count()];

            for (int x = 0; x < _props.length; ++x)
            {
                NamedValue _nv = args.item(x);

                _props[x] = new Property(_nv.name(), _nv.value());
            }

            _mesg.setTypedEvent(interfaceName, operationName, _props);

            _mesg.setFilterStage(consumer.getFirstStage());
View Full Code Here

            if( ( nvList != null ) &&( nvList.count() != 0 ) ) {
                // The String[] array will contain Name and Value for each
                // context and hence double the size in the array.
                int index = 0;
                for( int i = 0; i < nvList.count(); i++ ) {
                    NamedValue nv;
                    try {
                        nv = nvList.item( i );
                    }
                    catch (Exception e ) {
                        return (String[]) null;
                    }
                    context[index] = nv.name();
                    index++;
                    context[index] = nv.value().extract_string();
                    index++;
                }
            }

            cachedOperationContext = context;
View Full Code Here

        if( cachedResult == null ) {
            if( request == null ) {
                throw stdWrapper.piOperationNotSupported5() ;
            }
            // Get the result from the DII request data.
            NamedValue nvResult = request.result( );

            if( nvResult == null ) {
                throw wrapper.piDiiResultIsNull() ;
            }

            cachedResult = nvResult.value();
        }

        // Good citizen: In the interest of efficiency, we assume that
        // interceptors will not modify the contents of the result Any.
        // Otherwise, we would need to create a deep copy of the Any.
View Full Code Here

        Parameter[] plist = new Parameter[count];
        try {
            for( int i = 0; i < count; i++ ) {
                Parameter p = new Parameter();
                plist[i] = p;
                NamedValue nv = parNVList.item( i );
                plist[i].argument = nv.value();
                // ParameterMode spec can be found in 99-10-07.pdf
                // Section:10.5.22
                // nv.flags spec can be found in 99-10-07.pdf
                // Section 7.1.1
                // nv.flags has ARG_IN as 1, ARG_OUT as 2 and ARG_INOUT as 3
                // To convert this into enum PARAM_IN, PARAM_OUT and
                // PARAM_INOUT the value is subtracted by 1.
                plist[i].mode = ParameterMode.from_int( nv.flags() - 1 );
            }
        } catch ( Exception e ) {
            throw wrapper.exceptionInArguments( e ) ;
        }
View Full Code Here

            Property[] _props = new Property[args.count()];

            for (int x = 0; x < _props.length; ++x)
            {
                NamedValue _nv = args.item(x);

                _props[x] = new Property(_nv.name(), _nv.value());
            }

            _mesg.setTypedEvent(interfaceName, operationName, _props);

            _mesg.setFilterStage(consumer.getFirstStage());
View Full Code Here

        {
            inputStream.mark(0);
            for( Iterator<NamedValue> e = argList.iterator();
                 e.hasNext(); )
            {
                NamedValue namedValue = e.next();

                if( namedValue.flags() != org.omg.CORBA.ARG_OUT.value )
                {
                    // out parameters are not received
                    try
                    {
                        namedValue.value().read_value( inputStream, namedValue.value().type() );
                    }
                    catch (Exception e1)
                    {
                        throw new org.omg.CORBA.MARSHAL("Couldn't unmarshal object of type "
                                                        + namedValue.value().type() + " in ServerRequest.");
                    }
                }
            }
            try
            {
View Full Code Here

                        if( argList != null )
                        {
                            for( Iterator<NamedValue> e = argList.iterator();
                                 e.hasNext(); )
                            {
                                NamedValue namedValue = e.next();

                                if( namedValue.flags() != org.omg.CORBA.ARG_IN.value )
                                {
                                    // in parameters are not returned
                                    try
                                    {
                                        namedValue.value().write_value(out);
                                    }
                                    catch (Exception e1)
                                    {
                                        throw new org.omg.CORBA.MARSHAL("Couldn't return (in)out arg of type "
                                                                        + namedValue.value().type() + " in ServerRequest.");
                                    }
                                }
                            }
                        }
                    }
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.