net.sf.colossus.common
Class WhatNextManager

java.lang.Object
  extended by net.sf.colossus.common.WhatNextManager

public class WhatNextManager
extends java.lang.Object


Nested Class Summary
static class WhatNextManager.TimedJvmQuit
          A demon thread which is started by triggerTimedQuit.
static class WhatNextManager.WhatToDoNext
          The various constants for activities what the Start class should do as next thing, typically when a dialog is closed or a games ended.
 
Field Summary
private  int howManyGamesLeft
           
private static java.util.logging.Logger LOGGER
           
private  Options startOptions
           
private  WhatNextManager.WhatToDoNext whatToDoNext
           
 
Constructor Summary
WhatNextManager(Options startOpts)
           
 
Method Summary
 int decrementHowManyGamesLeft()
           
 int getHowManyGamesLeft()
           
 Options getStartOptions()
           
 WhatNextManager.WhatToDoNext getWhatToDoNext()
           
 void setWhatToDoNext(WhatNextManager.WhatToDoNext whatToDoNext, boolean triggerQuitTimer)
          Set the action what shall be executed next.
 void setWhatToDoNext(WhatNextManager.WhatToDoNext whatToDoNext, java.lang.String loadFile)
           
static void sleepFor(long millis)
           
 void triggerTimedQuit()
          Trigger a timed Quit, which will (by using a demon thread) terminate the JVM after a timeout (currently 10 (120) seconds) - unless the JVM has quit already anyway because cleanup has succeeded as planned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

private static final java.util.logging.Logger LOGGER

startOptions

private final Options startOptions

whatToDoNext

private WhatNextManager.WhatToDoNext whatToDoNext

howManyGamesLeft

private int howManyGamesLeft
Constructor Detail

WhatNextManager

public WhatNextManager(Options startOpts)
Method Detail

getWhatToDoNext

public WhatNextManager.WhatToDoNext getWhatToDoNext()

setWhatToDoNext

public void setWhatToDoNext(WhatNextManager.WhatToDoNext whatToDoNext,
                            boolean triggerQuitTimer)
Set the action what shall be executed next. Trigger also the timer for the "Timed Quit", if requested so.

Parameters:
whatToDoNext -
triggerQuitTimer -

getStartOptions

public Options getStartOptions()
Returns:
Returns the same startOptions object that Start object uses.

setWhatToDoNext

public void setWhatToDoNext(WhatNextManager.WhatToDoNext whatToDoNext,
                            java.lang.String loadFile)

getHowManyGamesLeft

public int getHowManyGamesLeft()

decrementHowManyGamesLeft

public int decrementHowManyGamesLeft()

triggerTimedQuit

public void triggerTimedQuit()
Trigger a timed Quit, which will (by using a demon thread) terminate the JVM after a timeout (currently 10 (120) seconds) - unless the JVM has quit already anyway because cleanup has succeeded as planned.


sleepFor

public static void sleepFor(long millis)