Package org.qi4j.library.scheduler.schedule

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


    {
        SortedSet<TimelineRecord> result = new TreeSet<>();

        UnitOfWork uow = module.currentUnitOfWork();
        String schedulesName = SchedulerMixin.getSchedulesIdentity( scheduler );
        Schedules schedules = uow.get( Schedules.class, schedulesName );
        for( Schedule schedule : schedules.schedules() )
        {
            Timeline timeline = (Timeline) schedule;
            Iterable<TimelineRecord> lastRecords = timeline.getLastRecords( maxResults );
            Iterables.addAll( result, lastRecords );
        }
View Full Code Here


    public Iterable<TimelineRecord> getNextRecords( int maxResults )
    {
        SortedSet<TimelineRecord> result = new TreeSet<>();
        UnitOfWork uow = module.currentUnitOfWork();
        String schedulesName = SchedulerMixin.getSchedulesIdentity( scheduler );
        Schedules schedules = uow.get( Schedules.class, schedulesName );
        for( Schedule schedule : schedules.schedules() )
        {
            Timeline timeline = (Timeline) schedule;
            Iterable<TimelineRecord> lastRecords = timeline.getNextRecords( maxResults );
            Iterables.addAll( result, lastRecords );
        }
View Full Code Here

    {
        SortedSet<TimelineRecord> result = new TreeSet<>();

        UnitOfWork uow = module.currentUnitOfWork();
        String schedulesName = SchedulerMixin.getSchedulesIdentity( scheduler );
        Schedules schedules = uow.get( Schedules.class, schedulesName );
        for( Schedule schedule : schedules.schedules() )
        {
            Timeline timeline = (Timeline) schedule;
            Iterable<TimelineRecord> lastRecords = timeline.getRecords( from, to );
            Iterables.addAll( result, lastRecords );
        }
View Full Code Here

    {
        SortedSet<TimelineRecord> result = new TreeSet<>();

        UnitOfWork uow = module.currentUnitOfWork();
        String schedulesName = SchedulerMixin.getSchedulesIdentity( scheduler );
        Schedules schedules = uow.get( Schedules.class, schedulesName );
        for( Schedule schedule : schedules.schedules() )
        {
            Timeline timeline = (Timeline) schedule;
            Iterable<TimelineRecord> lastRecords = timeline.getRecords( from, to );
            Iterables.addAll( result, lastRecords );
        }
View Full Code Here

    {
        long now = System.currentTimeMillis();
        Schedule schedule = scheduleFactory.newOnceSchedule( task, new DateTime( now + initialSecondsDelay * 1000 ), durable );
        if( durable )
        {
            Schedules schedules = module.currentUnitOfWork().get( Schedules.class, getSchedulesIdentity( me ) );
            schedules.schedules().add( schedule );
        }
        dispatchForExecution( schedule );
        return schedule;
    }
View Full Code Here

    {
        Schedule schedule = scheduleFactory.newOnceSchedule( task, runAt, durable );
        dispatchForExecution( schedule );
        if( durable )
        {
            Schedules schedules = module.currentUnitOfWork().get( Schedules.class, getSchedulesIdentity( me ) );
            schedules.schedules().add( schedule );
        }
        return schedule;
    }
View Full Code Here

    {
        DateTime now = new DateTime();
        Schedule schedule = scheduleFactory.newCronSchedule( task, cronExpression, now, durable );
        if( durable )
        {
            Schedules schedules = module.currentUnitOfWork().get( Schedules.class, getSchedulesIdentity( me ) );
            schedules.schedules().add( schedule );
        }
        dispatchForExecution( schedule );
        return schedule;
    }
View Full Code Here

    public Schedule scheduleCron( Task task, @CronExpression String cronExpression, DateTime start, boolean durable )
    {
        Schedule schedule = scheduleFactory.newCronSchedule( task, cronExpression, start, durable );
        if( durable )
        {
            Schedules schedules = module.currentUnitOfWork().get( Schedules.class, getSchedulesIdentity( me ) );
            schedules.schedules().add( schedule );
        }
        dispatchForExecution( schedule );
        return schedule;
    }
View Full Code Here

    {
        DateTime start = new DateTime( System.currentTimeMillis() + initialDelay );
        Schedule schedule = scheduleFactory.newCronSchedule( task, cronExpression, start, durable );
        if( durable )
        {
            Schedules schedules = module.currentUnitOfWork().get( Schedules.class, getSchedulesIdentity( me ) );
            schedules.schedules().add( schedule );
        }
        dispatchForExecution( schedule );
        return schedule;
    }
View Full Code Here

        throws UnitOfWorkCompletionException
    {
        UnitOfWork uow = module.newUnitOfWork();
        try
        {
            Schedules schedules = uow.get( Schedules.class, getSchedulesIdentity( me ) );
            for( Schedule schedule : schedules.schedules() )
            {
                dispatchForExecution( schedule );
            }
        }
        catch( NoSuchEntityException e )
View Full Code Here

TOP

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

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.