001 package biz.hammurapi.config;
002
003 public interface RestartCommand extends Runnable {
004
005 public static final String RESTART_DELARY_PROPERTY = RestartCommand.class.getName()+":restart-delay";
006
007 public static final long DEFAULT_RESTART_DELAY = 5000;
008
009 /**
010 * @return Number of times the command was already executed.
011 */
012 int getAttempt();
013
014 /**
015 * @return Number of milliseconds the command waits before creating
016 * and starting the object. The command waits only if number of attempts is
017 * more than zero. The value is taken from the system property with the name
018 * specified in RESTART_DELAY_PROPERTY constant. Default restart delay is specified in
019 * DEFAULT_RESTART_DELAY constant.
020 */
021 long getRestartDelay();
022 }