Package org.omg.CORBA

Examples of org.omg.CORBA.NVList


    private NVList getExpectedParamList(String operation)
    {
        final OperationDescription _operation = getOperationDescription(operation);

        final NVList _expectedParams = getORB().create_list(_operation.parameters.length);

        for (int x = 0; x < _operation.parameters.length; ++x)
        {
            Any _value = getORB().create_any();

            _value.type(_operation.parameters[x].type);

            _expectedParams.add_value(_operation.parameters[x].name, _value,
                    ParameterMode._PARAM_IN);
        }

        return _expectedParams;
    }
View Full Code Here


            supportedInterfaces_ = new String[] { supportedInterface_ };
        }

        public void invoke(ServerRequest request)
        {
            final NVList _params = getExpectedParamList(request.operation());

            request.arguments(_params);

            final String _operationName = getFullQualifiedName(request.operation());
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
View Full Code Here

    {
        try
        {
            final Property[] _props = mesg.toTypedEvent();

            final NVList _args = getORB().create_list(_props.length - 1);

            // start at index 1 here. index 0 contains the operation name
            for (int x = 1; x < _props.length; ++x)
            {
                _args.add_value(_props[x].name, _props[x].value, ARG_OUT.value);
            }

            return _args;
        } catch (NoTranslationException e)
        {
View Full Code Here

    }

    private void prepareInvalidResponse(Map map, OperationDescription operation)
            throws InconsistentTypeCode
    {
        final NVList _expectedParams = getORB().create_list(operation.parameters.length);

        for (int x = 0; x < operation.parameters.length; ++x)
        {
            final DynAny _dynAny = dynAnyFactory_
                    .create_dyn_any_from_type_code(operation.parameters[x].type);

            _expectedParams
                    .add_value(operation.parameters[x].name, _dynAny.to_any(), ARG_OUT.value);
        }

        map.put(operation.name, _expectedParams);
    }
View Full Code Here

    //
    // 8.3.1: "Unless it calls set_exception, the DIR must call arguments
    // exactly once, even if the operation signature contains no
    // parameters."
    //
    NVList list = orb_.create_list(0);
    request.arguments(list);

    org.omg.CORBA.Object currentObj = null;
    try
      {
View Full Code Here

  {
    String name = request.operation();

    if (name.equals("aMethod"))
      {
        NVList list = orb_.create_list(0);
        request.arguments(list);

        if (compare_)
          {
            byte[] oid = null;
            try
              {
                oid = current_.get_object_id();
              }
            catch (org.omg.PortableServer.CurrentPackage.NoContext ex)
              {
                throw new RuntimeException();
              }

            String oidString = new String(oid);

            TEST(oidString.equals(name_));
          }

        return;
      }

    System.err.println("DSI implementation: unknown operation: " + name);

    NVList list = orb_.create_list(0);
    request.arguments(list);

    Any exAny = orb_.create_any();
    exAny.insert_Streamable(new BAD_OPERATIONHolder(new BAD_OPERATION()));
View Full Code Here

    r.add_in_arg().insert_long(2);
    r.add_inout_arg().insert_short((short) 3);
    r.add_inout_arg().insert_string("[string 4]");
    r.add_out_arg().type(orb.get_primitive_tc(TCKind.tk_double));

    NVList para = r.arguments();

    try
      {
        assertEquals("octet", para.item(0).value().extract_octet(), 0);
        assertEquals("long (in parameter)",
                     para.item(1).value().extract_long(), 2
                    );
        assertEquals("short", para.item(2).value().extract_short(), 3);
        assertEquals("string", para.item(3).value().extract_string(),
                     "[string 4]"
                    );
      }
    catch (Exception ex)
      {
        fail("Unexpected " + ex.getClass().getName() + ":" + ex.getMessage());
      }

    // For the last parameter, the value is not set.
    r.set_return_type(orb.get_primitive_tc(TCKind.tk_long));

    r.invoke();

    assertEquals("Returned value", r.result().value().extract_long(), 452572);

    para = r.arguments();

    try
      {
        assertEquals("octet", para.item(0).value().extract_octet(), 1);
        assertEquals("long (in parameter)",
                     para.item(1).value().extract_long(), 2
                    );
        assertEquals("short", para.item(2).value().extract_short(), 4);
        assertEquals("string", para.item(3).value().extract_string(),
                     "[string 4] [return]"
                    );
        assertEquals("double", para.item(4).value().extract_double(), 1.0,
                     Double.MIN_VALUE
                    );
      }
    catch (Exception ex)
      {
View Full Code Here

            // if blank makes it as a global scope.
            // The second parameter is op_flags which is set to RESTRICT_SCOPE
            // As there is only one defined in the spec.
            // The Third param is the pattern which is '*' requiring it to
            // get all the contexts.
            NVList nvList = ctx.get_values( "", CTX_RESTRICT_SCOPE.value,"*" );
            String[] context = new String[(nvList.count() * 2) ];
            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();
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

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.