本文整理汇总了Java中javax.rmi.CORBA.Util.writeRemoteObject方法的典型用法代码示例。如果您正苦于以下问题:Java Util.writeRemoteObject方法的具体用法?Java Util.writeRemoteObject怎么用?Java Util.writeRemoteObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.rmi.CORBA.Util
的用法示例。
在下文中一共展示了Util.writeRemoteObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeObjectField
import javax.rmi.CORBA.Util; //导入方法依赖的package包/类
private void writeObjectField(ObjectStreamField field,
Object objectValue) throws IOException {
if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
}
else {
Class type = field.getType();
int callType = ValueHandlerImpl.kValueType;
if (type.isInterface()) {
String className = type.getName();
if (java.rmi.Remote.class.isAssignableFrom(type)) {
// RMI Object reference...
callType = ValueHandlerImpl.kRemoteType;
} else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){
// IDL Object reference...
callType = ValueHandlerImpl.kRemoteType;
} else if (RepositoryId.isAbstractBase(type)) {
// IDL Abstract Object reference...
callType = ValueHandlerImpl.kAbstractType;
} else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
callType = ValueHandlerImpl.kAbstractType;
}
}
switch (callType) {
case ValueHandlerImpl.kRemoteType:
Util.writeRemoteObject(orbStream, objectValue);
break;
case ValueHandlerImpl.kAbstractType:
Util.writeAbstractObject(orbStream, objectValue);
break;
case ValueHandlerImpl.kValueType:
try{
orbStream.write_value((java.io.Serializable)objectValue, type);
}
catch(ClassCastException cce){
if (objectValue instanceof java.io.Serializable)
throw cce;
else
Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
}
}
}
}
示例2: writeObjectField
import javax.rmi.CORBA.Util; //导入方法依赖的package包/类
private void writeObjectField(ObjectStreamField field,
Object objectValue) throws IOException {
if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
}
else {
Class type = field.getType();
int callType = ValueHandlerImpl.kValueType;
if (type.isInterface()) {
String className = type.getName();
if (java.rmi.Remote.class.isAssignableFrom(type)) {
// RMI Object reference...
callType = ValueHandlerImpl.kRemoteType;
} else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){
// IDL Object reference...
callType = ValueHandlerImpl.kRemoteType;
} else if (RepositoryId.isAbstractBase(type)) {
// IDL Abstract Object reference...
callType = ValueHandlerImpl.kAbstractType;
} else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
callType = ValueHandlerImpl.kAbstractType;
}
}
switch (callType) {
case ValueHandlerImpl.kRemoteType:
Util.writeRemoteObject(orbStream, objectValue);
break;
case ValueHandlerImpl.kAbstractType:
Util.writeAbstractObject(orbStream, objectValue);
break;
case ValueHandlerImpl.kValueType:
try{
orbStream.write_value((java.io.Serializable)objectValue, type);
}
catch(ClassCastException cce){
if (objectValue instanceof java.io.Serializable)
throw cce;
else
Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
}
}
}
}