eu.emi.security.authn.x509.helpers
Class WeakTimerTask<T>

java.lang.Object
  extended by java.util.TimerTask
      extended by eu.emi.security.authn.x509.helpers.WeakTimerTask<T>
All Implemented Interfaces:
Runnable

public abstract class WeakTimerTask<T>
extends TimerTask

This class holds a partner of the TimerTask reference as weak one. This allows to have weak association: the partner's object can be disposed without being blocked by a strong reference of the timer.

IMPORTANT! Never use this class as base for an inner or anonymous class. This will create an implicit strong reference to the wrapping partner, so it won't be disposed until the timer task is cancelled.

Author:
K. Benedyczak

Field Summary
protected  WeakReference<T> partnerRef
           
 
Constructor Summary
WeakTimerTask(T partner)
           
 
Method Summary
 
Methods inherited from class java.util.TimerTask
cancel, run, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

partnerRef

protected WeakReference<T> partnerRef
Constructor Detail

WeakTimerTask

public WeakTimerTask(T partner)


Copyright © 2012-2013 European Middleware Initiative. All Rights Reserved.