Package org.springframework.scheduling.support

Examples of org.springframework.scheduling.support.CronTrigger


    {
        if ( StringUtils.isEmpty( repositoryGroup.getCronExpression() ) )
        {
            return;
        }
        CronTrigger cronTrigger = new CronTrigger( repositoryGroup.getCronExpression() );

        List<String> repositories = repositoryGroup.getRepositories();

        IndexMergerRequest indexMergerRequest =
            new IndexMergerRequest( repositories, true, repositoryGroup.getId(), repositoryGroup.getMergedIndexPath(),
View Full Code Here


            {
                log.info( "schedule download remote index for repository {} with cron expression {}",
                          remoteRepository.getId(), remoteRepository.getCronExpression() );
                taskScheduler.schedule(
                    new DownloadRemoteIndexTask( downloadRemoteIndexTaskRequest, this.runningRemoteDownloadIds ),
                    new CronTrigger( remoteRepository.getCronExpression() ) );

                if ( remoteRepository.isDownloadRemoteIndexOnStartup() )
                {
                    log.info(
                        "remote repository {} configured with downloadRemoteIndexOnStartup schedule now a download",
View Full Code Here

            {
                log.info( "schedule download remote index for repository {} with cron expression {}",
                          remoteRepository.getId(), remoteRepository.getCronExpression() );
                try
                {
                    CronTrigger cronTrigger = new CronTrigger( remoteRepository.getCronExpression() );
                    taskScheduler.schedule(
                        new DownloadRemoteIndexTask( downloadRemoteIndexTaskRequest, this.runningRemoteDownloadIds ),
                        cronTrigger );
                }
                catch ( IllegalArgumentException e )
View Full Code Here

    {
        if ( StringUtils.isEmpty( repositoryGroup.getCronExpression() ) )
        {
            return;
        }
        CronTrigger cronTrigger = new CronTrigger( repositoryGroup.getCronExpression() );

        List<String> repositories = repositoryGroup.getRepositories();

        IndexMergerRequest indexMergerRequest =
            new IndexMergerRequest( repositories, true, repositoryGroup.getId(), repositoryGroup.getMergedIndexPath(),
View Full Code Here

        this.scheduledFutures.add(this.taskScheduler.schedule(entry.getKey(), entry.getValue()));
      }
    }
    if (this.cronTasks != null) {
      for (Map.Entry<Runnable, String> entry : this.cronTasks.entrySet()) {
        this.scheduledFutures.add(this.taskScheduler.schedule(entry.getKey(), new CronTrigger(entry.getValue())));
      }
    }
    if (this.fixedRateTasks != null) {
      for (Map.Entry<Runnable, Long> entry : this.fixedRateTasks.entrySet()) {
        this.scheduledFutures.add(this.taskScheduler.scheduleAtFixedRate(entry.getKey(), entry.getValue()));
View Full Code Here

   * Create a new {@code CronTask}.
   * @param runnable the underlying task to execute
   * @param expression cron expression defining when the task should be executed
   */
  public CronTask(Runnable runnable, String expression) {
    this(runnable, new CronTrigger(expression));
  }
View Full Code Here

  ArrayList<ProcessCheckTask> processCheckTaskList = (ArrayList<ProcessCheckTask>) context
    .getBean("processCheckTaskList");

  // Schedule the process check tasks
  for (ProcessCheckTask task : processCheckTaskList) {
      ScheduledFuture<?> future = scheduler.schedule(task, new CronTrigger(task.getCron()));
      task.setScheduledFuture(future);
  }

  while (!Thread.interrupted()) {
      try {
View Full Code Here

    @Test
    public void testTimeoutProcessFailureCheck() {

  // Schedule the process check tasks
  for (ProcessCheckTask task : processCheckTaskList) {
      ScheduledFuture<?> future = scheduler.schedule(task, new CronTrigger(task.getCron()));
      task.setScheduledFuture(future);
  }

  try {
      Thread.yield();
View Full Code Here

    @Test
    public void testTimeoutProcessFailureCheck() {

  // Schedule the process check tasks
  for (ProcessCheckTask task : processCheckTaskList) {
      ScheduledFuture<?> future = scheduler.schedule(task, new CronTrigger(task.getCron()));
      task.setScheduledFuture(future);
  }

  try {
      Thread.yield();
View Full Code Here

    @Override
    protected void doStart() throws Exception {
        ObjectHelper.notEmpty(cron, "cron", this);

        trigger = new CronTrigger(getCron(), getTimeZone());

        if (taskScheduler == null) {
            taskScheduler = new CamelThreadPoolTaskScheduler(getCamelContext(), consumer, consumer.getEndpoint().getEndpointUri());
            taskScheduler.afterPropertiesSet();
            destroyTaskScheduler = true;
View Full Code Here

TOP

Related Classes of org.springframework.scheduling.support.CronTrigger

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.