/** * Create the platform. * @param config The PlatformConfiguration object. * @return The external access of the root component. */ public static IFuture<IExternalAccess> createPlatform(final PlatformConfiguration config) { return createPlatform(config, false); }
/** * Check if the external thread is accessing. * @return True, if access is ok. */ public boolean isExternalThread() { return initthread!=Thread.currentThread() && !isPlanThread() && !(IComponentDescription.STATE_TERMINATED.equals(getComponentDescription().getState()) && Starter.isRescueThread(getComponentIdentifier())); }
/** * Get the default timeout. * @return The default timeout (-1 for none). */ public long getDefaultTimeout() { return Starter.getLocalDefaultTimeout(agent.getComponentIdentifier()); // return ((INonUserAccess)agent).getPlatformData(). }
public void exceptionOccurred(Exception exception) { available = false; // Happens during platform bootstrapping -> execute on platform rescue thread. if(!bootstrap) { bootstrap = true; Starter.scheduleRescueStep(getComponent().getComponentIdentifier().getRoot(), new Runnable() { public void run() { boolean again = true; while(!available && again) { again = execute(); } bootstrap = false; if(again) { // Bootstrapping finished -> do real kickoff wakeup(); } } }); } } });
this.timeout = Starter.getLocalDefaultTimeout(null); // Initial timeout for starting platform. startTimer(); platform = Starter.createPlatform(args).get(); this.timeout = Starter.getLocalDefaultTimeout(platform.getComponentIdentifier()); long ctimeout = Starter.getLocalDefaultTimeout(platform.getComponentIdentifier()); // Start with normal timeout for platform startup/shutdown. this.timeout = Starter.getScaledLocalDefaultTimeout(platform.getComponentIdentifier(), 1 + 0.05 * scanForTestCases.size()); // Timeout for loading models. startTimer(); Logger.getLogger("ComponentTestSuite").info("Scanning for testcases: " + project[rootIndex] + " (scan timeout: " + timeout + ")");
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());
nextcall.setProperty(ServiceCall.DEFTIMEOUT, isRemoteCall()? Starter.getLocalDefaultTimeout(sid.getProviderId()) : Starter.getLocalDefaultTimeout(sid.getProviderId())); nextcall.setProperty(ServiceCall.REALTIME, Starter.isRealtimeTimeout(sid.getProviderId())? Boolean.TRUE : Boolean.FALSE);
/** * Main for starting Jadex with the alarmclock. */ public static void main(String[] args) { Starter.main(new String[]{"-gui", "false", "-component", "jadex/bdiv3/examples/alarmclock/AlarmclockBDI.class"}); } }
Object pfname = getArgumentValue(PLATFORM_NAME, model, cmdargs, compargs); String platformname = null; if(pfname==null) rid.setLocalIdentifier(new LocalResourceIdentifier(cid, lid.getUrl())); initRescueThread(cid);
final IComponentIdentifier cid = createPlatformIdentifier(pfname!=null? pfname.toString(): null); if(IComponentIdentifier.LOCAL.get()==null) IComponentIdentifier.LOCAL.set(cid); component.create(cci, features); initRescueThread(cid, rootConfig); // Required for bootstrapping init.
long delay = Starter.getScaledLocalDefaultTimeout(getProviderId(), 1.0 / 3); // hack!!! hard coded to 1/3 of default timeout t.schedule(new TimerTask()
Starter.scheduleRescueStep(adapter.getComponentIdentifier(), new Runnable()
(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());
/** * Main for starting Jadex with the alarmclock. */ public static void main(String[] args) { Starter.main(new String[]{"-gui", "false", "-component", "jadex/bdi/examples/alarmclock/Alarmclock.agent.xml"}); } }
Starter.scheduleRescueStep(adapter.getComponentIdentifier(), new Runnable()
/** * Create the platform. * @param config The PlatformConfiguration object. * @param cl ClassLoader used as root class loader. * @return The external access of the root component. */ public static IFuture<IExternalAccess> createPlatform(final PlatformConfiguration config, final ClassLoader cl) { return createPlatform(config, cl, false); }
/** * Test if current thread is the component thread. * @return True if the current thread is the component thread. */ public boolean isComponentThread() { return Thread.currentThread()==componentthread || IComponentDescription.STATE_TERMINATED.equals(getComponent().getComponentDescription().getState()) && Starter.isRescueThread(getComponent().getComponentIdentifier()); }
/** * 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; }
public void init() { // Initialize browser launcher. BrowserLauncher2.setApplet(this); // Start platform. String[] args; String pargs = getParameter("args"); if(pargs!=null) { StringTokenizer stok = new StringTokenizer(pargs); args = new String[stok.countTokens()]; for(int i=0; i<args.length; i++) args[i] = stok.nextToken(); } else { args = new String[0]; } try { Starter.main(args); } catch(Exception e) { e.printStackTrace(); } }
Starter.scheduleRescueStep(adapter.getComponentIdentifier(), new Runnable()