public IFuture<Void> execute(IInternalAccess ia) { avoidCallTimeouts(ret, ia, to, factor, realtime); return IFuture.DONE; } });
/** * Automatically update the timer of a long running service call future. * Ensures that the caller does not timeout even if no result * value is set in that timespan. * The call periodically sends alive calls to the caller. * @param ret The future that is returned by the service call. * @param ia The component handling the service call (on that component the periodic updates are scheduled). * @param to The timeout. */ public static void avoidCallTimeouts(final Future<?> ret, IInternalAccess ia, long to, boolean realtime) { avoidCallTimeouts(ret, ia, to, 0.8, realtime); }
/** * Automatically update the timer of a long running service call future. * Ensures that the caller does not timeout even if no result * value is set in that timespan. * The call periodically sends alive calls to the caller. * @param ret The future that is returned by the service call. * @param ea The component handling the service call (on that component the periodic updates are scheduled). * @param to The timeout. */ public static void avoidCallTimeouts(final Future<?> ret, IExternalAccess ea, long to, boolean realtime) { avoidCallTimeouts(ret, ea, to, 0.8, realtime); }
/** * Automatically update the timer of a long running service call future. * Ensures that the caller does not timeout even if no result * value is set in that timespan. * The call periodically sends alive calls to the caller. * @param ret The future that is returned by the service call. * @param ia The component handling the service call (on that component the periodic updates are scheduled). * @param to The timeout. */ public static void avoidCallTimeouts(final Future<?> ret, IInternalAccess ia, long to, boolean realtime) { avoidCallTimeouts(ret, ia, to, 0.8, realtime); }
/** * Automatically update the timer of a long running service call future. * Ensures that the caller does not timeout even if no result * value is set in that timespan. * The call periodically sends alive calls to the caller. * @param ret The future that is returned by the service call. * @param ea The component handling the service call (on that component the periodic updates are scheduled). * @param to The timeout. */ public static void avoidCallTimeouts(final Future<?> ret, IExternalAccess ea, long to, boolean realtime) { avoidCallTimeouts(ret, ea, to, 0.8, realtime); }
public IFuture<Void> execute(IInternalAccess ia) { avoidCallTimeouts(ret, ia, to, factor, realtime); return IFuture.DONE; } });
/** * Convenience method for creating a future (possibly with timeout avoidance). * @param type The future implementation type. * @param timeouts (default is true) False, if no timeouts should be generated when service call timeout has elapsed. * @param ea The external access. */ public static <T> Future<?> getFuture(Class<T> type, boolean timeouts, IExternalAccess ea) { try { Future<?> ret = (Future<?>)type.newInstance(); if(!timeouts) avoidCallTimeouts(ret, ea); return ret; } catch(Exception e) { throw new RuntimeException(e); } } }
/** * Convenience method for creating a future (possibly with timeout avoidance). * @param type The future implementation type. * @param timeouts (default is true) False, if no timeouts should be generated when service call timeout has elapsed. * @param ia The external access. */ public static <T> Future<?> getFuture(Class<T> type, boolean timeouts, IInternalAccess ia) { try { Future<?> ret = (Future<?>)type.newInstance(); if(!timeouts) avoidCallTimeouts(ret, ia); return ret; } catch(Exception e) { throw new RuntimeException(e); } }
/** * Convenience method for creating a future (possibly with timeout avoidance). * @param type The future implementation type. * @param timeouts (default is true) False, if no timeouts should be generated when service call timeout has elapsed. * @param ia The external access. */ public static <T> Future<?> getFuture(Class<T> type, boolean timeouts, IInternalAccess ia) { Future<?> ret = getFuture(type); if(!timeouts) avoidCallTimeouts(ret, ia); return ret; }
/** * Convenience method for creating a future (possibly with timeout avoidance). * @param type The future implementation type. * @param timeouts (default is true) False, if no timeouts should be generated when service call timeout has elapsed. * @param ea The external access. */ public static <T> Future<?> getFuture(Class<T> type, boolean timeouts, IExternalAccess ea) { Future<?> ret = getFuture(type); if(!timeouts) avoidCallTimeouts(ret, ea); return ret; }
/** * A test method. */ public IPullIntermediateFuture<Void> method5() { final PullIntermediateFuture<Void> ret = new PullIntermediateFuture<Void>((ICommand<PullIntermediateFuture<Void>>)null); SFuture.avoidCallTimeouts(ret, agent); // System.out.println("Called pmethod5"); doCall(ret); return ret; }
/** * A test method. */ public IPullSubscriptionIntermediateFuture<Void> method6() { final PullSubscriptionIntermediateFuture<Void> ret = new PullSubscriptionIntermediateFuture<Void>((ICommand<PullSubscriptionIntermediateFuture<Void>>)null); SFuture.avoidCallTimeouts(ret, agent); // System.out.println("Called psmethod6"); doCall(ret); return ret; }
/** * Automatically update the timer of a long running service call future. * Ensures that the caller does not timeout even if no result * value is set in that time span. * The call periodically sends alive calls to the caller. * @param ret The future that is returned by the service call. * @param ia The component handling the service call (on that component the periodic updates are scheduled). */ public static void avoidCallTimeouts(final Future<?> ret, IInternalAccess ia) { ServiceCall sc = ServiceCall.getCurrentInvocation(); long to = sc!=null? sc.getTimeout(): BasicService.getLocalDefaultTimeout(); // Hack!!! find out in which cases service call can null boolean realtime = sc!=null ? sc.getRealtime()!=null ? sc.getRealtime().booleanValue() : false : false; // boolean local = sc.getCaller().getPlatformName().equals(agent.getComponentIdentifier().getPlatformName()); // long to = sc.getTimeout()>0? sc.getTimeout(): (local? BasicService.DEFAULT_LOCAL: BasicService.DEFAULT_REMOTE); // to = 5000; avoidCallTimeouts(ret, ia, to, realtime); }
/** * Automatically update the timer of a long running service call future. * Ensures that the caller does not timeout even if no result * value is set in that timespan. * The call periodically sends alive calls to the caller. * @param ret The future that is returned by the service call. * @param ea The component handling the service call (on that component the periodic updates are scheduled). */ public static void avoidCallTimeouts(final Future<?> ret, IExternalAccess ea) { ServiceCall sc = ServiceCall.getCurrentInvocation(); long to = sc!=null? sc.getTimeout(): BasicService.getLocalDefaultTimeout(); // Hack!!! find out in which cases service call can null boolean realtime = sc!=null ? sc.getRealtime()!=null ? sc.getRealtime().booleanValue() : false : false; // boolean local = sc.getCaller().getPlatformName().equals(agent.getComponentIdentifier().getPlatformName()); // long to = sc.getTimeout()>0? sc.getTimeout(): (local? BasicService.DEFAULT_LOCAL: BasicService.DEFAULT_REMOTE); // to = 5000; avoidCallTimeouts(ret, ea, to, realtime); }
/** * Automatically update the timer of a long running service call future. * Ensures that the caller does not timeout even if no result * value is set in that time span. * The call periodically sends alive calls to the caller. * @param ret The future that is returned by the service call. * @param ia The component handling the service call (on that component the periodic updates are scheduled). */ public static void avoidCallTimeouts(final Future<?> ret, IInternalAccess ia) { ServiceCall sc = ServiceCall.getCurrentInvocation(); long to = sc!=null? sc.getTimeout(): Starter.getLocalDefaultTimeout(ia.getComponentIdentifier()); // Hack!!! find out in which cases service call can null boolean realtime = sc!=null ? sc.getRealtime()!=null ? sc.getRealtime().booleanValue() : false : false; // boolean local = sc.getCaller().getPlatformName().equals(agent.getComponentIdentifier().getPlatformName()); // long to = sc.getTimeout()>0? sc.getTimeout(): (local? BasicService.DEFAULT_LOCAL: BasicService.DEFAULT_REMOTE); // to = 5000; avoidCallTimeouts(ret, ia, to, realtime); }
/** * Automatically update the timer of a long running service call future. * Ensures that the caller does not timeout even if no result * value is set in that timespan. * The call periodically sends alive calls to the caller. * @param ret The future that is returned by the service call. * @param ea The component handling the service call (on that component the periodic updates are scheduled). */ public static void avoidCallTimeouts(final Future<?> ret, IExternalAccess ea) { ServiceCall sc = ServiceCall.getCurrentInvocation(); long to = sc!=null? sc.getTimeout(): Starter.getLocalDefaultTimeout(ea.getComponentIdentifier()); // Hack!!! find out in which cases service call can null boolean realtime = sc!=null ? sc.getRealtime()!=null ? sc.getRealtime().booleanValue() : false : false; // boolean local = sc.getCaller().getPlatformName().equals(agent.getComponentIdentifier().getPlatformName()); // long to = sc.getTimeout()>0? sc.getTimeout(): (local? BasicService.DEFAULT_LOCAL: BasicService.DEFAULT_REMOTE); // to = 5000; avoidCallTimeouts(ret, ea, to, realtime); }
SFuture.avoidCallTimeouts(ret, agent);