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

com.bixuebihui.util.JavaAlarm Maven / Gradle / Ivy

Go to download

a fast small database connection pool and a active record flavor mini framework

There is a newer version: 1.15.3.3
Show newest version
// Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov  Date: 2005-1-4 11:29:44
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name:   JavaAlarm.java

package com.bixuebihui.util;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 

JavaAlarm class.

* * @author xingwx * @version $Id: $Id */ public final class JavaAlarm extends Thread { private static final Logger LOG = LoggerFactory.getLogger(JavaAlarm.class); /** * {@inheritDoc} */ @Override public void run() { completed = false; r.run(); synchronized(this) { completed = true; notifyAll(); } } /** *

Constructor for JavaAlarm.

* * @param runnable a {@link java.lang.Runnable} object. * @param maxWait a long. * @throws TimeoutException if any. */ public JavaAlarm(Runnable runnable, long maxWait) throws TimeoutException{ r = runnable; completed = false; long step =maxWait/10+1; long count = step; synchronized(this) { start(); while (!completed) { try { wait(step); if(!completed && count




© 2015 - 2024 Weber Informatics LLC | Privacy Policy