1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.ksb.messaging.servlet;
17
18 import javax.servlet.http.HttpServletRequest;
19 import javax.servlet.http.HttpServletResponse;
20
21 import org.apache.cxf.BusFactory;
22 import org.apache.cxf.transport.servlet.ServletController;
23 import org.kuali.rice.ksb.service.KSBServiceLocator;
24 import org.springframework.web.servlet.ModelAndView;
25 import org.springframework.web.servlet.mvc.Controller;
26
27
28
29
30
31
32
33
34 public class CXFServletControllerAdapter implements Controller{
35
36 private ServletController controller;
37
38
39
40
41
42
43 public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
44
45 try {
46 BusFactory.setThreadDefaultBus(KSBServiceLocator.getCXFBus());
47 controller.invoke(request, response);
48 } finally {
49 BusFactory.setThreadDefaultBus(null);
50 }
51
52 return null;
53 }
54
55 public void setController(ServletController controller){
56 this.controller = controller;
57 }
58 }