Package org.quartz

Examples of org.quartz.JobListener


      return jlist;
   }

   public void addGlobalJobListener(ComponentPlugin plugin) throws Exception
   {
      JobListener jl = (JobListener)plugin;
      try
      {
         scheduler_.getListenerManager().addJobListener(jl);
      }
      catch (Exception e)
      {
         LOG.warn("Could not add the global job listener (" + jl.getName() + ") defined in the plugin "
            + plugin.getName() + " : " + e.getMessage());
      }
   }
View Full Code Here


      return scheduler_.getListenerManager().removeJobListener(name);
   }

   public void addJobListener(AddJobListenerComponentPlugin plugin) throws Exception
   {
      JobListener jl = (JobListener)plugin;
      try
      {
         List<Matcher<JobKey>> matchers = null;
         if (plugin.getKeys() != null)
         {
            matchers = new ArrayList<Matcher<JobKey>>();
            for (org.exoplatform.services.scheduler.JobKey key : plugin.getKeys())
            {
               matchers.add(KeyMatcher.keyEquals(JobKey.jobKey(key.getName(), getGroupName(key.getGroup()))));
            }
         }
         scheduler_.getListenerManager().addJobListener(jl, matchers);
      }
      catch (Exception e)
      {
         LOG.warn("Could not add the job listener (" + jl.getName() + ") defined in the plugin " + plugin.getName()
            + " : " + e.getMessage());
      }
   }
View Full Code Here

   }

   public JobListener getGlobalJobListener(String name) throws Exception
   {
      List listener;
      JobListener jlistener;
      listener = scheduler_.getGlobalJobListeners();
      ListIterator iterator = listener.listIterator();
      while (iterator.hasNext())
      {
         jlistener = (JobListener)iterator.next();
         if (jlistener.getName().equals(name))
         {
            return jlistener;
         }
      }
      return null;
View Full Code Here

      return null;
   }

   public boolean removeGlobalJobListener(String name) throws Exception
   {
      JobListener jlistener = getGlobalJobListener(name);
      boolean b = scheduler_.removeGlobalJobListener(jlistener);
      return b;
   }
View Full Code Here

    private void runJobSynchronously() throws Exception {
        final CountDownLatch countDownLatch = new CountDownLatch(1);
        final String jobName = SavedSearchResultCountRecalculationJob.class.getSimpleName();
        final String jobGroup = SavedSearchResultCountRecalculationJobTest.class.getSimpleName();
        scheduler.addGlobalJobListener(new JobListener() {
            @Override
            public String getName() {
                return SavedSearchResultCountRecalculationJobTest.class.getSimpleName();
            }
View Full Code Here

        final CountDownLatch latch = new CountDownLatch(1);

        SchedulerLocal schedulerBean = LookupUtil.getSchedulerBean();
        schedulerBean.scheduleSimpleCronJob(DataPurgeJob.class, true, false, "0 0 0 1 1 ? 2099", null);

        schedulerBean.addGlobalJobListener(new JobListener() {
            @Override
            public String getName() {
                return "DataPurgeJobTestListener";
            }
View Full Code Here

        final CountDownLatch latch = new CountDownLatch(1);

        SchedulerLocal schedulerBean = LookupUtil.getSchedulerBean();
        schedulerBean.scheduleSimpleCronJob(DataCalcJob.class, true, false, "0 0 0 1 1 ? 2099", null);

        schedulerBean.addGlobalJobListener(new JobListener() {
            @Override
            public String getName() {
                return "DataCalcJobTestListener";
            }
View Full Code Here

    MockControl schedulerControl = MockControl.createControl(Scheduler.class);
    final Scheduler scheduler = (Scheduler) schedulerControl.getMock();

    SchedulerListener schedulerListener = new TestSchedulerListener();
    JobListener globalJobListener = new TestJobListener();
    JobListener jobListener = new TestJobListener();
    TriggerListener globalTriggerListener = new TestTriggerListener();
    TriggerListener triggerListener = new TestTriggerListener();

    scheduler.setJobFactory(jobFactory);
    schedulerControl.setVoidCallable();
View Full Code Here

      return scheduler_.getGlobalJobListeners();
   }

   public JobListener getGlobalJobListener(String name) throws Exception
   {
      JobListener jlistener;
      List listener = scheduler_.getGlobalJobListeners();
      ListIterator iterator = listener.listIterator();
      while (iterator.hasNext())
      {
         jlistener = (JobListener)iterator.next();
         if (jlistener.getName().equals(name))
         {
            return jlistener;
         }
      }
      return null;
View Full Code Here

      return null;
   }

   public boolean removeGlobalJobListener(String name) throws Exception
   {
      JobListener jlistener = getGlobalJobListener(name);
      return scheduler_.removeGlobalJobListener(jlistener);
   }
View Full Code Here

TOP

Related Classes of org.quartz.JobListener

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.