/** * Retrieve information about platforms as they appear or vanish. * @param include_initial If true, information about initially known platforms will be immediately posted to the caller. * Otherwise only changes that happen after the subscription will be posted. * @return An intermediate future that is notified about any changes. */ public ISubscriptionIntermediateFuture<DiscoveryInfo> subscribeToPlatformList(boolean include_initial) { if(listeners==null) { listeners = new LinkedHashSet<SubscriptionIntermediateDelegationFuture<DiscoveryInfo>>(); } SubscriptionIntermediateDelegationFuture<DiscoveryInfo> ret = new SubscriptionIntermediateDelegationFuture<DiscoveryInfo>(); listeners.add(ret); if(include_initial) { for(DiscoveryInfo dif: discovered.values()) { ret.addIntermediateResult(dif); } } return ret; }
/** * Retrieve information about platforms as they appear or vanish. * @param include_initial If true, information about initially known platforms will be immediately posted to the caller. * Otherwise only changes that happen after the subscription will be posted. * @return An intermediate future that is notified about any changes. */ public ISubscriptionIntermediateFuture<DiscoveryInfo> subscribeToPlatformList(boolean include_initial) { // SubscriptionIntermediateDelegationFuture<DiscoveryInfo> ret = new SubscriptionIntermediateDelegationFuture<DiscoveryInfo>(); SubscriptionIntermediateDelegationFuture<DiscoveryInfo> ret = (SubscriptionIntermediateDelegationFuture<DiscoveryInfo>)SFuture.getNoTimeoutFuture(SubscriptionIntermediateDelegationFuture.class, agent); if(listeners==null) { listeners = new LinkedHashSet<SubscriptionIntermediateDelegationFuture<DiscoveryInfo>>(); } listeners.add(ret); if(include_initial) { for(DiscoveryInfo dif: discovered.values()) { ret.addIntermediateResult(dif); } } return ret; }
ret.addIntermediateResult(f.length()); FileInputStream fis = new FileInputStream(f); ISubscriptionIntermediateFuture<Long> fut = con.writeFromInputStream(fis, agent);
ret.addIntermediateResult(f.length()); FileInputStream fis = new FileInputStream(f); ISubscriptionIntermediateFuture<Long> fut = con.writeFromInputStream(fis, agent);