org.apache.camel.processor.resequencer
Class Timeout

java.lang.Object
  extended by java.util.TimerTask
      extended by org.apache.camel.processor.resequencer.Timeout
All Implemented Interfaces:
Runnable

public class Timeout
extends TimerTask

A timer task that notifies handlers about scheduled timeouts.

Version:
See Also:
Timer, TimerTask

Constructor Summary
Timeout(Timer timer, long timeout)
          Creates a new timeout task using the given Timer instance and timeout value.
 
Method Summary
 TimeoutHandler getTimeoutHandlers()
          Returns the timeout handler that has been registered for notification.
 void run()
          Notifies the timeout handler about the scheduled timeout.
 void schedule()
          Schedules this timeout task.
 void setTimeoutHandler(TimeoutHandler timeoutHandler)
          Sets a timeout handler for receiving timeout notifications.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timeout

public Timeout(Timer timer,
               long timeout)
Creates a new timeout task using the given Timer instance and timeout value. The task is not scheduled immediately. It will be scheduled by calling this task's schedule() method.

Parameters:
timer - a timer
timeout - a timeout value.
Method Detail

getTimeoutHandlers

public TimeoutHandler getTimeoutHandlers()
Returns the timeout handler that has been registered for notification.

Returns:
the timeout handler.

setTimeoutHandler

public void setTimeoutHandler(TimeoutHandler timeoutHandler)
Sets a timeout handler for receiving timeout notifications.

Parameters:
timeoutHandler - a timeout handler.

schedule

public void schedule()
Schedules this timeout task.


run

public void run()
Notifies the timeout handler about the scheduled timeout.

Specified by:
run in interface Runnable
Specified by:
run in class TimerTask


Apache CAMEL