Search in sources :

Example 1 with FullInterfaceDescription

use of org.omg.CORBA.InterfaceDefPackage.FullInterfaceDescription in project ACS by ACS-Community.

the class ComponentsManager method getComponentProperties.

/**
	 * Recursive function to get the list of all the ACS properties
	 * for a given IDL type. It scans the current interface, and then
	 * it sub-scans the inherited types
	 * 
	 * @param ifdef The IDL interface defintion
	 * @return The list of properties for the given IDL definition, including the parents' properties
	 * @throws BadKind
	 */
private List<String> getComponentProperties(InterfaceDef ifdef) throws BadKind {
    List<String> tmp = new ArrayList<String>();
    FullInterfaceDescription ifdes = ifdef.describe_interface();
    for (int i = 0; i < ifdes.attributes.length; i++) {
        TypeCode tc = ifdes.attributes[i].type;
        if (// ojo
        tc.kind() != TCKind.tk_objref)
            continue;
        InterfaceDef tcdef = InterfaceDefHelper.narrow(rep.lookup_id(tc.id()));
        if (tc.kind() == TCKind.tk_objref && tcdef.is_a(IDL_PROPERTY))
            tmp.add(ifdes.attributes[i].name);
    }
    // Lookup the children properties
    // TODO: Loop only over CharacteristicComponent interfaces
    InterfaceDef[] ifaces = ifdef.base_interfaces();
    for (int i = 0; i != ifaces.length; i++) {
        tmp.addAll(getComponentProperties(ifaces[i]));
    }
    return tmp;
}
Also used : InterfaceDef(org.omg.CORBA.InterfaceDef) FullInterfaceDescription(org.omg.CORBA.InterfaceDefPackage.FullInterfaceDescription) TypeCode(org.omg.CORBA.TypeCode) ArrayList(java.util.ArrayList)

Example 2 with FullInterfaceDescription

use of org.omg.CORBA.InterfaceDefPackage.FullInterfaceDescription in project wildfly by wildfly.

the class InterfaceDefImpl method describe_interface.

public FullInterfaceDescription describe_interface() {
    if (fullInterfaceDescription != null)
        return fullInterfaceDescription;
    // Has to create the FullInterfaceDescription
    // TODO
    OperationDescription[] operations = new OperationDescription[0];
    AttributeDescription[] attributes = new AttributeDescription[0];
    String defined_in_id = "IDL:Global:1.0";
    if (defined_in instanceof org.omg.CORBA.ContainedOperations)
        defined_in_id = ((org.omg.CORBA.ContainedOperations) defined_in).id();
    fullInterfaceDescription = new FullInterfaceDescription(name, id, defined_in_id, version, operations, attributes, base_interfaces, type(), is_abstract);
    return fullInterfaceDescription;
}
Also used : FullInterfaceDescription(org.omg.CORBA.InterfaceDefPackage.FullInterfaceDescription) OperationDescription(org.omg.CORBA.OperationDescription) AttributeDescription(org.omg.CORBA.AttributeDescription)

Example 3 with FullInterfaceDescription

use of org.omg.CORBA.InterfaceDefPackage.FullInterfaceDescription in project ACS by ACS-Community.

the class BACIRemoteAccess method getIFDesc.

/**
	 * Insert the method's description here.
	 * Creation date: (6.5.2001 14:59:46)
	 * @return org.omg.CORBA.InterfaceDefPackage.FullInterfaceDescription
	 * @param id java.lang.String
	 */
private FullInterfaceDescription getIFDesc(String id) {
    FullInterfaceDescription fid = null;
    if (bufferDescs)
        fid = (FullInterfaceDescription) interfaceDescriptions.get(id);
    if (fid == null) {
        notifier.reportDebug("BACIRemoteAccess::getIFDesc", "Querying IR for full interface description for id '" + id + "'.");
        InterfaceDef idef = InterfaceDefHelper.narrow(rep.lookup_id(id));
        if (idef == null)
            throw new IllegalStateException("ID '" + id + "' was not found in the Repository.");
        fid = idef.describe_interface();
        if (bufferDescs)
            interfaceDescriptions.put(id, fid);
    } else {
        notifier.reportDebug("BACIRemoteAccess::getIFDesc", "Full interface description for id '" + id + "' was found in interface cache.");
    }
    return fid;
}
Also used : InterfaceDef(org.omg.CORBA.InterfaceDef) FullInterfaceDescription(org.omg.CORBA.InterfaceDefPackage.FullInterfaceDescription)

Aggregations

FullInterfaceDescription (org.omg.CORBA.InterfaceDefPackage.FullInterfaceDescription)3 InterfaceDef (org.omg.CORBA.InterfaceDef)2 ArrayList (java.util.ArrayList)1 AttributeDescription (org.omg.CORBA.AttributeDescription)1 OperationDescription (org.omg.CORBA.OperationDescription)1 TypeCode (org.omg.CORBA.TypeCode)1