...
Code Block | ||||
---|---|---|---|---|
| ||||
<scripting:endpoint service="test:myScriptingService" endpoint="scriptingEndpoint" script="classpath:MyGroovyScript.groovy" /> |
Code Block | |||||
---|---|---|---|---|---|
| |||||
<scripting:endpoint service="test:myScriptingService"
endpoint="scriptingEndpoint"
script="classpath:MyGroovyScript.groovy"
targetService="test:anotherService"/>
The endpoint can handle InOnly and InOut MEP. |
The following table shows the additional configuration possibilities of the endpoint.
Info | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
For all xbean file endpoint configuration take a look at Xml schemas
...
No Format |
---|
<beans xmlns:scripting="http://servicemix.apache.org/scripting/1.0" xmlns:test="http://servicemix.apache.org/test" xmlns:util="http://www.springframework.org/schema/util"> <!-- JavaScript JSR-223 Endpoint --> <scripting:endpoint service="test:js-jsr223" endpoint="endpoint" script="classpath:MyJavaScriptFile.js" bindings="#myCustomBindings"> </scripting:endpoint>> <util:map id="myCustomBindings"> <entry key="company" value="My Company" /> <entry key="logo" value="/home/lhein/myLogo.png" /> </util:map> </beans> |
...
Variable | Description | Type |
---|---|---|
componentContext | The JBI Component Context | javax.jbi.component.ComponentContext |
deliveryChannel | the Delivery Channel | javax.jbi.messaging.DeliveryChannel |
exchange | The JBI Message Exchange | javax.jbi.messaging.MessageExchange |
inMessage | The in message | javax.jbi.messaging.NormalizedMessage |
outExchange | The JBI Message Exchange for the answer | javax.jbi.messaging.MessageExchange |
outMessage | The out message for answer | javax.jbi.messaging.NormalizedMessage |
log | The script logger object | java.util.logging.Logger |
endpoint | the scripting endpoint which executes the script | org.apache.servicemix.scripting.ScriptingEndpoint |
endpointname | the name of this endpoint | java.lang.String |
servicename | the name of this service | java.lang.String |
interfacename | the name of this interface | java.lang.String |
script | the absolute path of the script or the script itself if path can't be determined | java.lang.String or org.springframework.core.io.Resource |
bindings | a map containing user defined values | java.util.Map<String,Object> |
...