Examples of ScheduledFuture


Examples of java.util.concurrent.ScheduledFuture

            JDKCallableJob callableJob = new JDKCallableJob( job,
                                                             ctx,
                                                             trigger,
                                                             jobHandle,
                                                             this.scheduler );
            ScheduledFuture future = schedule( date,
                                               callableJob,
                                               this.scheduler );
            jobHandle.setFuture( future );

            return jobHandle;
View Full Code Here

Examples of java.util.concurrent.ScheduledFuture

            V>> entries) {
        final ScheduledEntry<K, V> result = entries.remove(key);
        if (entries.isEmpty()) {
            scheduledEntries.remove(second);

            ScheduledFuture removed = scheduledTaskMap.remove(second);
            if (removed != null) {
                removed.cancel(false);
            }
        }
        return result;
    }
View Full Code Here

Examples of java.util.concurrent.ScheduledFuture

        return result;
    }

    private void schedule(final Integer second, final int delaySeconds) {
        EntryProcessorExecutor command = new EntryProcessorExecutor(second);
        ScheduledFuture scheduledFuture = scheduledExecutorService.schedule(command, delaySeconds, TimeUnit.SECONDS);
        scheduledTaskMap.put(second, scheduledFuture);
    }
View Full Code Here

Examples of java.util.concurrent.ScheduledFuture

    }

    @SuppressWarnings("unchecked")
    @Test
    public void scheduleAtFixedRate() {
        @SuppressWarnings("rawtypes")
        ScheduledFuture expected = mock(ScheduledFuture.class);
        Runnable task = mock(Runnable.class);
        long delay = 10L;
        long period = 20L;
        TimeUnit unit = TimeUnit.SECONDS;
View Full Code Here

Examples of java.util.concurrent.ScheduledFuture

    }

    @SuppressWarnings("unchecked")
    @Test
    public void scheduleWithFixedDelay() {
        @SuppressWarnings("rawtypes")
        ScheduledFuture expected = mock(ScheduledFuture.class);
        Runnable task = mock(Runnable.class);
        long delay = 10L;
        long period = 20L;
        TimeUnit unit = TimeUnit.SECONDS;
View Full Code Here

Examples of java.util.concurrent.ScheduledFuture

          Callable<Void> callableJob = createCallableJob( job,
                                                            ctx,
                                                            trigger,
                                                            jobHandle,
                                                            this.scheduler );
            ScheduledFuture future = schedule( date,
                                               callableJob,
                                               this.scheduler );
            jobHandle.setFuture( future );

            return jobHandle;
View Full Code Here

Examples of java.util.concurrent.ScheduledFuture

            new MergedRemoteIndexesTaskRequest( indexMergerRequest, indexMerger );

        logger.info( "schedule merge remote index for group {} with cron {}", repositoryGroup.getId(),
                     repositoryGroup.getCronExpression() );

        ScheduledFuture scheduledFuture =
            taskScheduler.schedule( new MergedRemoteIndexesTask( taskRequest ), cronTrigger );
        scheduledFutureMap.put( repositoryGroup.getId(), scheduledFuture );
    }
View Full Code Here

Examples of java.util.concurrent.ScheduledFuture

    }

    @Override
    public void unschedule( RepositoryGroup repositoryGroup )
    {
        ScheduledFuture scheduledFuture = scheduledFutureMap.remove( repositoryGroup.getId() );
        if ( scheduledFuture != null )
        {
            scheduledFuture.cancel( true );
        }
    }
View Full Code Here

Examples of java.util.concurrent.ScheduledFuture

*/
@Test(groups = "unit", testName = "AsyncMonitorTest")
public class AsyncMonitorTest {
   @SuppressWarnings({ "rawtypes", "unchecked" })
   public void testStartMonitoringWithoutTimeout() {
      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
      expect(
            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
                  anyObject(TimeUnit.class))).andReturn(mockFuture);

View Full Code Here

Examples of java.util.concurrent.ScheduledFuture

      monitor.startMonitoring(100L, null);
   }

   @SuppressWarnings({ "rawtypes", "unchecked" })
   public void testStartMonitoringWithoutTimeoutAndNullTimeUnit() {
      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
      expect(
            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
                  anyObject(TimeUnit.class))).andReturn(mockFuture);
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.