package com.costeaalex.blueserver.timeout;
public class HandleTimeoutProcess extends Thread
{
private int time;
private TimeoutProcess tPL;
private boolean interrupted=false;
public HandleTimeoutProcess(int t, TimeoutProcess tP)
{
super("Timeout Handle");
time=t;
tPL=tP;
}
@Override
public void run()
{
try
{
sleep(time);
}
catch (InterruptedException e)
{
e.printStackTrace();
interrupted=true;
}
if(tPL!=null && !interrupted)
{
if(tPL.isCancellable())
tPL.destroy();
}
}
}
|