Package org.apache.synapse

Examples of org.apache.synapse.SynapseException


        return null;
    }

    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

            try {
                return canAcess(synCtx);
            }
            catch (
                    ThrottleException e) {
                throw new SynapseException(e.getMessage());
            }

        }
View Full Code Here

                try {
                    accessControler = new AccessRateController();
                    boolean canAccess = accessControler.canAccess(
                            throttleContext, remoteIP, ThrottleConstants.IP_BASE).isAccessAllowed();
                    if (!canAccess) {
                        throw new SynapseException("Access has currently been denied by" +
                                " the IP_BASE throttle for IP :\t" + remoteIP);
                    }
                    return canAccess;
                }
                catch (ThrottleException e) {
View Full Code Here

                throttle = ThrottleFactory.createMediatorThrottle(
                        PolicyEngine.getPolicy(policyOmElement));
            }
            catch (ThrottleException e) {

                throw new SynapseException(e.getMessage());
            }
        }
View Full Code Here

        Object springConfig = synCtx.getEntry(configKey);
        if(springConfig == null) {
          String errorMessage = "Cannot look up Spring configuration " + configKey;
          log.error(errorMessage);
          throw new SynapseException(errorMessage);
        }

        xbdr.loadBeanDefinitions(
            new InputStreamResource(
                SynapseConfigUtils.getStreamSource(springConfig).getInputStream()));
View Full Code Here

            }

        } catch (Exception e) {
            String msg = "Error starting up Scheduler : " + e.getMessage();
            log.fatal(msg, e);
            throw new SynapseException(msg, e);
        }

    }
View Full Code Here

        this.taskDescription = taskDescription;
    }

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

public class SimpleQuartzSerializer implements StartupSerializer {

    public OMElement serializeStartup(OMElement parent, Startup s) {

        if (!(s instanceof SimpleQuartz)) {
            throw new SynapseException("called TaskSerializer on some other " +
                    "kind of startup" + s.getClass().getName());
        }

        SimpleQuartz sq = (SimpleQuartz) s;
       
        TaskDescription taskDescription = sq.getTaskDescription();

        if (taskDescription != null) {
            OMElement task = TaskDescriptionSerializer.serializeTaskDescription(
                    SynapseConstants.SYNAPSE_OMNAMESPACE, taskDescription);
            if (task == null) {
                throw new SynapseException("Task Element can not be null.");
            }
            if (parent != null) {
                parent.addChild(task);
            }
            return task;
        } else {
            throw new SynapseException("Task Description is null");
        }
    }
View Full Code Here

        } else {
            Object result;
            try {
                result = xpath.selectSingleNode(synCtx);
            } catch (JaxenException e) {
                throw new SynapseException("Error evaluating XPath expression : " + xpath, e, synLog);
            }
            if (result instanceof OMNode) {
                return (OMNode) result;
            } else if (result instanceof String) {
                return SynapseConfigUtils.stringToOM((String) result);
            } else {
                throw new SynapseException("The evaluation of the XPath expression "
                        + xpath + " did not result in an OMNode : " + result, synLog);
            }
        }
    }
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.