Search in sources :

Example 6 with InterfaceDef

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

the class ComponentsManager method getComponentProperties.

/**
	 * Gets a list of properties name from a given component.
	 * @param componentName string with the component name.
	 * @return array of strings.
	 * FIXME: does it have to be case sensitive??
	 * FIXME: Must handle the exception.
	 **/
public List<String> getComponentProperties(String componentName) {
    List<String> tmp = new ArrayList<String>();
    if (componentExists(componentName)) {
        try {
            ComponentDescriptor desc = cServices.getComponentDescriptor(componentName);
            InterfaceDef ifdef = InterfaceDefHelper.narrow(rep.lookup_id(desc.getType()));
            if (ifdef == null)
                return null;
            // begin
            /*
				FullInterfaceDescription ifdes = ifdef.describe_interface();
                for(int i = 0 ; i < ifdes.attributes.length ; i++){
                        TypeCode tc = ifdes.attributes[i].type;
                        if(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);
                }
                //end
                */
            tmp = getComponentProperties(ifdef);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return tmp;
}
Also used : InterfaceDef(org.omg.CORBA.InterfaceDef) ComponentDescriptor(alma.acs.component.ComponentDescriptor) ArrayList(java.util.ArrayList)

Example 7 with InterfaceDef

use of org.omg.CORBA.InterfaceDef 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)

Aggregations

InterfaceDef (org.omg.CORBA.InterfaceDef)7 ArrayList (java.util.ArrayList)3 FullInterfaceDescription (org.omg.CORBA.InterfaceDefPackage.FullInterfaceDescription)2 ComponentDescriptor (alma.acs.component.ComponentDescriptor)1 ZeroPortPolicy (com.sun.corba.se.spi.extension.ZeroPortPolicy)1 IOException (java.io.IOException)1 InvalidClassException (java.io.InvalidClassException)1 TransactionManager (javax.transaction.TransactionManager)1 EJBComponent (org.jboss.as.ejb3.component.EJBComponent)1 StatelessSessionComponent (org.jboss.as.ejb3.component.stateless.StatelessSessionComponent)1 EJBMetaDataImplIIOP (org.jboss.ejb.iiop.EJBMetaDataImplIIOP)1 HomeHandleImplIIOP (org.jboss.ejb.iiop.HomeHandleImplIIOP)1 MarshallingConfiguration (org.jboss.marshalling.MarshallingConfiguration)1 RiverMarshallerFactory (org.jboss.marshalling.river.RiverMarshallerFactory)1 IORSecurityConfigMetaData (org.jboss.metadata.ejb.jboss.IORSecurityConfigMetaData)1 IORTransportConfigMetaData (org.jboss.metadata.ejb.jboss.IORTransportConfigMetaData)1 StartException (org.jboss.msc.service.StartException)1 Any (org.omg.CORBA.Any)1 Contained (org.omg.CORBA.Contained)1 ORB (org.omg.CORBA.ORB)1