All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.nist.javax.sip.stack.SIPStackTimerTask Maven / Gradle / Ivy

/*
 * @author:     Brett Buckingham
 * @author:     Last modified by: $Author: mranga $
 * @version:    $Date: 2007/01/08 19:41:48 $ $Revision: 1.2 $
 *
 * This source code has been contributed to the public domain.
 */

package gov.nist.javax.sip.stack;

import java.util.TimerTask;

/**
 * A subclass of TimerTask which runs TimerTask code within a try/catch block to
 * avoid killing the SIPTransactionStack timer thread. Note: subclasses MUST not
 * override run(); instead they should override runTask().
 * 
 * @author Brett Buckingham
 * 
 */
public abstract class SIPStackTimerTask extends TimerTask {
	// / Implements code to be run when the SIPStackTimerTask is executed.
	protected abstract void runTask();

	// / The run() method is final to ensure that all subclasses inherit the
	// exception handling.
	public final void run() {
		try {
			runTask();
		} catch (Throwable e) {
			System.out.println("SIP stack timer task failed due to exception:");
			e.printStackTrace();
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy