Search in sources :

Example 1 with Contained

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;
    }
}
Also used : Contained(org.omg.CORBA.Contained) EnumDef(org.omg.CORBA.EnumDef) DataEnum(si.ijs.acs.objectexplorer.engine.DataEnum)

Example 2 with Contained

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;
    }
}
Also used : DataStruct(si.ijs.acs.objectexplorer.engine.DataStruct) Contained(org.omg.CORBA.Contained) DataType(si.ijs.acs.objectexplorer.engine.DataType) StructMember(org.omg.CORBA.StructMember) StructDef(org.omg.CORBA.StructDef)

Example 3 with Contained

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;
}
Also used : Contained(org.omg.CORBA.Contained)

Example 4 with Contained

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;
    }
}
Also used : Contained(org.omg.CORBA.Contained) InterfaceDef(org.omg.CORBA.InterfaceDef) ValueDef(org.omg.CORBA.ValueDef) BadKind(org.omg.CORBA.TypeCodePackage.BadKind)

Example 5 with Contained

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;
}
Also used : Contained(org.omg.CORBA.Contained) Description(org.omg.CORBA.ContainerPackage.Description)

Aggregations

Contained (org.omg.CORBA.Contained)5 Description (org.omg.CORBA.ContainerPackage.Description)1 EnumDef (org.omg.CORBA.EnumDef)1 InterfaceDef (org.omg.CORBA.InterfaceDef)1 StructDef (org.omg.CORBA.StructDef)1 StructMember (org.omg.CORBA.StructMember)1 BadKind (org.omg.CORBA.TypeCodePackage.BadKind)1 ValueDef (org.omg.CORBA.ValueDef)1 DataEnum (si.ijs.acs.objectexplorer.engine.DataEnum)1 DataStruct (si.ijs.acs.objectexplorer.engine.DataStruct)1 DataType (si.ijs.acs.objectexplorer.engine.DataType)1