/** * Subscribe to display events. */ public ISubscriptionIntermediateFuture<Object> subscribeToDisplayUpdates(String displayid) { // SubscriptionIntermediateFuture<Object> ret = new SubscriptionIntermediateFuture<Object>(); final SubscriptionIntermediateFuture<Object> ret = (SubscriptionIntermediateFuture<Object>)SFuture.getNoTimeoutFuture(SubscriptionIntermediateFuture.class, agent.agent); subscribers.put(displayid, ret); return ret; } }
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 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 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<?> getNoTimeoutFuture(Class<T> type, IExternalAccess ea) { return getFuture(type, false, ea); }
/** * Convenience method for creating a future (possibly with timeout avoidance). * @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<?> getNoTimeoutFuture(IInternalAccess ia) { return getFuture((Class<?>)Future.class, false, ia); }
/** * A test method. */ public ITerminableFuture<Void> method2() { TerminableFuture<Void> ret = (TerminableFuture<Void>)SFuture.getNoTimeoutFuture(TerminableFuture.class, agent); // System.out.println("Called tmethod2"); 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 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); }
/** * 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; }
/** * Convenience method for creating a future (possibly with timeout avoidance). * @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(boolean timeouts, IInternalAccess ia) { return getFuture((Class<T>)Future.class, timeouts, ia); }
/** * Call a method that must use a secure * transport under the hood. */ public IFuture<Void> method1() { // final Future<Void> ret = new Future<Void>(); final Future<Void> ret = (Future<Void>)SFuture.getNoTimeoutFuture(agent); // System.out.println("Called method1"); 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 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); }
/** * Convenience method for creating a future (possibly with timeout avoidance). * @param timeouts (default is true) False, if no timeouts should be generated when service call timeout has elapsed. * @param ia The internal access. */ public static <T> Future<?> getNoTimeoutFuture(Class<T> type, IInternalAccess ia) { return getFuture(type, false, ia); }
/** * A test method. */ public IIntermediateFuture<Void> method3() { final IntermediateFuture<Void> ret = (IntermediateFuture<Void>)SFuture.getNoTimeoutFuture(IntermediateFuture.class, agent); // System.out.println("Called imethod3"); 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 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); }
/** * Convenience method for creating a future (possibly with timeout avoidance). * @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<?> getNoTimeoutFuture(IInternalAccess ia) { return getFuture((Class<?>)Future.class, false, ia); }
/** * A test method. */ public ISubscriptionIntermediateFuture<Void> method4() { final SubscriptionIntermediateFuture<Void> ret = (SubscriptionIntermediateFuture<Void>)SFuture.getNoTimeoutFuture(SubscriptionIntermediateFuture.class, agent); // System.out.println("Called smethod4"); doCall(ret); return ret; }
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 timeouts (default is true) False, if no timeouts should be generated when service call timeout has elapsed. * @param ia The internal access. */ public static <T> Future<?> getNoTimeoutFuture(Class<T> type, IInternalAccess ia) { return getFuture(type, false, ia); }
/** * Subscribe to a specific topic. New events that fit to the topic are forwarded to all replication subscribers as intermediate results. A subscribe can unsubscribe by terminating the future. * * @param topic The topic. * @return The events. */ public ISubscriptionIntermediateFuture<Event> subscribeForReplication(String topic) { final SubscriptionIntermediateFuture<Event> ret = (SubscriptionIntermediateFuture<Event>)SFuture.getNoTimeoutFuture(SubscriptionIntermediateFuture.class, agent); // SubscriptionIntermediateFuture<Event> ret = new SubscriptionIntermediateFuture<Event>(); List<SubscriptionIntermediateFuture<Event>> subs = repsubscribers.get(topic); if (subs == null) { subs = new ArrayList<SubscriptionIntermediateFuture<Event>>(); repsubscribers.put(topic, subs); } subs.add(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 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); }