本文整理汇总了Java中org.omg.CORBA.ParameterMode类的典型用法代码示例。如果您正苦于以下问题:Java ParameterMode类的具体用法?Java ParameterMode怎么用?Java ParameterMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParameterMode类属于org.omg.CORBA包,在下文中一共展示了ParameterMode类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: nvListToParameterArray
import org.omg.CORBA.ParameterMode; //导入依赖的package包/类
/**
* 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;
}
示例2: arguments
import org.omg.CORBA.ParameterMode; //导入依赖的package包/类
/** @inheritDoc */
public Parameter[] arguments()
{
request.checkDii();
NVList args = request.arguments();
Parameter[] p = new Parameter[ args.count() ];
try
{
for (int i = 0; i < p.length; i++)
{
ParameterMode mode;
switch (args.item(i).flags())
{
case ARG_IN.value :
mode = ParameterMode.PARAM_IN;
break;
case ARG_OUT.value :
mode = ParameterMode.PARAM_OUT;
break;
case ARG_INOUT.value :
mode = ParameterMode.PARAM_INOUT;
break;
default :
throw new Unexpected();
}
p [ i ] = new Parameter(args.item(i).value(), mode);
}
}
catch (Bounds e)
{
throw new Unexpected(e);
}
return p;
}
示例3: Parameter
import org.omg.CORBA.ParameterMode; //导入依赖的package包/类
/**
* Create an instance, initialising field to the passed values.
*/
public Parameter(Any an_argument, ParameterMode a_mode)
{
argument = an_argument;
mode = a_mode;
}
示例4: arguments
import org.omg.CORBA.ParameterMode; //导入依赖的package包/类
/** @inheritDoc */
public Parameter[] arguments()
{
if (m_request == null)
{
throw new NO_RESOURCES(not_available);
}
m_request.checkDii();
NVList args = m_request.arguments();
Parameter[] p = new Parameter[ args.count() ];
try
{
for (int i = 0; i < p.length; i++)
{
ParameterMode mode;
switch (args.item(i).flags())
{
case ARG_IN.value :
mode = ParameterMode.PARAM_IN;
break;
case ARG_OUT.value :
mode = ParameterMode.PARAM_OUT;
break;
case ARG_INOUT.value :
mode = ParameterMode.PARAM_INOUT;
break;
default :
throw new Unexpected();
}
p [ i ] = new Parameter(args.item(i).value(), mode);
}
}
catch (Bounds e)
{
throw new Unexpected(e);
}
return p;
}