Reputation: 35
I want to access a Java class from within a Mule flow.
public class MyJava{
private Map<String, String> unamePwdMap;
public Map <String, String> getUnamePwdFromKey (String key){
return unamePwdMap;
}
}
Is this possible for Mule flow to call a method and send an argument and access a Java Map, extract values from the Map (knowing the hard-coded key).
(code shown here is just for understanding)
Upvotes: 0
Views: 550
Reputation: 9
You have to use the specific element to call your Java class. Something like this:
<custom-transformer class="<your Java class>" doc:name="<name to display>"/>
and include your Java class in the project.
Upvotes: 1
Reputation: 8311
You can use java component in the flow example :-
< flow name="Db1Flow1" doc:name="Db1Flow1" > < http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP" />
< component doc:name="Java" class="MyJava"/ > < /flow >
Here class-="MyJava" is your java file
Upvotes: 1
Reputation: 184
this can be easily done, use components: http://www.mulesoft.org/documentation/display/current/Mule+Components
Upvotes: 0