org.apache.synapse.mediators.eip.sample
Class SamplingThrottleMediator
java.lang.Object
org.apache.synapse.mediators.AbstractMediator
org.apache.synapse.mediators.eip.sample.SamplingThrottleMediator
- All Implemented Interfaces:
- AspectConfigurable, ManagedLifecycle, Mediator, SynapseArtifact
public class SamplingThrottleMediator
- extends AbstractMediator
- implements ManagedLifecycle
This implements the well known Sample
EIP (Enterprise Integration Pattern), which controls the flow
of messages and limit the rate at which the messages are flowing through the sampler
Please note that the usage of this will require the sampler to be on the out-flow as well to correctly
determine & to manage the rate.
- See Also:
AbstractMediator
Methods inherited from class org.apache.synapse.mediators.AbstractMediator |
auditLog, auditWarn, configure, disableStatistics, enableStatistics, getAspectConfiguration, getDescription, getLog, getTraceState, getType, handleException, handleException, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, setDescription, setEffectiveTraceState, setTraceState, shouldTrace, traceOrDebug, traceOrDebugWarn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SamplingThrottleMediator
public SamplingThrottleMediator()
init
public void init(SynapseEnvironment synapseEnvironment)
- 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:
synapseEnvironment
- SynapseEnvironment to be used for initialization
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
mediate
public boolean mediate(MessageContext messageContext)
- Description copied from interface:
Mediator
- Invokes the mediator passing the current message for mediation. Each
mediator performs its mediation action, and returns true if mediation
should continue, or false if further mediation should be aborted.
- Specified by:
mediate
in interface Mediator
- Parameters:
messageContext
- the current message for mediation
- Returns:
- true if further mediation should continue
getSamplingRate
public int getSamplingRate()
setSamplingRate
public void setSamplingRate(int samplingRate)
getId
public String getId()
setId
public void setId(String id)
getTarget
public Target getTarget()
setTarget
public void setTarget(Target target)
getUnitTime
public long getUnitTime()
setUnitTime
public void setUnitTime(long unitTime)
getMessageQueue
public MessageQueue getMessageQueue()
setMessageQueue
public void setMessageQueue(MessageQueue messageQueue)
isMessageQueueExplicitlySet
public boolean isMessageQueueExplicitlySet()
Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.