Search in sources :

Example 1 with ParameterAnalysis

use of org.wildfly.iiop.openjdk.rmi.ParameterAnalysis in project wildfly by wildfly.

the class InterfaceRepository method addOperations.

/**
     * Add a set of operations to a container (interface or value class).
     */
private void addOperations(LocalContainer container, ContainerAnalysis ca) throws RMIIIOPViolationException, IRConstructionException {
    OperationAnalysis[] ops = ca.getOperations();
    for (int i = 0; i < ops.length; ++i) {
        OperationDefImpl oDef;
        String oName = ops[i].getIDLName();
        String oid = ca.getMemberRepositoryId(oName);
        Class cls = ops[i].getReturnType();
        TypeCode typeCode = getTypeCode(cls);
        ParameterAnalysis[] ps = ops[i].getParameters();
        ParameterDescription[] params = new ParameterDescription[ps.length];
        for (int j = 0; j < ps.length; ++j) {
            params[j] = new ParameterDescription(ps[j].getIDLName(), getTypeCode(ps[j].getCls()), // filled in later
            null, ParameterMode.PARAM_IN);
        }
        ExceptionAnalysis[] exc = ops[i].getMappedExceptions();
        ExceptionDef[] exceptions = new ExceptionDef[exc.length];
        for (int j = 0; j < exc.length; ++j) {
            ExceptionDefImpl e = addException(exc[j]);
            exceptions[j] = ExceptionDefHelper.narrow(e.getReference());
        }
        oDef = new OperationDefImpl(oid, oName, "1.0", container, typeCode, params, exceptions, impl);
        container.add(oName, oDef);
    }
}
Also used : TypeCode(org.omg.CORBA.TypeCode) ExceptionAnalysis(org.wildfly.iiop.openjdk.rmi.ExceptionAnalysis) OperationAnalysis(org.wildfly.iiop.openjdk.rmi.OperationAnalysis) ParameterAnalysis(org.wildfly.iiop.openjdk.rmi.ParameterAnalysis) ExceptionDef(org.omg.CORBA.ExceptionDef) ParameterDescription(org.omg.CORBA.ParameterDescription)

Aggregations

ExceptionDef (org.omg.CORBA.ExceptionDef)1 ParameterDescription (org.omg.CORBA.ParameterDescription)1 TypeCode (org.omg.CORBA.TypeCode)1 ExceptionAnalysis (org.wildfly.iiop.openjdk.rmi.ExceptionAnalysis)1 OperationAnalysis (org.wildfly.iiop.openjdk.rmi.OperationAnalysis)1 ParameterAnalysis (org.wildfly.iiop.openjdk.rmi.ParameterAnalysis)1