Package org.quartz

Examples of org.quartz.JobListener


      return null;
   }

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


            scheduleJob(bndle, sched, overWriteExistingJobs);
        }
       
        itr = listenersToSchedule.iterator();
        while (itr.hasNext()) {
            JobListener listener = (JobListener) itr.next();
            getLog().info("adding listener "+listener.getName()+" of class "+listener.getClass().getName());
            sched.addJobListener(listener);
        }
        getLog().info(jobBundles.size() + " scheduled jobs.");       
    }
View Full Code Here

    private List buildJobListenerList(String[] additionalLstnrs)
            throws SchedulerException {
        List jobListeners = getGlobalJobListeners();
        for (int i = 0; i < additionalLstnrs.length; i++) {
            JobListener jl = getJobListener(additionalLstnrs[i]);

            if (jl != null) jobListeners.add(jl);
            else
                throw new SchedulerException("JobListener '"
                        + additionalLstnrs[i] + "' not found.",
View Full Code Here

                .getJobListenerNames());

        // notify all job listeners
        java.util.Iterator itr = jobListeners.iterator();
        while (itr.hasNext()) {
            JobListener jl = (JobListener) itr.next();
            try {
                jl.jobToBeExecuted(jec);
            } catch (Exception e) {
                SchedulerException se = new SchedulerException(
                        "JobListener '" + jl.getName() + "' threw exception: "
                                + e.getMessage(), e);
                se.setErrorCode(SchedulerException.ERR_JOB_LISTENER);
                throw se;
            }
        }
View Full Code Here

                .getJobListenerNames());

        // notify all job listeners
        java.util.Iterator itr = jobListeners.iterator();
        while (itr.hasNext()) {
            JobListener jl = (JobListener) itr.next();
            try {
                jl.jobExecutionVetoed(jec);
            } catch (Exception e) {
                SchedulerException se = new SchedulerException(
                        "JobListener '" + jl.getName() + "' threw exception: "
                        + e.getMessage(), e);
                se.setErrorCode(SchedulerException.ERR_JOB_LISTENER);
                throw se;
            }
        }
View Full Code Here

                .getJobListenerNames());

        // notify all job listeners
        java.util.Iterator itr = jobListeners.iterator();
        while (itr.hasNext()) {
            JobListener jl = (JobListener) itr.next();
            try {
                jl.jobWasExecuted(jec, je);
            } catch (Exception e) {
                SchedulerException se = new SchedulerException(
                        "JobListener '" + jl.getName() + "' threw exception: "
                                + e.getMessage(), e);
                se.setErrorCode(SchedulerException.ERR_JOB_LISTENER);
                throw se;
            }
        }
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 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

   *
   * @return a JobListener object
   */
  protected JobListener getDefaultJobListener()
  {
    JobListener aJobListener = null;
    Class<? extends JobListener> jobListenerClass = ERQSJobListener.class;
    if (this.getClass().isAnnotationPresent(ERQSMyJobListener.class))
    {
      String jobListenerClassPath = this.getClass().getAnnotation(ERQSMyJobListener.class).value();

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.