Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.atlassian.bamboo.utils
Class Timer

    java.lang.Object
      java.lang.Thread
          com.atlassian.bamboo.utils.Timer

All Implemented Interfaces:
  Runnable

Direct Known Subclasses:
  BuildTimeoutKiller

    public abstract class Timer

extends Thread

This allows graceful timeouts to time consuming tasks (such as sending emails).

Nested Class Summary

Nested classes/interfaces inherited from class java.lang.Thread
`Thread.State, Thread.UncaughtExceptionHandler`

Field Summary

Fields inherited from class java.lang.Thread
`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

Constructor Summary
`Timer(long lengthOfTimeoutInMillis)` Creates a timer of a specified lengthOfTimeoutInMillis

Method Summary
`void` | `cancel()`
`abstract void` | `onTimeout()` This callback is triggered if the timer times-out
`void` | `restart()` Resets the timer back to zero
`void` | `run()` Performs timer specific code
`void` | `start()`

Methods inherited from class java.lang.Thread
`activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Timer

    public Timer(long lengthOfTimeoutInMillis)

  Creates a timer of a specified lengthOfTimeoutInMillis

  Parameters:
    `lengthOfTimeoutInMillis` - Length of time before a onTimeout occurs

Method Detail

### start

    public void start()

  Overrides:
    `start` in class `Thread`

### cancel

    public void cancel()

### restart

    public void restart()

  Resets the timer back to zero

### run

    public void run()

  Performs timer specific code

  Specified by:
    `run` in interface `Runnable`
  Overrides:
    `run` in class `Thread`

### onTimeout

    public abstract void onTimeout()

  This callback is triggered if the timer times-out

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 Atlassian Software Systems. All Rights Reserved.