本文整理汇总了Java中org.omg.CORBA.Any.read_value方法的典型用法代码示例。如果您正苦于以下问题:Java Any.read_value方法的具体用法?Java Any.read_value怎么用?Java Any.read_value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.omg.CORBA.Any
的用法示例。
在下文中一共展示了Any.read_value方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read_any
import org.omg.CORBA.Any; //导入方法依赖的package包/类
public Any read_any() {
Any any = orb.create_any();
TypeCodeImpl tc = new TypeCodeImpl(orb);
// read off the typecode
// REVISIT We could avoid this try-catch if we could peek the typecode
// kind off this stream and see if it is a tk_value. Looking at the
// code we know that for tk_value the Any.read_value() below
// ignores the tc argument anyway (except for the kind field).
// But still we would need to make sure that the whole typecode,
// including encapsulations, is read off.
try {
tc.read_value(parent);
} catch (MARSHAL ex) {
if (tc.kind().value() != TCKind._tk_value)
throw ex;
// We can be sure that the whole typecode encapsulation has been
// read off.
dprintThrowable(ex);
}
// read off the value of the any
any.read_value(parent, tc);
return any;
}
示例2: unmarshalReply
import org.omg.CORBA.Any; //导入方法依赖的package包/类
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()
}
}
示例3: extractAny
import org.omg.CORBA.Any; //导入方法依赖的package包/类
public Any extractAny(TypeCode memberType, ORB orb) {
Any returnValue = orb.create_any();
OutputStream out = returnValue.create_output_stream();
TypeCodeImpl.convertToNative(orb, memberType).copy((InputStream)stream, out);
returnValue.read_value(out.create_input_stream(), memberType);
return returnValue;
}
示例4: extractAnyFromStream
import org.omg.CORBA.Any; //导入方法依赖的package包/类
static public Any extractAnyFromStream(TypeCode memberType, InputStream input, ORB orb) {
Any returnValue = orb.create_any();
OutputStream out = returnValue.create_output_stream();
TypeCodeImpl.convertToNative(orb, memberType).copy(input, out);
returnValue.read_value(out.create_input_stream(), memberType);
return returnValue;
}
示例5: unmarshalDIIUserException
import org.omg.CORBA.Any; //导入方法依赖的package包/类
public Exception unmarshalDIIUserException(String repoId, InputStream is)
{
if (! isDIIRequest()) {
return null;
}
ExceptionList _exceptions = diiRequest.exceptions();
try {
// Find the typecode for the exception
for (int i=0; i<_exceptions.count() ; i++) {
TypeCode tc = _exceptions.item(i);
if ( tc.id().equals(repoId) ) {
// Since we dont have the actual user exception
// class, the spec says we have to create an
// UnknownUserException and put it in the
// environment.
Any eany = orb.create_any();
eany.read_value(is, (TypeCode)tc);
return new UnknownUserException(eany);
}
}
} catch (Exception b) {
throw wrapper.unexpectedDiiException(b);
}
// must be a truly unknown exception
return wrapper.unknownCorbaExc( CompletionStatus.COMPLETED_MAYBE);
}
示例6: read_any
import org.omg.CORBA.Any; //导入方法依赖的package包/类
public Any read_any() {
Any any = orb.create_any();
TypeCodeImpl tc = new TypeCodeImpl(orb);
// read off the typecode
// REVISIT We could avoid this try-catch if we could peek the typecode
// kind off this stream and see if it is a tk_value.
// Looking at the code we know that for tk_value the Any.read_value()
// below ignores the tc argument anyway (except for the kind field).
// But still we would need to make sure that the whole typecode,
// including encapsulations, is read off.
try {
tc.read_value(parent);
} catch (org.omg.CORBA.MARSHAL ex) {
if (tc.kind().value() != org.omg.CORBA.TCKind._tk_value) {
throw ex;
}
// We can be sure that the whole typecode encapsulation has been
// read off.
ex.printStackTrace();
}
// read off the value of the any.
any.read_value(parent, tc);
return any;
}
示例7: insertSystemException
import org.omg.CORBA.Any; //导入方法依赖的package包/类
/**
* Static method for writing a CORBA standard exception to an Any.
* @param any The Any to write the SystemException into.
*/
public static void insertSystemException(SystemException ex, Any any) {
OutputStream out = any.create_output_stream();
ORB orb = (ORB)(out.orb());
String name = ex.getClass().getName();
String repID = ORBUtility.repositoryIdOf(name);
out.write_string(repID);
out.write_long(ex.minor);
out.write_long(ex.completed.value());
any.read_value(out.create_input_stream(),
getSystemExceptionTypeCode(orb, repID, name));
}