Package org.apache.synapse.mediators.ext
Class POJOCommandMediator
- java.lang.Object
-
- org.apache.synapse.mediators.AbstractMediator
-
- org.apache.synapse.mediators.ext.POJOCommandMediator
-
- All Implemented Interfaces:
AspectConfigurable
,Mediator
,SynapseArtifact
- Direct Known Subclasses:
AnnotatedCommandMediator
public class POJOCommandMediator extends AbstractMediator
This mediator will use the specified command object and execute the command after setting the properties specified to it through the configuraiton. The specified command object may or may not implement the Command interface. If the Command object has not implemented the Command interface then this will use reflection to find a method called execute() and execute it.- See Also:
interface
-
-
Field Summary
-
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
-
-
Constructor Summary
Constructors Constructor Description POJOCommandMediator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContextGetterProperty(String name, String value)
void
addContextSetterProperty(String name, String ctxName)
void
addMessageGetterProperty(String name, SynapseXPath xpath)
void
addMessageSetterProperty(String name, SynapseXPath xpath)
void
addStaticSetterProperty(String name, Object value)
Class
getCommand()
Map<String,String>
getContextGetterProperties()
Map<String,String>
getContextSetterProperties()
Map<String,SynapseXPath>
getMessageGetterProperties()
Map<String,SynapseXPath>
getMessageSetterProperties()
Map<String,Object>
getStaticSetterProperties()
boolean
mediate(MessageContext synCtx)
Implements the mediate method of the Mediator interface.void
setCommand(Class command)
-
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
-
-
-
-
Method Detail
-
mediate
public boolean mediate(MessageContext synCtx)
Implements the mediate method of the Mediator interface. This method will instantiate a new instance of the POJO class, set all specified properties from the current runtime state (and message context) and call the execute method of the Command object.- Parameters:
synCtx
- - Synapse MessageContext to be mediated- Returns:
- boolean true since this will not stop exection chain
-
getCommand
public Class getCommand()
-
setCommand
public void setCommand(Class command)
-
addMessageSetterProperty
public void addMessageSetterProperty(String name, SynapseXPath xpath)
-
addMessageGetterProperty
public void addMessageGetterProperty(String name, SynapseXPath xpath)
-
getMessageSetterProperties
public Map<String,SynapseXPath> getMessageSetterProperties()
-
getMessageGetterProperties
public Map<String,SynapseXPath> getMessageGetterProperties()
-
-