use of org.omg.CORBA.Contained in project ACS by ACS-Community.
the class BACIIntrospector method getEnumDef.
private DataEnum getEnumDef(TypeCode tc) {
if (tc.kind() != TCKind.tk_enum)
return null;
try {
DataEnum de = new DataEnum(tc.id());
Contained ctd = ra.lookupId(tc.id());
EnumDef ed = EnumDefHelper.narrow(ctd);
String[] mems = ed.members();
for (int i = 0; i < mems.length; i++) de.add(i, mems[i]);
return de;
} catch (org.omg.CORBA.TypeCodePackage.BadKind e) {
e.printStackTrace();
return null;
}
}
use of org.omg.CORBA.Contained in project ACS by ACS-Community.
the class BACIIntrospector method getStructDef.
private DataStruct getStructDef(TypeCode tc) {
if (tc.kind() != TCKind.tk_struct)
return null;
try {
DataStruct ds = new DataStruct(tc.id());
Contained ctd = ra.lookupId(tc.id());
StructDef sd = StructDefHelper.narrow(ctd);
StructMember[] mems = sd.members();
for (int i = 0; i < mems.length; i++) {
DataType dt = new BACIDataType(getClassType(mems[i].type));
dt.setElement(getDef(mems[i].type));
ds.add(mems[i].name, dt);
}
return ds;
} catch (org.omg.CORBA.TypeCodePackage.BadKind e) {
e.printStackTrace();
return null;
}
}
use of org.omg.CORBA.Contained in project wildfly by wildfly.
the class InterfaceDefImpl method base_interfaces.
// InterfaceDefOperations implementation -------------------------
public InterfaceDef[] base_interfaces() {
if (base_interfaces_ref == null) {
base_interfaces_ref = new InterfaceDef[base_interfaces.length];
for (int i = 0; i < base_interfaces_ref.length; ++i) {
Contained c = repository.lookup_id(base_interfaces[i]);
base_interfaces_ref[i] = InterfaceDefHelper.narrow(c);
}
}
return base_interfaces_ref;
}
use of org.omg.CORBA.Contained in project wildfly by wildfly.
the class ValueDefImpl method allDone.
public void allDone() throws IRConstructionException {
getReference();
delegate.allDone();
if (baseValueTypeCode != null && baseValueTypeCode.kind() != TCKind.tk_null) {
try {
baseValue = baseValueTypeCode.id();
} catch (BadKind ex) {
throw IIOPLogger.ROOT_LOGGER.badKindForSuperValueType(id());
}
Contained c = repository.lookup_id(baseValue);
base_value_ref = ValueDefHelper.narrow(c);
} else
// TODO: is this right?
baseValue = "IDL:omg.org/CORBA/ValueBase:1.0";
// Resolve supported interfaces
supported_interfaces_ref = new InterfaceDef[supported_interfaces.length];
for (int i = 0; i < supported_interfaces.length; ++i) {
InterfaceDef iDef = InterfaceDefHelper.narrow(repository.lookup_id(supported_interfaces[i]));
if (iDef == null)
throw IIOPLogger.ROOT_LOGGER.errorResolvingRefToImplementedInterface(id(), supported_interfaces[i]);
supported_interfaces_ref[i] = iDef;
}
// Resolve abstract base valuetypes
abstract_base_valuetypes_ref = new ValueDef[abstract_base_valuetypes.length];
for (int i = 0; i < abstract_base_valuetypes.length; ++i) {
ValueDef vDef = ValueDefHelper.narrow(repository.lookup_id(abstract_base_valuetypes[i]));
if (vDef == null)
throw IIOPLogger.ROOT_LOGGER.errorResolvingRefToAbstractValuetype(id(), abstract_base_valuetypes[i]);
abstract_base_valuetypes_ref[i] = vDef;
}
}
use of org.omg.CORBA.Contained in project wildfly by wildfly.
the class ContainerImplDelegate method describe_contents.
public Description[] describe_contents(DefinitionKind limit_type, boolean exclude_inherited, int max_returned_objs) {
Contained[] c = contents(limit_type, exclude_inherited);
int returnSize;
if (max_returned_objs != -1 && c.length > max_returned_objs)
returnSize = max_returned_objs;
else
returnSize = c.length;
Description[] ret = new Description[returnSize];
for (int i = 0; i < returnSize; ++i) {
org.omg.CORBA.ContainedPackage.Description d = c[i].describe();
ret[i] = new Description(c[i], d.kind, d.value);
}
return ret;
}
Aggregations