Search in sources :

Example 1 with WSDLToCorbaProcessor

use of org.apache.cxf.tools.corba.processors.wsdl.WSDLToCorbaProcessor in project cxf by apache.

the class WSDLToIDL method execute.

public void execute(boolean exitOnFinish) {
    WSDLToCorbaProcessor corbaProcessor = new WSDLToCorbaProcessor();
    ProcessorEnvironment env = null;
    try {
        super.execute(exitOnFinish);
        if (!hasInfoOption()) {
            env = new ProcessorEnvironment();
            env.setParameters(getParametersMap(getArrayKeys()));
            if (isVerboseOn()) {
                env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
            }
            env.put(ToolConstants.CFG_CMD_ARG, args);
            CommandDocument doc = super.getCommandDocument();
            if (doc.hasParameter("corba")) {
                env.put(ToolCorbaConstants.CFG_CORBA, Boolean.TRUE);
            }
            if (doc.hasParameter("idl")) {
                env.put(ToolCorbaConstants.CFG_IDL, Boolean.TRUE);
            }
            initialise(env);
            validate(env);
            corbaProcessor.setEnvironment(env);
            corbaProcessor.process();
        }
    } catch (ToolException ex) {
        err.println("Error : " + ex.getMessage());
        if (ex.getCause() instanceof BadUsageException) {
            printUsageException(TOOL_NAME, (BadUsageException) ex.getCause());
        }
        err.println();
        if (isVerboseOn()) {
            ex.printStackTrace(err);
        }
        throw ex;
    } catch (Exception ex) {
        err.println("Error : " + ex.getMessage());
        err.println();
        if (isVerboseOn()) {
            ex.printStackTrace(err);
        }
        throw new ToolException(ex.getMessage(), ex.getCause());
    }
}
Also used : BadUsageException(org.apache.cxf.tools.common.toolspec.parser.BadUsageException) WSDLToCorbaProcessor(org.apache.cxf.tools.corba.processors.wsdl.WSDLToCorbaProcessor) ProcessorEnvironment(org.apache.cxf.tools.corba.common.ProcessorEnvironment) CommandDocument(org.apache.cxf.tools.common.toolspec.parser.CommandDocument) ToolException(org.apache.cxf.tools.common.ToolException) ToolException(org.apache.cxf.tools.common.ToolException) BadUsageException(org.apache.cxf.tools.common.toolspec.parser.BadUsageException)

Aggregations

ToolException (org.apache.cxf.tools.common.ToolException)1 BadUsageException (org.apache.cxf.tools.common.toolspec.parser.BadUsageException)1 CommandDocument (org.apache.cxf.tools.common.toolspec.parser.CommandDocument)1 ProcessorEnvironment (org.apache.cxf.tools.corba.common.ProcessorEnvironment)1 WSDLToCorbaProcessor (org.apache.cxf.tools.corba.processors.wsdl.WSDLToCorbaProcessor)1