Package org.objectweb.celtix.tools.common

Examples of org.objectweb.celtix.tools.common.ToolException


            try {
                handler = (Tool)Class.forName(handlerClz, true, loader).newInstance();
            } catch (Exception ex) {
                Message message = new Message("FAIL_TO_INSTANTIATE_HANDLER", LOG, handlerClz);
                throw new ToolException(message, ex);
            }
        }
        return handler;
    }
View Full Code Here


    public void init() throws ToolException {
        // initialize
        if (toolspec == null) {
            Message message = new Message("TOOLSPEC_NOT_INITIALIZED", LOG);
            LOG.log(Level.SEVERE, message.toString());
            throw new ToolException(message);
        }
    }
View Full Code Here

        Template tmpl = null;
        try {
            tmpl = Velocity.getTemplate(templateName);
        } catch (Exception e) {
            Message msg = new Message("TEMPLATE_MISSING", LOG, templateName);
            throw new ToolException(msg, e);
        }

        VelocityContext ctx = new VelocityContext();

        for (Iterator iter = attributes.keySet().iterator(); iter.hasNext();) {
            String key = (String)iter.next();
            ctx.put(key, attributes.get(key));
        }

        VelocityWriter writer = new VelocityWriter(outputs);
        try {
            tmpl.merge(ctx, writer);
            writer.close();
        } catch (Exception e) {
            Message msg = new Message("VELOCITY_ENGINE_WRITE_ERRORS", LOG);
            throw new ToolException(msg, e);
        }
    }
View Full Code Here

        fw = new FileWriterUtil((String)env.get(ToolConstants.CFG_OUTPUTDIR));
        try {
            writer = fw.getWriter(packageName, filename + ext);
        } catch (IOException ioe) {
            Message msg = new Message("FAIL_TO_WRITE_FILE", LOG, packageName + "." + filename + ext);
            throw new ToolException(msg, ioe);
        }

        return writer;
    }
View Full Code Here

    }

    public void addChildren(JavaParameter jp) {
        if (parts.contains(jp)) {
            Message message = new Message("PART_ALREADY_EXIST", LOG, jp.getName());
            throw new ToolException(message);
        }
        parts.add(jp);
    }
View Full Code Here

    }

    private void validate() throws ToolException {
        if (isBindingExisted()) {
            Message msg = new Message("BINDING_ALREADY_EXIST", LOG);
            throw new ToolException(msg);
        }
        if (!isPortTypeExisted()) {
            Message msg = new Message("PORTTYPE_NOT_EXIST", LOG);
            throw new ToolException(msg);
        }
        if (!nameSpaceCheck()) {
            Message msg = new Message("SOAPBINDING_STYLE_NOT_PROVIEDED", LOG);
            throw new ToolException(msg);
        }
        if (WSDLConstants.RPC.equalsIgnoreCase((String)env.get(ToolConstants.CFG_STYLE))) {
            Iterator it = portType.getOperations().iterator();
            while (it.hasNext()) {
                Operation op = (Operation)it.next();
                Input input = op.getInput();
                if (input != null && input.getMessage() != null) {
                    Iterator itParts = input.getMessage().getParts().values().iterator();
                    while (itParts.hasNext()) {
                        Part part = (Part)itParts.next();
                        if (part.getTypeName() == null || "".equals(part.getTypeName().toString())) {
                            Message msg = new Message("RPC_PART_ILLEGAL", LOG, new Object[] {part.getName()});
                            throw new ToolException(msg);
                        }
                    }
                }
                Output output = op.getOutput();
                if (output != null && output.getMessage() != null) {
                    Iterator itParts = output.getMessage().getParts().values().iterator();
                    while (itParts.hasNext()) {
                        Part part = (Part)itParts.next();
                        if (part.getTypeName() == null || "".equals(part.getTypeName().toString())) {
                            Message msg = new Message("RPC_PART_ILLEGAL", LOG, new Object[] {part.getName()});
                            throw new ToolException(msg);
                        }
                    }
                }
            }
        }
View Full Code Here

        Writer outputWriter = getOutputWriter(NEW_FILE_NAME_MODIFIER);
        try {
            wsdlWriter.writeWSDL(wsdlDefinition, outputWriter);
        } catch (WSDLException wse) {
            Message msg = new Message("FAIL_TO_WRITE_WSDL", LOG);
            throw new ToolException(msg);

        }
        try {
            outputWriter.close();
        } catch (IOException ioe) {
            Message msg = new Message("PORTTYPE_NOT_EXIST", LOG);
            throw new ToolException(msg);
        }
    }
View Full Code Here

        SOAPBinding soapBinding = null;
        try {
            soapBinding = (SOAPBinding)extReg.createExtension(Binding.class, WSDLConstants.NS_SOAP_BINDING);
        } catch (WSDLException wse) {
            Message msg = new Message("FAIL_TO_CREATE_SOAPBINDING", LOG);
            throw new ToolException(msg, wse);
        }
        soapBinding.setStyle((String)env.get(ToolConstants.CFG_STYLE));
        soapBinding.setTransportURI(WSDLConstants.NS_SOAP11_HTTP_BINDING);
        binding.addExtensibilityElement(soapBinding);
    }
View Full Code Here

        try {
            soapOperation = (SOAPOperation)extReg.createExtension(BindingOperation.class,
                                                                  WSDLConstants.NS_SOAP_OPERATION);
        } catch (WSDLException wse) {
            Message msg = new Message("FAIL_TO_CREATE_SOAPBINDING", LOG);
            throw new ToolException(msg, wse);
        }
        soapOperation.setStyle((String)env.get(ToolConstants.CFG_STYLE));
        soapOperation.setSoapActionURI("");
        bo.addExtensibilityElement(soapOperation);
    }
View Full Code Here

        SOAPBody soapBody = null;
        try {
            soapBody = (SOAPBody)extReg.createExtension(parent, WSDLConstants.NS_SOAP_BODY);
        } catch (WSDLException wse) {
            Message msg = new Message("FAIL_TO_CREATE_SOAPBINDING", LOG);
            throw new ToolException(msg, wse);
        }
        soapBody.setUse((String)env.get(ToolConstants.CFG_USE));
        if (WSDLConstants.RPC.equalsIgnoreCase((String)env.get(ToolConstants.CFG_STYLE))
            && env.optionSet(ToolConstants.CFG_NAMESPACE)) {
            soapBody.setNamespaceURI((String)env.get(ToolConstants.CFG_NAMESPACE));
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.tools.common.ToolException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.