Package com.trilead.ssh2.util

## Class TimeoutService

- java.lang.Object
- - com.trilead.ssh2.util.TimeoutService

    public class TimeoutService
    extends java.lang.Object

TimeoutService (beta). Here you can register a timeout.

Implemented having large scale programs in mind: if you open many concurrent SSH connections that rely on timeouts, then there will be only one timeout thread. Once all timeouts have expired/are cancelled, the thread will (sooner or later) exit. Only after new timeouts arrive a new thread (singleton) will be instantiated.

### Nested Class Summary

Nested Classes
`static class` `TimeoutService.TimeoutToken`

### Constructor Summary

Constructors
`TimeoutService()`

### Method Summary

All Methods Static Methods Concrete Methods
`static TimeoutService.TimeoutToken` `addTimeoutHandler​(long runTime, java.lang.Runnable handler)` It is assumed that the passed handler will not execute for a long time.
`static void` `cancelTimeoutHandler​(TimeoutService.TimeoutToken token)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TimeoutService

    public TimeoutService()

### Method Detail

#### addTimeoutHandler

    public static final TimeoutService.TimeoutToken addTimeoutHandler​(long runTime,
                                                                      java.lang.Runnable handler)

It is assumed that the passed handler will not execute for a long time.

Parameters:
  `runTime` -
  `handler` -
Returns:
  a TimeoutToken that can be used to cancel the timeout.

#### cancelTimeoutHandler

    public static final void cancelTimeoutHandler​(TimeoutService.TimeoutToken token)