1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.ksb.service;
17
18 import java.util.Map;
19
20 import org.apache.cxf.Bus;
21 import org.apache.cxf.bus.CXFBusImpl;
22 import org.apache.cxf.endpoint.ServerRegistry;
23 import org.kuali.rice.ksb.messaging.MessageHelper;
24 import org.kuali.rice.ksb.messaging.threadpool.KSBScheduledPool;
25 import org.kuali.rice.ksb.messaging.threadpool.KSBThreadPool;
26
27
28 public class KSBContextServiceLocator {
29
30 private Map services;
31
32 public static final String THREAD_POOL_SERVICE = "enThreadPool";
33 public static final String SCHEDULED_THREAD_POOL_SERVICE = "enScheduledThreadPool";
34
35 public Object getService(String name) {
36 return services.get(name);
37 }
38
39
40
41
42 public Map getServices() {
43 return this.services;
44 }
45
46
47
48
49 public void setServices(Map services) {
50 this.services = services;
51 }
52
53 public MessageHelper getMessageHelper() {
54 return (MessageHelper) getService("enMessageHelper");
55 }
56
57 public KSBThreadPool getThreadPool() {
58 return (KSBThreadPool) getService(THREAD_POOL_SERVICE);
59 }
60
61 public KSBScheduledPool getScheduledPool() {
62 return (KSBScheduledPool) getService(SCHEDULED_THREAD_POOL_SERVICE);
63 }
64
65 public Bus getCXFBus(){
66 return (CXFBusImpl) getService("cxf");
67 }
68
69 public ServerRegistry getCXFServerRegistry(){
70 return (ServerRegistry)getService("org.apache.cxf.endpoint.ServerRegistry");
71 }
72
73
74 }