Package org.apache.synapse

Examples of org.apache.synapse.SynapseException


        throw new SynapseException(message);
    }

    private void handleException(String message, Exception e) {
        log.error(message, e);
        throw new SynapseException(message, e);
    }
View Full Code Here


        OMAttribute name = elem.getAttribute(ATT_NAME);
        if (name == null) {
            String msg = "The name of the actual POJO command implementation class" +
                    " is a required attribute";
            log.error(msg);
            throw new SynapseException(msg);
        }

        // load the class for the command object
        try {
            pojoMediator.setCommand(
View Full Code Here

        return false;
    }

    private void handleException(String message, Exception e) {
        log.error(message, e);
        throw new SynapseException(message, e);
    }
View Full Code Here

                for (int i = 0; i < entryList.size(); i++) {
                    entries[i] = entryList.get(i);
                }
                return entries;
            } catch (Exception e) {
                throw new SynapseException("Error in reading the URL.");
            } finally {
                if (reader != null) {
                    try {
                        reader.close();
                    } catch (IOException ignored) {
                    }
                }
            }
        } else {
            throw new SynapseException("Invalid protocol.");
        }
    }
View Full Code Here

        }
    }

    private void handleException(String msg) {
        log.error(msg);
        throw new SynapseException(msg);
    }
View Full Code Here

    public Object getObjectFromOMNode(OMNode om, Properties properties) {
        if (om instanceof OMElement) {
            OMElement epElement = (OMElement) om;
            return EndpointFactory.getEndpointFromElement(epElement, false, properties);
        } else {
            throw new SynapseException("Configuration is not in proper format.");
        }
    }
View Full Code Here

                if (val == null) {
                    String msg = "Parameter " +
                            "loadbalance.weighted.weight should be specified for every " +
                            "endpoint in the load balance group";
                    log.error(msg);
                    throw new SynapseException(msg);
                }
                totalWeight += Integer.parseInt(val.getValue());
            }
        }

        this.totalWeight = totalWeight;

        for (int i = 0; i < endpoints.size(); i++) {
            Endpoint e = endpoints.get(i);
            if (e instanceof PropertyInclude) {
                PropertyInclude include = (PropertyInclude) e;

                MediatorProperty weight = include.getProperty(
                        LB_WEIGHTED_RRLC_WEIGHT);

                String key;
                URL url;
                if (e instanceof AddressEndpoint) {
                    AddressEndpoint addressEndpoint = (AddressEndpoint) e;
                    try {
                        url = new URL(addressEndpoint.getDefinition().getAddress());
                    } catch (MalformedURLException e1) {
                        String msg = "Mulformed URL in address endpoint";
                        log.error(msg);
                        throw new SynapseException(msg);
                    }
                } else if (e instanceof WSDLEndpoint) {
                    WSDLEndpoint wsdlEndpoint = (WSDLEndpoint) e;
                    try {
                        url = new URL(wsdlEndpoint.getDefinition().getAddress());
                    } catch (MalformedURLException e1) {
                        String msg = "Mulformed URL in address endpoint";
                        log.error(msg);
                        throw new SynapseException(msg);
                    }
                } else {
                    String msg = "Only AddressEndpoint and WSDLEndpoint can be used " +
                                    "with WeightedRRLCAlgorithm";
                    log.error(msg);
                    throw new SynapseException(msg);
                }

                // construct the key
                key = url.getHost() + ":" + url.getPort();
View Full Code Here

        }
    }

    private void handleException(String msg, Exception e) {
        log.error(msg, e);
        throw new SynapseException(msg, e);
    }
View Full Code Here

        throw new SynapseException(msg, e);
    }

    private void handleException(String msg) {
        log.error(msg);
        throw new SynapseException(msg);
    }
View Full Code Here

                "language"));
        OMAttribute functionAtt = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE,
                "function"));

        if (langAtt == null) {
            throw new SynapseException("The 'language' attribute is required for" +
                    " a script mediator");
            // TODO: couldn't this be determined from the key in some scenarios?
        }
        if (keyAtt == null && functionAtt != null) {
            throw new SynapseException("Cannot use 'function' attribute without 'key' " +
                    "attribute for a script mediator");
        }

        Map<String, Object> includeKeysMap = getIncludeKeysMap(elem);
View Full Code Here

TOP

Related Classes of org.apache.synapse.SynapseException

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.