Package org.apache.synapse.mediators.ext
Class ClassMediator
- java.lang.Object
-
- org.apache.synapse.mediators.AbstractMediator
-
- org.apache.synapse.mediators.ext.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
-
-
Field Summary
-
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
-
-
Constructor Summary
Constructors Constructor Description ClassMediator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAllProperties(List<MediatorProperty> propertyList)voidaddProperty(MediatorProperty property)voiddestroy()This method should implement the destroying of the implemented parts of the configuration.MediatorgetMediator()List<MediatorProperty>getProperties()voidinit(SynapseEnvironment se)This method should implement the initialization of the implemented parts of the configuration.booleanisContentAltering()This is used to indicate whether message payload get modified during mediationbooleanisContentAware()booleanmediate(MessageContext synCtx)Don't use a new instance...voidsetMediator(Mediator mediator)-
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, isSkipEnabled, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, isTracingEnabled, registerMediationFlowPoint, reportCloseStatistics, reportOpenStatistics, setBreakPoint, setCommentsList, setComponentStatisticsId, setDescription, setEffectiveTraceState, setMediatorPosition, setShortDescription, setSkipEnabled, setTraceState, shouldCaptureTracing, shouldTrace, shouldTrace, traceOrDebug, traceOrDebugWarn, unregisterMediationFlowPoint
-
-
-
-
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
-
destroy
public void destroy()
Description copied from interface:ManagedLifecycleThis method should implement the destroying of the implemented parts of the configuration.- Specified by:
destroyin interfaceManagedLifecycle
-
init
public void init(SynapseEnvironment se)
Description copied from interface:ManagedLifecycleThis method should implement the initialization of the implemented parts of the configuration.- Specified by:
initin interfaceManagedLifecycle- Parameters:
se- SynapseEnvironment to be used for initialization
-
setMediator
public void setMediator(Mediator mediator)
-
getMediator
public Mediator getMediator()
-
addProperty
public void addProperty(MediatorProperty property)
-
addAllProperties
public void addAllProperties(List<MediatorProperty> propertyList)
-
getProperties
public List<MediatorProperty> getProperties()
-
isContentAware
public boolean isContentAware()
- Specified by:
isContentAwarein interfaceMediator- Overrides:
isContentAwarein classAbstractMediator
-
isContentAltering
public boolean isContentAltering()
Description copied from interface:MediatorThis is used to indicate whether message payload get modified during mediation- Specified by:
isContentAlteringin interfaceMediator- Overrides:
isContentAlteringin classAbstractMediator- Returns:
- whether mediator modify the payload
-
-