| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
package org.kuali.rice.ksb.messaging.serviceproxies; |
| 18 |
|
|
| 19 |
|
import org.kuali.rice.core.api.config.property.ConfigContext; |
| 20 |
|
import org.kuali.rice.core.api.exception.RiceRuntimeException; |
| 21 |
|
import org.kuali.rice.core.impl.resourceloader.ContextClassLoaderProxy; |
| 22 |
|
import org.kuali.rice.core.util.ClassLoaderUtils; |
| 23 |
|
import org.kuali.rice.ksb.messaging.AsynchronousCallback; |
| 24 |
|
import org.kuali.rice.ksb.messaging.MessageServiceInvoker; |
| 25 |
|
import org.kuali.rice.ksb.messaging.PersistedMessageBO; |
| 26 |
|
import org.kuali.rice.ksb.messaging.RemotedServiceHolder; |
| 27 |
|
import org.kuali.rice.ksb.util.KSBConstants; |
| 28 |
|
|
| 29 |
|
import java.io.Serializable; |
| 30 |
|
import java.lang.reflect.Proxy; |
| 31 |
|
import java.util.List; |
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
@author |
| 39 |
|
|
| 40 |
|
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 7 |
Complexity Density: 0.88 |
|
| 41 |
|
public class SynchronousServiceCallProxy extends AsynchronousServiceCallProxy { |
| 42 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 43 |
0
|
private SynchronousServiceCallProxy(List<RemotedServiceHolder> serviceDefs, AsynchronousCallback callback,... |
| 44 |
|
Serializable context, String value1, String value2) { |
| 45 |
0
|
super(serviceDefs, callback, context, value1, value2); |
| 46 |
|
} |
| 47 |
|
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 4 |
Complexity Density: 0.8 |
|
| 48 |
0
|
public static Object createInstance(List<RemotedServiceHolder> serviceDefs, AsynchronousCallback callback,... |
| 49 |
|
Serializable context, String value1, String value2) { |
| 50 |
0
|
if (serviceDefs == null || serviceDefs.isEmpty()) { |
| 51 |
0
|
throw new RuntimeException("Cannot create service proxy, no service(s) passed in."); |
| 52 |
|
} |
| 53 |
0
|
try { |
| 54 |
0
|
return Proxy.newProxyInstance(ClassLoaderUtils.getDefaultClassLoader(), ContextClassLoaderProxy |
| 55 |
|
.getInterfacesToProxy(serviceDefs.get(0).getService()), new SynchronousServiceCallProxy( |
| 56 |
|
serviceDefs, callback, context, value1, value2)); |
| 57 |
|
} catch (Exception e) { |
| 58 |
0
|
throw new RiceRuntimeException(e); |
| 59 |
|
} |
| 60 |
|
} |
| 61 |
|
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
| 62 |
0
|
@Override... |
| 63 |
|
protected void executeMessage(PersistedMessageBO message) { |
| 64 |
0
|
if (!Boolean.valueOf(ConfigContext.getCurrentContextConfig().getProperty(KSBConstants.Config.MESSAGING_OFF))) { |
| 65 |
0
|
new MessageServiceInvoker(message).run(); |
| 66 |
|
} |
| 67 |
|
} |
| 68 |
|
} |