Skip navigation links
org.wso2.carbon.mediators.router.impl

Class RouterMediator

    • Field Summary

      • Fields inherited from class org.apache.synapse.mediators.AbstractMediator

        log, trace, traceState
    • Constructor Summary

      Constructors 
      Constructor and Description
      RouterMediator() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addRoute(Route route) 
      void destroy()
      called when Router is destroyed
      List<Route> getRoutes() 
      void init(org.apache.synapse.core.SynapseEnvironment synapseEnvironment)
      called on Router startup.
      boolean isContinueAfter() 
      boolean mediate(org.apache.synapse.MessageContext synCtx)
      Routes the message depending on the specified set of routes if the routing condition is matching over the provided message.
      void setContinueAfter(boolean continueAfter) 
      void setRoutes(List<Route> routes) 
      • Methods inherited from class org.apache.synapse.mediators.AbstractMediator

        auditLog, auditWarn, configure, disableStatistics, disableTracing, divertMediationRoute, enableStatistics, enableTracing, getAspectConfiguration, getCommentsList, getDescription, getInputType, getLastSequenceFaultHandler, getLog, getMediatorName, getMediatorPosition, getOutputType, getRegisteredMediationFlowPoint, getShortDescription, getTraceState, getType, handleException, handleException, isBreakPoint, isContentAltering, isContentAware, isSkipEnabled, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, isTracingEnabled, registerMediationFlowPoint, reportCloseStatistics, reportOpenStatistics, setBreakPoint, setCommentsList, setComponentStatisticsId, setDescription, setEffectiveTraceState, setMediatorPosition, setShortDescription, setSkipEnabled, setTraceState, shouldCaptureTracing, shouldTrace, shouldTrace, traceOrDebug, traceOrDebugWarn, unregisterMediationFlowPoint
    • Constructor Detail

      • RouterMediator

        public RouterMediator()
    • Method Detail

      • mediate

        public boolean mediate(org.apache.synapse.MessageContext synCtx)

        Routes the message depending on the specified set of routes if the routing condition is matching over the provided message. There can be a list of routers specified in to a particualr order, and these routes will be invoked to route the message in the specified order.

        If there is a matching route found over the message then the routing will occur and after this synchronized routing further mediation of the message through other routes specified after the matching route will be decided by the value of the breakRouter attribute of the route.

        By default this mediator will drop the message stopping further medaition along the current path and this also can be modified by using the continueAfter attribute of the mediator.

        Specified by:
        mediate in interface org.apache.synapse.Mediator
        Parameters:
        synCtx - message to be routed
        Returns:
        whether to continue further mediaiton or not as a boolean value
        See Also:
        Mediator.mediate(org.apache.synapse.MessageContext), Route.doRoute(org.apache.synapse.MessageContext, SynapseLog)
      • setRoutes

        public void setRoutes(List<Route> routes)
      • addRoute

        public void addRoute(Route route)
      • isContinueAfter

        public boolean isContinueAfter()
      • setContinueAfter

        public void setContinueAfter(boolean continueAfter)
      • init

        public void init(org.apache.synapse.core.SynapseEnvironment synapseEnvironment)
        called on Router startup. initializes inline sequences and endpoints
        Specified by:
        init in interface org.apache.synapse.ManagedLifecycle
        Parameters:
        synapseEnvironment -
      • destroy

        public void destroy()
        called when Router is destroyed
        Specified by:
        destroy in interface org.apache.synapse.ManagedLifecycle

Copyright © 2017 WSO2. All rights reserved.