use of org.omg.CORBA.Any in project wildfly by wildfly.
the class ValueMemberDefImpl method describe.
public Description describe() {
String defined_in_id = "IR";
if (defined_in instanceof ContainedOperations)
defined_in_id = ((ContainedOperations) defined_in).id();
ValueMember d = new ValueMember(name, id, defined_in_id, version, typeCode, type_def(), access());
Any any = getORB().create_any();
ValueMemberHelper.insert(any, d);
return new Description(DefinitionKind.dk_ValueMember, any);
}
use of org.omg.CORBA.Any in project wildfly by wildfly.
the class InterfaceRepository method addConstants.
/**
* Add a set of constants to a container (interface or value class).
*/
private void addConstants(LocalContainer container, ContainerAnalysis ca) throws RMIIIOPViolationException, IRConstructionException {
ConstantAnalysis[] consts = ca.getConstants();
for (int i = 0; i < consts.length; ++i) {
ConstantDefImpl cDef;
String cid = ca.getMemberRepositoryId(consts[i].getJavaName());
String cName = consts[i].getIDLName();
Class cls = consts[i].getType();
TypeCode typeCode = getConstantTypeCode(cls);
Any value = orb.create_any();
consts[i].insertValue(value);
cDef = new ConstantDefImpl(cid, cName, "1.0", typeCode, value, container, impl);
container.add(cName, cDef);
}
}
use of org.omg.CORBA.Any in project wildfly by wildfly.
the class ModuleDefImpl method describe.
// ContainedImpl implementation ----------------------------------
public Description describe() {
String defined_in_id = "IR";
if (defined_in instanceof ContainedOperations)
defined_in_id = ((ContainedOperations) defined_in).id();
ModuleDescription md = new ModuleDescription(name, id, defined_in_id, version);
Any any = getORB().create_any();
ModuleDescriptionHelper.insert(any, md);
return new Description(DefinitionKind.dk_Module, any);
}
use of org.omg.CORBA.Any in project ACS by ACS-Community.
the class AnyAideTest method testComplexObjectToCorbaAny.
public void testComplexObjectToCorbaAny() {
NestedEvent neVal = new NestedEvent();
neVal.sampVal = advancedCS.getAny();
neVal.sampVal.insert_long(15);
Any anyNe = null;
try {
anyNe = anyAide.complexObjectToCorbaAny(neVal);
} catch (AcsJException ex) {
}
assertNotNull(anyNe);
NestedEvent neVal2 = NestedEventHelper.extract(anyNe);
assertEquals(neVal.sampVal.extract_long(), neVal2.sampVal.extract_long());
try {
anyAide.complexObjectToCorbaAny(null);
fail();
} catch (AcsJException ex) {
}
}
use of org.omg.CORBA.Any in project ACS by ACS-Community.
the class AnyAideTest method testObjectToCorbaAny.
public void testObjectToCorbaAny() {
final String strVal = "str";
final Long lVal = 13L;
final Double dVal = 13.7;
final Float fVal = 13.3f;
final Integer iVal = 11;
final int[] intArr = new int[] { 1, 2, 3, 4 };
final NestedEvent neVal = new NestedEvent();
neVal.sampVal = advancedCS.getAny();
neVal.sampVal.insert_long(15);
Any anyNull = null, anyString = null, anyLong = null, anyDouble = null, anyFloat = null, anyInt = null;
Any anyNe = null, anyIntArr = null;
try {
anyNull = anyAide.objectToCorbaAny(null);
anyString = anyAide.objectToCorbaAny(strVal);
anyLong = anyAide.objectToCorbaAny(lVal);
anyDouble = anyAide.objectToCorbaAny(dVal);
anyFloat = anyAide.objectToCorbaAny(fVal);
anyInt = anyAide.objectToCorbaAny(iVal);
anyNe = anyAide.objectToCorbaAny(neVal);
anyIntArr = anyAide.objectToCorbaAny(intArr);
} catch (AcsJException ex) {
}
assertNotNull(anyNull);
assertNotNull(anyString);
assertNotNull(anyLong);
assertNotNull(anyDouble);
assertNotNull(anyFloat);
assertNotNull(anyInt);
assertNotNull(anyNe);
assertNotNull(anyIntArr);
assertNull(anyNull.extract_Object());
assertEquals(lVal.longValue(), anyLong.extract_longlong());
assertEquals(dVal.doubleValue(), anyDouble.extract_double());
assertEquals(fVal.floatValue(), anyFloat.extract_float());
assertEquals(iVal.intValue(), anyInt.extract_long());
assertEquals(strVal, anyString.extract_string());
NestedEvent neVal2 = NestedEventHelper.extract(anyNe);
assertEquals(neVal.sampVal.extract_long(), neVal2.sampVal.extract_long());
int[] intArr2 = longSeqHelper.extract(anyIntArr);
assertEquals(intArr.length, intArr2.length);
for (int i = 0; i < intArr2.length; ++i) {
assertEquals(intArr[i], intArr2[i]);
}
try {
Any anyVector = anyAide.objectToCorbaAny(new Vector());
fail();
} catch (AcsJException ex) {
}
}
Aggregations