1
2
3
4
5
6
7 package org.mule.test.integration.spring.events.async;
8
9 import org.mule.module.spring.events.MuleApplicationEvent;
10 import org.mule.test.integration.spring.events.Order;
11 import org.mule.test.integration.spring.events.OrderManagerBean;
12
13 import org.springframework.beans.BeansException;
14 import org.springframework.context.ApplicationContext;
15 import org.springframework.context.ApplicationContextAware;
16
17
18
19
20
21 public class AsyncOrderManagerBean extends OrderManagerBean
22 implements AsyncOrderManager, ApplicationContextAware
23 {
24 private ApplicationContext applicationContext;
25
26
27
28
29
30
31
32 public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
33 {
34 this.applicationContext = applicationContext;
35 }
36
37
38
39
40
41
42
43 public void processOrderAsync(Order order)
44 {
45
46 String message = "Order '" + order.getOrder() + "' Processed Async";
47 MuleApplicationEvent returnEvent = null;
48 returnEvent = new MuleApplicationEvent(message, "jms://processed.queue");
49
50
51 applicationContext.publishEvent(returnEvent);
52 }
53 }