本文整理汇总了Java中org.kuali.rice.ksb.api.messaging.AsynchronousCallback类的典型用法代码示例。如果您正苦于以下问题:Java AsynchronousCallback类的具体用法?Java AsynchronousCallback怎么用?Java AsynchronousCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AsynchronousCallback类属于org.kuali.rice.ksb.api.messaging包,在下文中一共展示了AsynchronousCallback类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: notifyOnCallback
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
protected void notifyOnCallback(AsynchronousCall methodCall, AsynchronousCallback callback, Object callResult) {
if (callback != null) {
try {
synchronized (callback) {
if (LOG.isDebugEnabled()) {
LOG.debug("Notifying callback " + callback + " with callResult " + callResult);
}
callback.notifyAll();
if (callResult instanceof Serializable || callResult == null) {
callback.callback((Serializable) callResult, methodCall);
} else {
// may never happen
LOG.warn("Attempted to call callback with non-serializable object.");
}
}
} catch (Throwable t) {
LOG.error("Caught throwable from callback object " + callback.getClass(), t);
}
}
}
示例2: notifyGlobalCallbacks
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
protected void notifyGlobalCallbacks(AsynchronousCall methodCall, Object callResult) {
if (LOG.isDebugEnabled()) {
LOG.debug("Notifying global callbacks");
}
for (AsynchronousCallback globalCallBack : GlobalCallbackRegistry.getCallbacks()) {
notifyOnCallback(methodCall, globalCallBack, callResult);
}
}
示例3: createInstance
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
public static Object createInstance(List<Endpoint> endpoints, AsynchronousCallback callback,
Serializable context, String value1, String value2) {
if (endpoints == null || endpoints.isEmpty()) {
throw new RuntimeException("Cannot create service proxy, no service(s) passed in.");
}
try {
return Proxy.newProxyInstance(ClassLoaderUtils.getDefaultClassLoader(), ContextClassLoaderProxy
.getInterfacesToProxy(endpoints.get(0).getService()), new SynchronousServiceCallProxy(
endpoints, callback, context, value1, value2));
} catch (Exception e) {
throw new RiceRuntimeException(e);
}
}
示例4: AsynchronousServiceCallProxy
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
protected AsynchronousServiceCallProxy(List<Endpoint> endpoints, AsynchronousCallback callback,
Serializable context, String value1, String value2) {
this.endpoints = endpoints;
this.callback = callback;
this.context = context;
this.value1 = value1;
this.value2 = value2;
}
示例5: createInstance
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
public static Object createInstance(List<Endpoint> endpoints, AsynchronousCallback callback, Serializable context,
String value1, String value2) {
if (endpoints == null || endpoints.isEmpty()) {
throw new RuntimeException("Cannot create service proxy, no service(s) passed in.");
}
try {
return Proxy.newProxyInstance(ClassLoaderUtils.getDefaultClassLoader(),
ContextClassLoaderProxy.getInterfacesToProxy(endpoints.get(0).getService()),
new AsynchronousServiceCallProxy(endpoints, callback, context, value1, value2));
} catch (Exception e) {
throw new RiceRuntimeException(e);
}
}
示例6: getServiceAsynchronously
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
@Override
public <T> T getServiceAsynchronously(QName qname, String applicationId, AsynchronousCallback callback,
Serializable context, String value1, String value2) {
List<Endpoint> endpoints = KsbApiServiceLocator.getServiceBus().getEndpoints(qname);
endpoints = filterEndpointsByApplicationId(endpoints, applicationId);
if (endpoints.isEmpty()) {
throw new RuntimeException("Cannot create service proxy, failed to locate any endpoints with the given service name: " + qname + (applicationId != null ? ", and application id: " + applicationId : ""));
}
return (T) createProxy(syncMode(), endpoints, callback, context, value1, value2);
}
示例7: getCallbacks
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
public static List<AsynchronousCallback> getCallbacks() {
return callbacks;
}
示例8: setCallbacks
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
public static void setCallbacks(List<AsynchronousCallback> callbacks) {
GlobalCallbackRegistry.callbacks = callbacks;
}
示例9: SynchronousServiceCallProxy
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
private SynchronousServiceCallProxy(List<Endpoint> endpoints, AsynchronousCallback callback,
Serializable context, String value1, String value2) {
super(endpoints, callback, context, value1, value2);
}
示例10: getCallback
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
public AsynchronousCallback getCallback() {
return this.callback;
}
示例11: setCallback
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
public void setCallback(AsynchronousCallback callback) {
this.callback = callback;
}
示例12: getCallback
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
public AsynchronousCallback getCallback() {
return this.callback;
}
示例13: setCallback
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
public void setCallback(AsynchronousCallback callback) {
this.callback = callback;
}
示例14: createProxy
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback; //导入依赖的package包/类
public static <T> T createProxy(boolean sync, List<Endpoint> endpoints, AsynchronousCallback callback, Serializable context, String value1, String value2) {
return sync ? (T) SynchronousServiceCallProxy.createInstance(endpoints, callback, context, value1, value2)
: (T) AsynchronousServiceCallProxy.createInstance(endpoints, callback, context, value1, value2);
}