/** * Get the default timeout. * @return The default timeout (-1 for none). */ public long getDefaultTimeout() { return Starter.getLocalDefaultTimeout(agent.getComponentIdentifier()); // return ((INonUserAccess)agent).getPlatformData(). }
/** * Create a component test. */ public ComponentTest(IComponentManagementService cms, IModelInfo comp, IAbortableTestSuite suite) { this.cms = cms; this.filename = comp.getFilename(); this.rid = comp.getResourceIdentifier(); this.fullname = comp.getFullName(); this.type = comp.getType(); Object to = comp.getProperty(Testcase.PROPERTY_TEST_TIMEOUT, getClass().getClassLoader()); if(to!=null) { this.timeout = ((Number)to).longValue(); } else { this.timeout = Starter.getLocalDefaultTimeout(((IService)cms).getServiceIdentifier().getProviderId()); } this.suite = suite; }
/** * 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); }
/** * 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); }
String name = fname.indexOf(".")!=-1? fname.substring(0, fname.lastIndexOf(".")-1): fname; final TransferInfo fi = new TransferInfo(false, null, name, filepath, cid, size, System.currentTimeMillis() + // Hack!!! assume real time timeout. (cid.getRoot().equals(agent.getComponentIdentifier().getRoot()) ? Starter.getLocalDefaultTimeout(agent.getComponentIdentifier()) : Starter.getRemoteDefaultTimeout(agent.getComponentIdentifier()))); // Todo: actual timeout of method!? fi.setState(TransferInfo.STATE_WAITING); ITerminableFuture<IOutputConnection> fut = cs.startUpload(nick, name, size, fi.getId());
waitForRealtimeDelay(Starter.getLocalDefaultTimeout(agent.getComponentIdentifier()), new IComponentStep<Void>()
(cid.getRoot().equals(agent.getComponentIdentifier().getRoot()) ? Starter.getLocalDefaultTimeout(agent.getComponentIdentifier()) : Starter.getRemoteDefaultTimeout(agent.getComponentIdentifier()))); // Todo: actual timeout of method!? fi.setState(TransferInfo.STATE_WAITING); ITerminableFuture<IOutputConnection> fut = cs.startUpload(nick, file.getName(), size, fi.getId());
nextcall.setProperty(ServiceCall.DEFTIMEOUT, isRemoteCall()? Starter.getLocalDefaultTimeout(sid.getProviderId()) : Starter.getLocalDefaultTimeout(sid.getProviderId()));
ret = ((IFuture<?>)ret).get(Starter.getLocalDefaultTimeout(null)); // todo: how to get platform context? System.out.println("call finished: "+targetmethod.getName()+" paramtypes: "+SUtil.arrayToString(targetmethod.getParameterTypes())+" on "+service+" "+Arrays.toString(targetparams));
getComponentFeature(IExecutionFeature.class).waitForDelay(timeout!=null ? timeout.longValue() : Starter.getLocalDefaultTimeout(getComponentIdentifier()), true) .addResultListener(new IResultListener<Void>()
this.timeout = Starter.getLocalDefaultTimeout(null); // Initial timeout for starting platform. startTimer(); this.timeout = Starter.getLocalDefaultTimeout(platform.getComponentIdentifier()); long ctimeout = Starter.getLocalDefaultTimeout(platform.getComponentIdentifier()); // Start with normal timeout for platform startup/shutdown.
? sic.getNextServiceCall()!=null ? sic.getNextServiceCall().getTimeout() : Starter.getLocalDefaultTimeout(ea.getComponentIdentifier()) : Timeout.NONE;