/** * Creates an RPC call, with no error handling. * * @param callback * The remote callback that receives the return value from the call. Cannot not be null. * @param service * The remote interface. * @param <T> * The type of the remote service. * @param <R> * The return type of the invoked method. * @return A proxy for the remote service. Methods invoked on this object will communicate with the remote service * over the message bus. */ public static <R, T> T createCall(final RemoteCallback<R> callback, final Class<T> service) { return new DefaultRemoteCallBuilder(CommandMessage.create()).call(callback, service); }
@Override public void stopService() { bus.stop(); DefaultTaskManager.get().requestStop(); for (Runnable runnable : shutdownHooks) { try { runnable.run(); } catch (Throwable e) { log.error("error executing shutdown hook", e); } } bus = null; config = null; sessionProvider = null; dispatcher = null; shutdownHooks = null; DefaultRemoteCallBuilder.destroyProxyFactory(); ErraiServiceSingleton.resetProxyAndService(); }
DefaultRemoteCallBuilder.setProxyFactory(Assert.notNull(new ProxyFactory() { @Override public <T> T getRemoteProxy(Class<T> proxyType) {
/** * Creates an <tt>AbstractRemoteCallBuilder</tt> to construct a call. * * @return an instance of <tt>AbstractRemoteCallBuilder</tt> */ public static DefaultRemoteCallBuilder createCall() { return new DefaultRemoteCallBuilder(CommandMessage.create()); }
public <T, R> T call(final RemoteCallback<R> callback, final Class<T> remoteService) { return call(callback, null, remoteService); }
final String replyTo = message.getSubject() + "." + rpcMethod + ":" + (id = uniqueNumber()) + ":RespondTo:RPC"; final String errorTo = message.getSubject() + "." + rpcMethod + ":" + id + ":Errors:RPC";
DefaultRemoteCallBuilder.setProxyFactory(Assert.notNull(new ProxyFactory() { @Override public <T> T getRemoteProxy(final Class<T> proxyType) {
/** * Creates an <tt>AbstractRemoteCallBuilder</tt> to construct a call. * * @return an instance of <tt>AbstractRemoteCallBuilder</tt> */ public static DefaultRemoteCallBuilder createCall() { return new DefaultRemoteCallBuilder(CommandMessage.create()); }
public <T, R> T call(final RemoteCallback<R> callback, final Class<T> remoteService) { return call(callback, null, remoteService); }
final String replyTo = message.getSubject() + "." + rpcMethod + ":" + (id = uniqueNumber()) + ":RespondTo:RPC"; final String errorTo = message.getSubject() + "." + rpcMethod + ":" + id + ":Errors:RPC";
/** * Creates an RPC call with error handling. * * @param callback * The remote callback that receives the return value from the call. Cannot not be null. * @param errorCallback * The error callback that receives transmission errors and exceptions thrown by the remote service. Cannot not be null. * @param service * The remote interface. * @param <T> * The type of the remote service. * @param <R> * The return type of the invoked method. * @return A proxy for the remote service. Methods invoked on this object will communicate with the remote service * over the message bus. */ public static <R, T> T createCall(final RemoteCallback<R> callback, final BusErrorCallback errorCallback, final Class<T> service) { return new DefaultRemoteCallBuilder(CommandMessage.create()).call(callback, errorCallback, service); }
DefaultRemoteCallBuilder.setProxyFactory(Assert.notNull(new ProxyFactory() { @Override public <T> T getRemoteProxy(Class<T> proxyType) {
@Override public void stopService() { bus.stop(); DefaultTaskManager.get().requestStop(); for (Runnable runnable : shutdownHooks) { try { runnable.run(); } catch (Throwable e) { log.error("error executing shutdown hook", e); } } bus = null; config = null; sessionProvider = null; dispatcher = null; shutdownHooks = null; DefaultRemoteCallBuilder.destroyProxyFactory(); ErraiServiceSingleton.resetProxyAndService(); }
/** * Creates an RPC call with error handling. * * @param callback * The remote callback that receives the return value from the call. Cannot not be null. * @param errorCallback * The error callback that receives transmission errors and exceptions thrown by the remote service. Cannot not be null. * @param service * The remote interface. * @param <T> * The type of the remote service. * @param <R> * The return type of the invoked method. * @return A proxy for the remote service. Methods invoked on this object will communicate with the remote service * over the message bus. */ public static <R, T> T createCall(final RemoteCallback<R> callback, final BusErrorCallback errorCallback, final Class<T> service) { return new DefaultRemoteCallBuilder(CommandMessage.create()).call(callback, errorCallback, service); }
/** * Creates an RPC call, with no error handling. * * @param callback * The remote callback that receives the return value from the call. Cannot not be null. * @param service * The remote interface. * @param <T> * The type of the remote service. * @param <R> * The return type of the invoked method. * @return A proxy for the remote service. Methods invoked on this object will communicate with the remote service * over the message bus. */ public static <R, T> T createCall(final RemoteCallback<R> callback, final Class<T> service) { return new DefaultRemoteCallBuilder(CommandMessage.create()).call(callback, service); }