PluginStarter: If there is some delay, there may be a really good reason for it.
Loading a class would be one of them! So we do a quick check first, If it bombs out, we delay and try again. If it bombs after that, then we throw the ClassNotFoundException.
This commit is contained in:
@ -447,12 +447,32 @@ public class PluginStarter implements Runnable {
|
|||||||
// run this guy now
|
// run this guy now
|
||||||
LoadClientAppsJob.runClient(app.className, app.clientName, argVal, log, pluginThreadGroup, cl);
|
LoadClientAppsJob.runClient(app.className, app.clientName, argVal, log, pluginThreadGroup, cl);
|
||||||
} else {
|
} else {
|
||||||
// quick check, will throw ClassNotFoundException on error
|
// If there is some delay, there may be a really good reason for it.
|
||||||
LoadClientAppsJob.testClient(app.className, cl);
|
// Loading a class would be one of them!
|
||||||
// wait before firing it up
|
// So we do a quick check first, If it bombs out, we delay and try again.
|
||||||
Job job = new LoadClientAppsJob.DelayedRunClient(ctx, app.className, app.clientName, argVal, app.delay, pluginThreadGroup, cl);
|
// If it bombs after that, then we throw the ClassNotFoundException.
|
||||||
ctx.jobQueue().addJob(job);
|
try {
|
||||||
pluginJobs.get(pluginName).add(job);
|
// quick check
|
||||||
|
LoadClientAppsJob.testClient(app.className, cl);
|
||||||
|
} catch(ClassNotFoundException ex) {
|
||||||
|
// Try again 1 or 2 seconds later.
|
||||||
|
// This should be enough time. Although it is a lousy hack
|
||||||
|
// it should work for most cases.
|
||||||
|
// Perhaps it may be even better to delay a percentage
|
||||||
|
// if > 1, and reduce the delay time.
|
||||||
|
// Under normal circumstances there will be no delay at all.
|
||||||
|
if(app.delay > 1) {
|
||||||
|
Thread.sleep(2000);
|
||||||
|
} else {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// quick check, will throw ClassNotFoundException on error
|
||||||
|
LoadClientAppsJob.testClient(app.className, cl);
|
||||||
|
// wait before firing it up
|
||||||
|
Job job = new LoadClientAppsJob.DelayedRunClient(ctx, app.className, app.clientName, argVal, app.delay, pluginThreadGroup, cl);
|
||||||
|
ctx.jobQueue().addJob(job);
|
||||||
|
pluginJobs.get(pluginName).add(job);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2010-05-10 sponge
|
||||||
|
* PluginStarter: If there is some delay, there may be a really good reason for it.
|
||||||
|
Loading a class would be one of them!
|
||||||
|
So we do a quick check first, If it bombs out, we delay and try again.
|
||||||
|
If it bombs after that, then we throw the ClassNotFoundException.
|
||||||
|
|
||||||
2010-05-05 zzz
|
2010-05-05 zzz
|
||||||
* build.xml: Create packed sud in release
|
* build.xml: Create packed sud in release
|
||||||
* Console:
|
* Console:
|
||||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 3;
|
public final static long BUILD = 4;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
|
Reference in New Issue
Block a user