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 void
addAllProperties(List<MediatorProperty> propertyList)
void
addProperty(MediatorProperty property)
void
destroy()
This method should implement the destroying of the implemented parts of the configuration.Mediator
getMediator()
List<MediatorProperty>
getProperties()
void
init(SynapseEnvironment se)
This method should implement the initialization of the implemented parts of the configuration.boolean
isContentAltering()
This is used to indicate whether message payload get modified during mediationboolean
isContentAware()
boolean
mediate(MessageContext synCtx)
Don't use a new instance...void
setMediator(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:ManagedLifecycle
This method should implement the destroying of the implemented parts of the configuration.- Specified by:
destroy
in interfaceManagedLifecycle
-
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 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:
isContentAware
in interfaceMediator
- Overrides:
isContentAware
in classAbstractMediator
-
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 interfaceMediator
- Overrides:
isContentAltering
in classAbstractMediator
- Returns:
- whether mediator modify the payload
-
-