Search in sources :

Example 6 with ProcessorEnvironment

use of org.apache.cxf.tools.corba.common.ProcessorEnvironment in project cxf by apache.

the class IDLToWSDL method execute.

public void execute(boolean exitOnFinish) {
    IDLToWSDLProcessor idlProcessor = new IDLToWSDLProcessor();
    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);
            initialise(env);
            validate(env);
            idlProcessor.setEnvironment(env);
            idlProcessor.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) ProcessorEnvironment(org.apache.cxf.tools.corba.common.ProcessorEnvironment) ToolException(org.apache.cxf.tools.common.ToolException) ToolException(org.apache.cxf.tools.common.ToolException) BadUsageException(org.apache.cxf.tools.common.toolspec.parser.BadUsageException) IDLToWSDLProcessor(org.apache.cxf.tools.corba.processors.idl.IDLToWSDLProcessor)

Aggregations

ProcessorEnvironment (org.apache.cxf.tools.corba.common.ProcessorEnvironment)6 IDLToWSDLProcessor (org.apache.cxf.tools.corba.processors.idl.IDLToWSDLProcessor)4 File (java.io.File)3 URL (java.net.URL)3 HashMap (java.util.HashMap)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 InputStream (java.io.InputStream)2 ToolException (org.apache.cxf.tools.common.ToolException)2 BadUsageException (org.apache.cxf.tools.common.toolspec.parser.BadUsageException)2 BufferedWriter (java.io.BufferedWriter)1 OutputStreamWriter (java.io.OutputStreamWriter)1 Writer (java.io.Writer)1 CommandDocument (org.apache.cxf.tools.common.toolspec.parser.CommandDocument)1 WSDLToCorbaProcessor (org.apache.cxf.tools.corba.processors.wsdl.WSDLToCorbaProcessor)1 Test (org.junit.Test)1