Package org.apache.jena.atlas.lib

Examples of org.apache.jena.atlas.lib.AlarmClock.reset()


    {
        AlarmClock alarmClock = new AlarmClock() ;
        assertEquals(0, alarmClock.getCount()) ;
        Pingback<?> ping1 = alarmClock.add(callback, 100) ;
        assertEquals(1, alarmClock.getCount()) ;
        alarmClock.reset(ping1, 2000) ;
        assertEquals(1, alarmClock.getCount()) ;
        sleep(100) ;
        assertEquals(1, alarmClock.getCount()) ;
    }
   
View Full Code Here


        AlarmClock alarmClock = new AlarmClock() ;
        assertEquals(0, alarmClock.getCount()) ;
        Pingback<?> ping1 = alarmClock.add(callback, 50) ;
        Pingback<?> ping2 = alarmClock.add(callback, 100) ;
        assertEquals(2, alarmClock.getCount()) ;
        alarmClock.reset(ping1, 2000) ;
        assertEquals(2, alarmClock.getCount()) ;
        sleep(200) ;    // ping2 goes off.
        assertEquals(1, alarmClock.getCount()) ;
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.