EndpointResolver resolver =
client.createResolverForService(service);
d. Now, we can send the message to the JBI bus using the
ServiceMixClient.
client.send(resolver, null, null, messageToDespatch);
5. Now, destinationHelloService is the service pointing to JSR POJO
Destination. So, the message from the JBI bus will be accepted by
JSR POJO Destination.
Chapter 9
[ 177 ]
The following figure shows the above sequences of events:
:Http :Bridge :Qname :ServiceMixClientFacade :Destination
1. POST()
1.1. send()
3.1. Qname()
3.3. send()
4. accept()
3.2. createResolverForService()
3.2.1. send()
2. accept()
3. sendToJbi()
:Client :JBI
Sample Code Listing
There is not much difference in the code than what we have seen in the previous
sample, but the BridgeHelloServicePojo class will be listed as follows, to discuss a
few points:
public class BridgeHelloServicePojo implements BridgeHelloServiceBI
{
private ComponentContext context;
public void setContext(ComponentContext context)
{
this.context = context;
}
public String broker(String phrase)
{
try
{
send(phrase);
}
catch(JBIException jbiException)
{
POJO Binding Using JSR181
[ 178 ]
jbiException.
Pages:
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255