/** * Get the empty future of some type. * @return The empty future. */ public static <T> IFuture<T> getEmptyFuture() { return new Future<T>((T)null); }
/** * Get the user name. */ public IFuture<String> getNickName() { return new Future<String>(nick); }
/** * Check if password protection is enabled. * @return True, if password protection is enabled. */ public IFuture<Boolean> isUsePassword() { return new Future<Boolean>(usepass); }
/** * Get the trusted lan mode. * @return True if is in trusted lan mode. */ public IFuture<Boolean> isTrustedLanMode() { return new Future<Boolean>(trustedlan? Boolean.TRUE: Boolean.FALSE); }
/** * Test if context is executing. */ public IFuture<Boolean> isExecuting() { return new Future<Boolean>(executing ? Boolean.TRUE : Boolean.FALSE); }
/** * Remove content codec type. * @param codec The codec type. */ public IFuture<Void> removeContentCodec(IContentCodec codec) { if(contentcodecs!=null) contentcodecs.remove(codec); return new Future(null); }
/** * Get the component identifiers of all (managed) platforms. * * @return Collection of platform ids. */ public IFuture<Set<IComponentIdentifier>> getPlatforms() { return new Future<Set<IComponentIdentifier>>(platforms.keySet()); }
/** * Decides if the search should start ranking. */ public Future<Boolean> isStartRanking(Collection<S> currentresults, IServiceEvaluator evaluator) { return new Future<Boolean>(currentresults.size() >= threshold); } }
public IFuture<Void> execute(Void args) { return new Future<Void>(new RuntimeException("Send failed")); } };
/** * Returns the names of all non-functional properties of this service. * @return The names of the non-functional properties of this service. */ public IFuture<String[]> getNFPropertyNames() { return new Future<String[]>(nfproperties != null? nfproperties.keySet().toArray(new String[nfproperties.size()]) : new String[0]); }
/** * Get the value. */ public IFuture<T> getValue(U unit) { T ret = value; if(unit instanceof IConvertableUnit) ret = ((IConvertableUnit<T>)unit).convert(ret); return new Future<T>(ret); }
/** * Add message codec type. * @param codec The codec type. */ public IFuture<Void> addMessageCodec(Class codec) { codecfactory.addCodec(codec); return new Future(null); }
/** * Get the root identifier (platform). * @return The root identifier. */ public IFuture<IComponentIdentifier> getRootIdentifier() { return new Future<IComponentIdentifier>(root.getComponentIdentifier()); }
/** * Get other contained (but not directly managed) urls from parent classloaders. * @return The list of urls. */ public IFuture<List<URL>> getNonManagedURLs() { return new Future<List<URL>>(new ArrayList<URL>(getInternalNonManagedURLs())); }
/** * Get the local password. * @return The password of the local platform (if any). */ @SecureTransmission // Todo: password is transferred in plain text unless transport uses encryption. public IFuture<String> getLocalPassword() { return new Future<String>(password); }
/** * Test if service is a proxy. */ public IFuture<Boolean> filter(Object obj) { return new Future<Boolean>(obj instanceof IService && ((IService)obj).getServiceIdentifier().equals(sid)); }
@Classname("getDiscoveryInfos") public IFuture<DiscoveryInfo[]> execute(IInternalAccess ia) { AwarenessManagementAgent agent = (AwarenessManagementAgent) ia; return new Future<DiscoveryInfo[]>(agent.getDiscoveryInfos()); } });
/** * Create a send info. */ public DataSendInfo(StreamSendTask task) { this.task = task; this.fut = new Future<Void>(); this.tries = 1; timer = createBulkAckTimer(task.getSequenceNumber()); lastsend = OutputConnectionHandler.this.getSequenceNumber(); }
/** * Execute the interceptor. * @param context The invocation context. */ public IFuture<Void> execute(ServiceInvocationContext sic) { // INFMixedPropertyProvider res = component.getRequiredServicePropertyProvider((IServiceIdentifier)sic.getArgumentArray()[0]); INFMixedPropertyProvider res = getComponent().getServiceContainer().getRequiredServicePropertyProvider(sid); sic.setResult(new Future<INFMixedPropertyProvider>(res)); return IFuture.DONE; } }
public void pullIntermediateResult() { Future<Object> res = new Future<Object>(); final String mycallid = SUtil.createUniqueId(compid.getLocalName()+"."+method.toString()); RemoteFuturePullCommand content = new RemoteFuturePullCommand(mycallid, callid); // Can be invoked directly, because internally redirects to agent thread. // System.out.println("sending terminate"); rsms.sendMessage(pr.getRemoteReference().getRemoteManagementServiceIdentifier(), null, content, mycallid, to, res, nonfunc, sic); }