| 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.List; |
| 19 | |
|
| 20 | |
import javax.persistence.EntityManagerFactory; |
| 21 | |
import javax.sql.DataSource; |
| 22 | |
|
| 23 | |
import org.apache.cxf.Bus; |
| 24 | |
import org.apache.cxf.bus.CXFBusImpl; |
| 25 | |
import org.apache.cxf.endpoint.ServerRegistry; |
| 26 | |
import org.apache.cxf.interceptor.Interceptor; |
| 27 | |
import org.apache.cxf.message.Message; |
| 28 | |
import org.apache.cxf.transport.servlet.ServletTransportFactory; |
| 29 | |
import org.kuali.rice.core.api.exception.RiceRemoteServiceConnectionException; |
| 30 | |
import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader; |
| 31 | |
import org.kuali.rice.ksb.messaging.MessageHelper; |
| 32 | |
import org.kuali.rice.ksb.messaging.RemotedServiceRegistry; |
| 33 | |
import org.kuali.rice.ksb.messaging.bam.service.BAMService; |
| 34 | |
import org.kuali.rice.ksb.messaging.exceptionhandling.ExceptionRoutingService; |
| 35 | |
import org.kuali.rice.ksb.messaging.service.BusAdminService; |
| 36 | |
import org.kuali.rice.ksb.messaging.service.MessageQueueService; |
| 37 | |
import org.kuali.rice.ksb.messaging.service.ServiceRegistry; |
| 38 | |
import org.kuali.rice.ksb.messaging.threadpool.KSBScheduledPool; |
| 39 | |
import org.kuali.rice.ksb.messaging.threadpool.KSBThreadPool; |
| 40 | |
import org.kuali.rice.ksb.security.admin.service.JavaSecurityManagementService; |
| 41 | |
import org.kuali.rice.ksb.security.service.DigitalSignatureService; |
| 42 | |
import org.kuali.rice.ksb.util.KSBConstants; |
| 43 | |
import org.quartz.Scheduler; |
| 44 | |
import org.springframework.transaction.PlatformTransactionManager; |
| 45 | |
import org.springframework.transaction.support.TransactionTemplate; |
| 46 | |
|
| 47 | |
|
| 48 | 0 | public class KSBServiceLocator { |
| 49 | |
public static Object getService(String name) { |
| 50 | 0 | return GlobalResourceLoader.getService(name); |
| 51 | |
} |
| 52 | |
|
| 53 | |
public static EntityManagerFactory getMessageEntityManagerFactory() { |
| 54 | 0 | return (EntityManagerFactory) getService(KSBConstants.ServiceNames.MESSAGE_ENTITY_MANAGER_FACTORY); |
| 55 | |
} |
| 56 | |
|
| 57 | |
public static EntityManagerFactory getRegistryEntityManagerFactory() { |
| 58 | 0 | return (EntityManagerFactory) getService(KSBConstants.ServiceNames.REGISTRY_ENTITY_MANAGER_FACTORY); |
| 59 | |
} |
| 60 | |
|
| 61 | |
public static TransactionTemplate getTransactionTemplate() { |
| 62 | 0 | return (TransactionTemplate) getService(KSBConstants.ServiceNames.TRANSACTION_TEMPLATE); |
| 63 | |
} |
| 64 | |
|
| 65 | |
public static PlatformTransactionManager getPlatformTransactionManager() { |
| 66 | 0 | return (PlatformTransactionManager) getService(KSBConstants.ServiceNames.TRANSACTION_MANAGER); |
| 67 | |
} |
| 68 | |
|
| 69 | |
public static BAMService getBAMService() { |
| 70 | 0 | return (BAMService) getService(KSBConstants.ServiceNames.BAM_SERVICE); |
| 71 | |
} |
| 72 | |
|
| 73 | |
public static MessageHelper getMessageHelper() { |
| 74 | 0 | return (MessageHelper) getService(KSBConstants.ServiceNames.MESSAGE_HELPER); |
| 75 | |
} |
| 76 | |
|
| 77 | |
public static MessageQueueService getRouteQueueService() { |
| 78 | 0 | return (MessageQueueService) getService(KSBConstants.ServiceNames.ROUTE_QUEUE_SERVICE); |
| 79 | |
} |
| 80 | |
|
| 81 | |
public static ExceptionRoutingService getExceptionRoutingService() { |
| 82 | 0 | return (ExceptionRoutingService) getService(KSBConstants.ServiceNames.EXCEPTION_MESSAGING_SERVICE); |
| 83 | |
} |
| 84 | |
|
| 85 | |
public static RemotedServiceRegistry getServiceDeployer() { |
| 86 | 0 | return (RemotedServiceRegistry) getService(KSBConstants.ServiceNames.REMOTED_SERVICE_REGISTRY); |
| 87 | |
} |
| 88 | |
|
| 89 | |
public static DigitalSignatureService getDigitalSignatureService() { |
| 90 | 0 | return (DigitalSignatureService) getService(KSBConstants.ServiceNames.DIGITAL_SIGNATURE_SERVICE); |
| 91 | |
} |
| 92 | |
|
| 93 | |
public static JavaSecurityManagementService getJavaSecurityManagementService() { |
| 94 | 0 | return (JavaSecurityManagementService) getService(KSBConstants.ServiceNames.JAVA_SECURITY_MANAGEMENT_SERVICE); |
| 95 | |
} |
| 96 | |
|
| 97 | |
public static KSBThreadPool getThreadPool() { |
| 98 | 0 | return (KSBThreadPool) getService(KSBConstants.ServiceNames.THREAD_POOL_SERVICE); |
| 99 | |
} |
| 100 | |
|
| 101 | |
public static KSBScheduledPool getScheduledPool() { |
| 102 | 0 | return (KSBScheduledPool) getService(KSBConstants.ServiceNames.SCHEDULED_THREAD_POOL_SERVICE); |
| 103 | |
} |
| 104 | |
|
| 105 | |
public static ServiceRegistry getServiceRegistry() { |
| 106 | 0 | return (ServiceRegistry) getService(KSBConstants.ServiceNames.SERVICE_REGISTRY); |
| 107 | |
} |
| 108 | |
|
| 109 | |
public static Bus getCXFBus(){ |
| 110 | 0 | return (CXFBusImpl) getService(KSBConstants.ServiceNames.CXF_BUS); |
| 111 | |
} |
| 112 | |
|
| 113 | |
public static ServletTransportFactory getCXFServletTransportFactory(){ |
| 114 | 0 | return (ServletTransportFactory)getService(KSBConstants.ServiceNames.CXF_SERVLET_TRANSPORT_FACTORY); |
| 115 | |
} |
| 116 | |
|
| 117 | |
public static ServerRegistry getCXFServerRegistry(){ |
| 118 | 0 | return (ServerRegistry)getService(KSBConstants.ServiceNames.CXF_SERVER_REGISTRY); |
| 119 | |
} |
| 120 | |
|
| 121 | |
public static List<Interceptor<? extends Message>> getInInterceptors() { |
| 122 | |
try { |
| 123 | 0 | return (List<Interceptor<? extends Message>>) getService(KSBConstants.ServiceNames.BUS_IN_INTERCEPTORS); |
| 124 | |
} |
| 125 | 0 | catch(RiceRemoteServiceConnectionException ex) { |
| 126 | |
|
| 127 | 0 | return null; |
| 128 | |
} |
| 129 | |
} |
| 130 | |
|
| 131 | |
public static List<Interceptor<? extends Message>> getOutInterceptors() { |
| 132 | |
try { |
| 133 | 0 | return (List<Interceptor<? extends Message>>) getService(KSBConstants.ServiceNames.BUS_OUT_INTERCEPTORS); |
| 134 | |
} |
| 135 | 0 | catch(RiceRemoteServiceConnectionException ex) { |
| 136 | |
|
| 137 | 0 | return null; |
| 138 | |
} |
| 139 | |
} |
| 140 | |
|
| 141 | |
public static DataSource getMessageDataSource() { |
| 142 | 0 | return (DataSource) getService(KSBConstants.ServiceNames.MESSAGE_DATASOURCE); |
| 143 | |
} |
| 144 | |
|
| 145 | |
public static DataSource getMessageNonTransactionalDataSource() { |
| 146 | 0 | return (DataSource) getService(KSBConstants.ServiceNames.MESSAGE_NON_TRANSACTIONAL_DATASOURCE); |
| 147 | |
} |
| 148 | |
|
| 149 | |
public static DataSource getRegistryDataSource() { |
| 150 | 0 | return (DataSource) getService(KSBConstants.ServiceNames.REGISTRY_DATASOURCE); |
| 151 | |
} |
| 152 | |
|
| 153 | |
public static Scheduler getScheduler() { |
| 154 | 0 | return (Scheduler) getService(KSBConstants.ServiceNames.SCHEDULER); |
| 155 | |
} |
| 156 | |
|
| 157 | |
public static BusAdminService getService() { |
| 158 | 0 | return (BusAdminService) getService(KSBConstants.ServiceNames.BUS_ADMIN_SERVICE); |
| 159 | |
} |
| 160 | |
|
| 161 | |
} |