...
The POJOCommand (or Command) Mediator creates an instance of the specified command class, which may implement the org.apache.synapse.Command
interface or should have a public void method public void execute()
. If any properties are specified, the corresponding setter methods are invoked on the class before each message is executed. It should be noted that a new instance of the POJOCommand class is created to process each message processed. After execution of the POJOCommand Mediator, depending on the action
attribute of the property, the new value returned by a call to the corresponding getter method is stored back to the message or to the context.
...
Table of Contents | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Syntax
Code Block | ||||
---|---|---|---|---|
| ||||
<pojoCommand name="class-name"> ( <property name="string" value="string"/> | <property name="string" context-name="literal" [action=(ReadContext | UpdateContext | ReadAndUpdateContext)]> (either literal or XML child) </property> | <property name="string" expression="xpath" [action=(ReadMessage | UpdateMessage | ReadAndUpdateMessage)]/> ) * </pojoCommand> |
...
- Class Name - The class name of the Pojo class. You have to give the fully qualified name of the class and click the "Load Class" button.
- Properties of the POJOCommand mediator - After you click "Load Class" and if it is a valid Pojo Class, you will see the properties of the POJO class in a table with the following fields.
- Property Name - Name of the property. This will be automatically loaded from the class.
- Read Info - The value to set for the property. You can choose the value from either of following sources:
- Value - A Static value.
- Message - Reads a value from the incoming message. You can provide the XPath expression to execute on the message in the "Value" text field.
- Context - Reads a value from the Message context properties. You can provide the property key in the "Value" text field.
- Update Info - Specifies the action to do with reading be executed on the property value. You can choose following actions:
- NONE - No activity.
- Message - Updates the message. You can provide the XPath expression of the element you want to update in the "Value" text field.
- Context - Updates the properties (Message context). You can give the property key in the "Value" text field.
- Action - Link to delete the unused properties from the list.
...