Package org.qi4j.library.scheduler.schedule

Examples of org.qi4j.library.scheduler.schedule.ScheduleTime


                if( nextRun < 0 )
                {
                    return;
                }
                System.out.println( "Next run at: " + new DateTime( nextRun ) );
                timingQueue.add( new ScheduleTime( schedule.identity().get(), nextRun ) );
                if( scheduleHandler == null )
                {
                    dispatchHandler();
                }
            }
            else
            {
                ScheduleTime first = timingQueue.first();
                long nextRun = schedule.nextRun( now );
                if( nextRun < 0 )
                {
                    return;
                }
                System.out.println( "Next run at: " + new DateTime( nextRun ) );
                timingQueue.add( new ScheduleTime( schedule.identity().get(), nextRun ) );
                ScheduleTime newFirst = timingQueue.first();
                if( !first.equals( newFirst ) )
                {
                    // We need to restart the managementThread, which is currently waiting for a 'later' event to
                    // occur than the one that was just scheduled.
                    scheduleHandler.future.cancel( true );
View Full Code Here


        @Override
        public void run()
        {
            synchronized( timingQueue )
            {
                ScheduleTime scheduleTime = timingQueue.first();
                timingQueue.remove( scheduleTime );
                scheduleRunner = new ScheduleRunner( scheduleTime, SchedulerMixin.this, module );
                taskExecutor.submit( scheduleRunner );
                if( timingQueue.size() == 0 )
                {
                    scheduleHandler = null;
                }
                else
                {
                    ScheduleTime nextTime = timingQueue.first();
                    future = managementExecutor.schedule( scheduleHandler, nextTime.nextTime, TimeUnit.MILLISECONDS );
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.qi4j.library.scheduler.schedule.ScheduleTime

Copyright © 2018 www.massapicom. 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.