1
2
3
4
5
6
7
8
9
10
11
12
13
14 package org.kuali.rice.ksb.messaging.servlet;
15
16 import javax.servlet.http.HttpServletRequest;
17 import javax.xml.namespace.QName;
18
19 import org.apache.log4j.Logger;
20 import org.kuali.rice.core.resourceloader.GlobalResourceLoader;
21 import org.kuali.rice.ksb.messaging.RemotedServiceRegistry;
22 import org.kuali.rice.ksb.service.KSBServiceLocator;
23 import org.springframework.web.servlet.HandlerMapping;
24 import org.springframework.web.servlet.handler.AbstractHandlerMapping;
25 import org.springframework.web.util.UrlPathHelper;
26
27
28
29
30
31
32
33 public class KSBHttpInvokerHandler extends AbstractHandlerMapping {
34
35 private static final Logger LOG = Logger.getLogger(KSBHttpInvokerHandler.class);
36
37 private UrlPathHelper urlPathHelper = new UrlPathHelper();
38
39 protected Object getHandlerInternal(HttpServletRequest request) throws Exception {
40 QName serviceName = getServiceNameFromRequest(request);
41 return ((RemotedServiceRegistry) GlobalResourceLoader.getService("enServiceInvoker")).getService(serviceName);
42 }
43
44 public QName getServiceNameFromRequest(HttpServletRequest request) {
45 return KSBServiceLocator.getServiceDeployer().getServiceName(request.getRequestURL().toString());
46 }
47 }