uk.co.mmscomputing.concurrent
Class Timer

java.lang.Object
  extended by uk.co.mmscomputing.concurrent.Semaphore
      extended by uk.co.mmscomputing.concurrent.Timer

public class Timer
extends Semaphore


Field Summary
protected  int delay
           
protected  TimerListener listener
           
protected  int timeout
           
 
Constructor Summary
Timer(int timeout)
           
 
Method Summary
 void acquire()
           
 void setDelay(int td)
           
 void setListener(TimerListener listener)
           
 boolean tryAcquire(long timeout, TimeUnit unit)
           
 
Methods inherited from class uk.co.mmscomputing.concurrent.Semaphore
availablePermits, isFair, release, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeout

protected int timeout

delay

protected int delay

listener

protected TimerListener listener
Constructor Detail

Timer

public Timer(int timeout)
Method Detail

setDelay

public void setDelay(int td)

setListener

public void setListener(TimerListener listener)

acquire

public void acquire()
             throws java.lang.InterruptedException
Overrides:
acquire in class Semaphore
Throws:
java.lang.InterruptedException

tryAcquire

public boolean tryAcquire(long timeout,
                          TimeUnit unit)
                   throws java.lang.InterruptedException
Overrides:
tryAcquire in class Semaphore
Throws:
java.lang.InterruptedException


Copyright © 2011 Direcció General de Tecnologia i Comunicacions. Govern de les Illes Balears. All Rights Reserved.