public final void setRequest(org.jacorb.orb.dii.Request request) { 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); } } //exceptions will be set when available }
public void set_values(org.omg.CORBA.NVList values) { // // Create new, empty list // values_.clear(); // // Copy named values // for (int i = 0; i < values.count(); i++) { org.omg.CORBA.NamedValue nv = null; try { nv = values.item(i); } catch (org.omg.CORBA.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } String s = null; try { s = nv.value().extract_string(); } catch (org.omg.CORBA.SystemException ex) { throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPropertyType), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPropertyType, CompletionStatus.COMPLETED_NO); } if (nv.flags() != 0) { throw new org.omg.CORBA.INV_FLAG("Unsupported named value flag"); } values_.put(nv.name(), s); } }
/** This is called from the ORB after the DynamicImplementation.invoke * returns. Here we marshal the return value and inout/out params. */ public void marshalReplyParams(OutputStream os) { // 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); } } }
if (request.arguments() != null && request.arguments().count() >= 1)
/** * Internal utility method to convert an NVList into a PI Parameter[] */ protected Parameter[] nvListToParameterArray( NVList parNVList ) { // _REVISIT_ This utility method should probably be doing a deep // copy so interceptor can't accidentally change the arguments. int count = parNVList.count(); 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 ) ; } return plist; }
/** * create a Message wrapping a typed event. */ public Message newMessage(String interfaceName, String operationName, NVList args, IProxyConsumer consumer) { try { TypedEventMessage _mesg = (TypedEventMessage) typedEventMessagePool_.lendObject(); _mesg.initReceiveTimestamp(); 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()); return _mesg.getHandle(); } catch (Bounds e) { // this should never happen as NamedValue bounds are checked always. throw new RuntimeException(e.toString()); } }
for (int i = 0; i < arguments_.count(); i++) { org.omg.CORBA.NamedValue nv = arguments_.item(i);
public void unmarshalReply(InputStream is) { // First unmarshal the return value if it is not void if ( _result != null ) { Any returnAny = _result.value(); TypeCode returnType = returnAny.type(); if ( returnType.kind().value() != TCKind._tk_void ) returnAny.read_value(is, returnType); } // 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; } } } catch ( org.omg.CORBA.Bounds ex ) { // Cannot happen since we only iterate till _arguments.count() } } }
for (int i = 0; i < _arguments.count(); i++)
for (int i = 0; i < _arguments.count(); i++)
in_ = delegate_._OB_preUnmarshal(servant_, up_); try { for (int i = 0; i < parameters.count(); i++) { org.omg.CORBA.NamedValue nv = parameters.item(i);
for (int i=0; i < args.count() ; i++) { try { arg = args.item(i);
for (int i = 0; i < arguments_.count(); i++) { org.omg.CORBA.NamedValue nv = arguments_.item(i); if (nv.flags() != org.omg.CORBA.ARG_IN.value) {
for (int i=0; i<_arguments.count() ; i++) { NamedValue nv = _arguments.item(i); switch (nv.flags()) {
for (int i = 0; i < _arguments.count(); i++)
for (int i = 0; i < _arguments.count(); i++)
count = args_.count(); else count = 0;
for (int i = 0; i < arguments_.count(); i++) { org.omg.CORBA.NamedValue nv = arguments_.item(i);