HandleTimeoutProcess.java :  » Mobile » bluetoothremote » com » costeaalex » blueserver » timeout » Java Open Source

Java Open Source » Mobile » bluetoothremote 
bluetoothremote » com » costeaalex » blueserver » timeout » HandleTimeoutProcess.java
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();
      }
    }
  
  }
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.