001: /*
002: * Copyright 2007 The Kuali Foundation
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.bus.services;
017:
018: import javax.sql.DataSource;
019: import javax.transaction.TransactionManager;
020: import javax.transaction.UserTransaction;
021:
022: import org.codehaus.xfire.XFire;
023: import org.codehaus.xfire.service.ServiceFactory;
024: import org.kuali.rice.resourceloader.GlobalResourceLoader;
025: import org.quartz.Scheduler;
026: import org.springframework.transaction.jta.JtaTransactionManager;
027: import org.springframework.transaction.support.TransactionTemplate;
028:
029: import edu.iu.uis.eden.messaging.BusAdminService;
030: import edu.iu.uis.eden.messaging.MessageHelper;
031: import edu.iu.uis.eden.messaging.MessageQueueService;
032: import edu.iu.uis.eden.messaging.RemotedServiceRegistry;
033: import edu.iu.uis.eden.messaging.ServiceRegistry;
034: import edu.iu.uis.eden.messaging.bam.BAMService;
035: import edu.iu.uis.eden.messaging.exceptionhandling.ExceptionRoutingService;
036: import edu.iu.uis.eden.messaging.threadpool.KSBScheduledPool;
037: import edu.iu.uis.eden.messaging.threadpool.KSBThreadPool;
038: import edu.iu.uis.eden.security.DigitalSignatureService;
039: import edu.iu.uis.eden.security.EncryptionService;
040: import edu.iu.uis.eden.util.OptimisticLockFailureService;
041:
042: public class KSBServiceLocator {
043:
044: public static final String OBJECT_REMOTER = "ObjectRemoterService";
045: public static final String SERVICE_REMOVER_SERVICE = "RemoteClassRemoverService";
046: public static final String THREAD_POOL_SERVICE = "enThreadPool";
047: public static final String REMOTED_SERVICE_REGISTRY = "enServiceInvoker";
048: public static final String REPEAT_TOPIC_INVOKING_QUEUE = "enRepeatTopicInvokerQueue";
049: public static final String ENCRYPTION_SERVICE = "enEncryptionService";
050: public static final String DIGITAL_SIGNATURE_SERVICE = "digitalSignatureService";
051: public static final String CACHE_ADMINISTRATOR_FACTORY = "enKEWCacheAdministratorFactoryService";
052: public static final String JTA_TRANSACTION_MANAGER = "jtaTransactionManager";
053: public static final String SCHEDULED_THREAD_POOL_SERVICE = "enScheduledThreadPool";
054: public static final String BUS_ADMIN_SERVICE = "busAdminService";
055:
056: public static Object getService(String name) {
057: return GlobalResourceLoader.getService(name);
058: }
059:
060: public static UserTransaction getUserTransaction() {
061: return (UserTransaction) getService("userTransaction");
062: }
063:
064: public static JtaTransactionManager getTransactionManager() {
065: return (JtaTransactionManager) getService("transactionManager");
066: }
067:
068: public static TransactionManager getJtaTransactionManager() {
069: return (TransactionManager) getService(JTA_TRANSACTION_MANAGER);
070: }
071:
072: public static TransactionTemplate getTransactionTemplate() {
073: return (TransactionTemplate) getService("transactionTemplate");
074: }
075:
076: public static BAMService getBAMService() {
077: return (BAMService) getService("bamService");
078: }
079:
080: public static MessageHelper getMessageHelper() {
081: return (MessageHelper) getService("enMessageHelper");
082: }
083:
084: public static MessageQueueService getRouteQueueService() {
085: return (MessageQueueService) getService("enRouteQueueService");
086: }
087:
088: public static ExceptionRoutingService getExceptionRoutingService() {
089: return (ExceptionRoutingService) getService("exceptionMessagingService");
090: }
091:
092: public static RemotedServiceRegistry getServiceDeployer() {
093: return (RemotedServiceRegistry) getService(REMOTED_SERVICE_REGISTRY);
094: }
095:
096: public static EncryptionService getEncryptionService() {
097: return (EncryptionService) getService(ENCRYPTION_SERVICE);
098: }
099:
100: public static DigitalSignatureService getDigitalSignatureService() {
101: return (DigitalSignatureService) getService(DIGITAL_SIGNATURE_SERVICE);
102: }
103:
104: public static KSBThreadPool getThreadPool() {
105: return (KSBThreadPool) getService(THREAD_POOL_SERVICE);
106: }
107:
108: public static KSBScheduledPool getScheduledPool() {
109: return (KSBScheduledPool) getService(SCHEDULED_THREAD_POOL_SERVICE);
110: }
111:
112: public static ServiceRegistry getIPTableService() {
113: return (ServiceRegistry) getService("enRoutingTableService");
114: }
115:
116: public static OptimisticLockFailureService getOptimisticLockFailureService() {
117: return (OptimisticLockFailureService) getService("enOptimisticLockFailureService");
118: }
119:
120: public static ServiceFactory getXFireServiceFactory() {
121: return (ServiceFactory) getService("xfire.serviceFactory");
122: }
123:
124: public static XFire getXFire() {
125: return (XFire) getService("xfire");
126: }
127:
128: public static DataSource getMessageDataSource() {
129: return (DataSource) getService("ksbMessageDataSource");
130: }
131:
132: public static DataSource getRegistryDataSource() {
133: return (DataSource) getService("ksbRegistryDataSource");
134: }
135:
136: public static Scheduler getScheduler() {
137: return (Scheduler) getService("ksbScheduler");
138: }
139:
140: public static BusAdminService getService() {
141: return (BusAdminService) getService(BUS_ADMIN_SERVICE);
142: }
143:
144: }
|