Class ClassMediator

  • All Implemented Interfaces:
    AspectConfigurable, ManagedLifecycle, Mediator, SynapseArtifact

    public class ClassMediator
    extends AbstractMediator
    implements ManagedLifecycle
    The class mediator delegates the mediation to a single instance of a specified class. The specified class must implement the Mediator interface and optionally may implement the ManagedLifecycle interface. At initialization time, a single instance of the class is instantiated using a public no argument constructor, and any one-time properties (parameter constants specified through the Synapse config) are set on the instance. If each request needs synchronization, the user must implement it within the specified class.
    See Also:
    Mediator
    • Constructor Detail

      • ClassMediator

        public ClassMediator()
    • Method Detail

      • mediate

        public boolean mediate​(MessageContext synCtx)
        Don't use a new instance... do one instance of the object per instance of this mediator
        Specified by:
        mediate in interface Mediator
        Parameters:
        synCtx - the message context
        Returns:
        as per standard semantics
      • destroy

        public void destroy()
        Description copied from interface: ManagedLifecycle
        This method should implement the destroying of the implemented parts of the configuration.
        Specified by:
        destroy in interface ManagedLifecycle
      • init

        public void init​(SynapseEnvironment se)
        Description copied from interface: ManagedLifecycle
        This method should implement the initialization of the implemented parts of the configuration.
        Specified by:
        init in interface ManagedLifecycle
        Parameters:
        se - SynapseEnvironment to be used for initialization
      • setMediator

        public void setMediator​(Mediator mediator)
      • getMediator

        public Mediator getMediator()
      • isContentAltering

        public boolean isContentAltering()
        Description copied from interface: Mediator
        This is used to indicate whether message payload get modified during mediation
        Specified by:
        isContentAltering in interface Mediator
        Overrides:
        isContentAltering in class AbstractMediator
        Returns:
        whether mediator modify the payload