Example #1
0
 /**
  * Causes the local JVM to be closed when the last container in this JVM terminates. <br>
  * <b>NOT available in MIDP</b> <br>
  */
 public void setCloseVM(boolean flag) {
   if (flag) {
     terminators.addLast(
         new Runnable() {
           public void run() {
             // Give one more chance to other threads to complete
             Thread.yield();
             myLogger.log(Logger.INFO, "JADE is closing down now.");
             System.exit(0);
           }
         });
   }
 }
Example #2
0
 /**
  * Reset the list of <code>Runnable</code> objects to be executed on JADE termination
  *
  * @see invokeOnTermination()
  */
 public void resetTerminators() {
   terminators.clear();
 }
Example #3
0
 /**
  * Allows setting a <code>Runnable</code> that is executed when the last container in this JVM
  * terminates.
  */
 public void invokeOnTermination(Runnable r) {
   terminators.addFirst(r);
 }