*
* @return the scheduled timeout task.
*/
private TimingOutTask createAndScheduleTimingOutTask(Period timeout) {
// Lets handle the timeout.
TimingOutTask task = new ThreadInterruptingTimingOutTask();
if (timeout != null && timeout != Period.INDEFINITELY) {
TIMER.schedule(new RunnableTimerTask(task),
timeout.inMillis());
}
return task;