| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
package org.kuali.rice.ksb.messaging.resourceloader; |
| 18 |
|
|
| 19 |
|
import org.kuali.rice.core.api.config.ConfigurationException; |
| 20 |
|
import org.kuali.rice.core.api.config.property.Config; |
| 21 |
|
import org.kuali.rice.core.api.config.property.ConfigContext; |
| 22 |
|
import org.kuali.rice.core.api.resourceloader.BaseResourceLoader; |
| 23 |
|
import org.kuali.rice.core.api.resourceloader.ResourceLoader; |
| 24 |
|
import org.kuali.rice.core.api.resourceloader.BaseResourceLoader; |
| 25 |
|
import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader; |
| 26 |
|
import org.kuali.rice.core.api.resourceloader.ResourceLoader; |
| 27 |
|
import org.kuali.rice.core.impl.resourceloader.SpringResourceLoader; |
| 28 |
|
import org.kuali.rice.ksb.messaging.RemoteResourceServiceLocator; |
| 29 |
|
import org.kuali.rice.ksb.messaging.RemoteResourceServiceLocatorImpl; |
| 30 |
|
|
| 31 |
|
import javax.xml.namespace.QName; |
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
| 41 |
|
|
| 42 |
|
@author |
| 43 |
|
|
| 44 |
|
|
|
|
|
| 0% |
Uncovered Elements: 35 (35) |
Complexity: 12 |
Complexity Density: 0.6 |
|
| 45 |
|
public class KSBResourceLoaderFactory { |
| 46 |
|
|
| 47 |
|
private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger |
| 48 |
|
.getLogger(KSBResourceLoaderFactory.class); |
| 49 |
|
|
| 50 |
|
private static final String KSB_ROOT_RESOURCE_LOACER_NAME = "KSB_ROOT_RESOURCE_LOADER"; |
| 51 |
|
private static final String KSB_REMOTE_RESOURCE_LOADER_LOCAL_NAME = "KSB_REMOTE_RESOURCE_LOADER"; |
| 52 |
|
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 4 |
Complexity Density: 0.57 |
|
| 53 |
0
|
private static void initialize() {... |
| 54 |
0
|
Config config = ConfigContext.getCurrentContextConfig(); |
| 55 |
0
|
if (config.getServiceNamespace() == null) { |
| 56 |
0
|
throw new ConfigurationException("No service namespace available at this time"); |
| 57 |
|
} |
| 58 |
0
|
if (getRootResourceLoaderName() == null) { |
| 59 |
0
|
setRootResourceLoaderName(new QName(ConfigContext.getCurrentContextConfig().getServiceNamespace(), KSB_ROOT_RESOURCE_LOACER_NAME)); |
| 60 |
|
} |
| 61 |
0
|
if (getRemoteResourceLoaderName() == null) { |
| 62 |
0
|
setRemoteResourceLoaderName(new QName(ConfigContext.getCurrentContextConfig().getServiceNamespace(), KSB_REMOTE_RESOURCE_LOADER_LOCAL_NAME)); |
| 63 |
|
} |
| 64 |
|
} |
| 65 |
|
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 66 |
0
|
public static ResourceLoader createRootKSBRemoteResourceLoader() {... |
| 67 |
0
|
initialize(); |
| 68 |
0
|
ResourceLoader rootResourceLoader = new BaseResourceLoader(getRootResourceLoaderName()); |
| 69 |
0
|
rootResourceLoader.addResourceLoader(new RemoteResourceServiceLocatorImpl(getRemoteResourceLoaderName())); |
| 70 |
0
|
return rootResourceLoader; |
| 71 |
|
} |
| 72 |
|
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 73 |
0
|
public static ResourceLoader createThinClientKSBResourceLoader() {... |
| 74 |
0
|
ResourceLoader resourceLoader = new SpringResourceLoader(new QName("", "KSB_THIN_CLIENT_RESOURCE_LOADER"), "classpath:org/kuali/rice/ksb/config/KSBThinClientSpringBeans.xml", null); |
| 75 |
0
|
GlobalResourceLoader.addResourceLoader(resourceLoader); |
| 76 |
0
|
return resourceLoader; |
| 77 |
|
} |
| 78 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 79 |
0
|
public static BaseResourceLoader getRootResourceLoader() {... |
| 80 |
0
|
return (BaseResourceLoader)GlobalResourceLoader.getResourceLoader(getRootResourceLoaderName()); |
| 81 |
|
} |
| 82 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 83 |
0
|
public static RemoteResourceServiceLocator getRemoteResourceLocator() {... |
| 84 |
0
|
return (RemoteResourceServiceLocator)GlobalResourceLoader.getResourceLoader(getRemoteResourceLoaderName()); |
| 85 |
|
} |
| 86 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 87 |
0
|
public static QName getRootResourceLoaderName() {... |
| 88 |
0
|
return (QName)ConfigContext.getCurrentContextConfig().getObject(KSB_ROOT_RESOURCE_LOACER_NAME); |
| 89 |
|
} |
| 90 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 91 |
0
|
public static void setRootResourceLoaderName(QName name) {... |
| 92 |
0
|
ConfigContext.getCurrentContextConfig().putObject(KSB_ROOT_RESOURCE_LOACER_NAME, name); |
| 93 |
|
} |
| 94 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 95 |
0
|
public static QName getRemoteResourceLoaderName() {... |
| 96 |
0
|
return (QName)ConfigContext.getCurrentContextConfig().getObject(KSB_REMOTE_RESOURCE_LOADER_LOCAL_NAME); |
| 97 |
|
} |
| 98 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 99 |
0
|
public static void setRemoteResourceLoaderName(QName remoteResourceLoaderName) {... |
| 100 |
0
|
ConfigContext.getCurrentContextConfig().putObject(KSB_REMOTE_RESOURCE_LOADER_LOCAL_NAME, remoteResourceLoaderName); |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
} |