Examples of JobDetail


Examples of org.apache.openejb.quartz.JobDetail

                        Thread.currentThread().setContextClassLoader(oldCl);
                    }

                    //durability is configured with true, which means that the job will be kept in the store even if no trigger is attached to it.
                    //Currently, all the EJB beans share with the same job instance
                    final JobDetail job = JobBuilder.newJob(EjbTimeoutJob.class)
                        .withIdentity(OPENEJB_TIMEOUT_JOB_NAME, OPENEJB_TIMEOUT_JOB_GROUP_NAME)
                        .storeDurably(true)
                        .requestRecovery(false)
                        .build();
                    thisScheduler.addJob(job, true);
View Full Code Here

Examples of org.netmelody.cieye.spies.jenkins.jsondomain.JobDetail

public final class JobDetailTest {

    @Test public void
    correctlyDeterminesTheLastFailedBuildUrl() {
        final JobDetail jobDetail = new JobDetail();
        jobDetail.lastUnstableBuild = build(123, "http://blah/455");
        jobDetail.lastUnsuccessfulBuild = build(9, "http://blah/454");
        jobDetail.lastFailedBuild = build(456, "http://blah/456");
       
        assertThat(jobDetail.lastBadBuildUrl(), is("http://blah/456"));
    }
View Full Code Here

Examples of org.quartz.JobDetail

                "Message Forwarding Processor view", getName());
    }

    @Override
    protected JobDetail getJobDetail() {
        JobDetail jobDetail = new JobDetail();
        jobDetail.setName(name + "-forward job");
        jobDetail.setJobClass(ForwardingJob.class);
        return jobDetail;
    }
View Full Code Here

Examples of org.quartz.JobDetail

  
   private void startSchedule(Scheduler sched, String name, CronData data) throws XmlBlasterException {
      try {
         log.info("Starting scheduler " + data.toString());
         Class clazz = Class.forName(data.getCommand());
         JobDetail jobDetail = new JobDetail(name, null, clazz);
         Object obj = global.getObjectEntry(ORIGINAL_ENGINE_GLOBAL);
         if (obj != null)
            jobDetail.getJobDataMap().put(ORIGINAL_ENGINE_GLOBAL, obj);
         else
            throw new XmlBlasterException(global, ErrorCode.INTERNAL, "SchedulerPlugin.doInit", "Could not find the ServerScope");
         String triggerName = name;
         Trigger trigger = null;
        
         if (data.getMonth() > -1)
            throw new XmlBlasterException(global, ErrorCode.USER_CONFIGURATION, "SchedulerPlugin.doInit", "Yearly Events are not implemented");

         int dayOfMonth = data.getDayOfMonth();
         int hour = data.getHour();
         int min = data.getMin();
         if (dayOfMonth > -1) { // monthly trigger
            if (hour < 0)
               throw new XmlBlasterException(this.global, ErrorCode.USER_CONFIGURATION, "SchedulerPlugin.doInit", "On monthly triggers the hour must be specified");
            if (min < 0)
               throw new XmlBlasterException(this.global, ErrorCode.USER_CONFIGURATION, "SchedulerPlugin.doInit", "On monthly triggers the min must be specified");
            trigger = TriggerUtils.makeMonthlyTrigger(triggerName, dayOfMonth, hour, min);
            trigger.setStartTime(new Date())// start now
         }
         else {
            int dayOfWeek = data.getDayOfWeek();
            if (dayOfWeek > -1) {
               if (hour < 0)
                  throw new XmlBlasterException(this.global, ErrorCode.USER_CONFIGURATION, "SchedulerPlugin.doInit", "On weekly triggers the hour must be specified");
               if (min < 0)
                  throw new XmlBlasterException(this.global, ErrorCode.USER_CONFIGURATION, "SchedulerPlugin.doInit", "On weekly triggers the min must be specified");
               trigger = TriggerUtils.makeWeeklyTrigger(triggerName, dayOfWeek+1, hour, min);
               trigger.setStartTime(new Date())// start now
            }
            else {
               if (hour > -1) {
                  if (min < 0)
                     throw new XmlBlasterException(this.global, ErrorCode.USER_CONFIGURATION, "SchedulerPlugin.doInit", "On daily triggers the min must be specified");
                  trigger = TriggerUtils.makeDailyTrigger(triggerName, hour, min);
                  trigger.setStartTime(new Date())// start now
               }
               else {
                  if (min > -1) {
                     trigger = TriggerUtils.makeHourlyTrigger(1);
                     trigger.setName(triggerName);
                     Date startTime = TriggerUtils.getNextGivenMinuteDate(new Date(), min);
                     trigger.setStartTime(startTime);
                  }
                  else {
                     throw new XmlBlasterException(global, ErrorCode.USER_CONFIGURATION, "SchedulerPlugin.doInit", "No time has been specified in the configuration");
                  }
               }
              
            }
         }
         String[] args = data.getArguments();
         for (int i=0; i < args.length; i++)
            jobDetail.getJobDataMap().put("arg" + i, args[i]);
         sched.scheduleJob(jobDetail, trigger);
         cronDataMap.put(name, data);
      }
      catch (ClassNotFoundException ex) {
         throw new XmlBlasterException(this.global, ErrorCode.RESOURCE, "", "SchedulerPlugin.doInit", ex);
View Full Code Here

Examples of org.quartz.JobDetail

        // Get Scheduler on the quartz component
        Scheduler scheduler = quartzComponent.getScheduler();

        // Get detail
        JobDetail jobDetail = null;
        try {
            jobDetail = scheduler.getJobDetail(jobName, groupName);
        } catch (SchedulerException e) {
            throw new EJBException("Cannot get the jobDetail for the jobName '" + jobName + "'.", e);
        }
View Full Code Here

Examples of org.quartz.JobDetail

        if (jobNames != null) {
            // For each job name
            for (String jobName : jobNames) {

                // Get detail
                JobDetail jobDetail = null;
                try {
                    jobDetail = this.scheduler.getJobDetail(jobName, getJobDetailGroupName());
                } catch (SchedulerException e) {
                    throw new EJBException("Cannot get the jobDetail for the jobName '" + jobName + "'.", e);
                }
View Full Code Here

Examples of org.quartz.JobDetail

      if (tmpMe instanceof StatefulJob) clazz = StatefulQuartzJob.class;
      tmpMe.release();

      try
      {
         JobDetail jobDetail = new JobDetail(quartzSpec.getJobName(), quartzSpec.getJobGroup(), clazz, true, false, false);
         jobDetail.getJobDataMap().setAllowsTransientData(true);
         jobDetail.getJobDataMap().put("endpointFactory", endpointFactory);
         log.debug("adding job: " + quartzSpec);
         CronTrigger trigger = new CronTrigger(quartzSpec.getTriggerName(), quartzSpec.getTriggerGroup(), quartzSpec.getCronTrigger());
         sched.scheduleJob(jobDetail, trigger);
      }
      catch (Exception e)
View Full Code Here

Examples of org.quartz.JobDetail

    log4JLogger.addAppender(writerAppender);
    updateLogViewFromWriter();
    // Add job to read from the string writer every second
    try {
      jobName = "Log_Displayer_Job_" + this.hashCode();
      jobDetail = new JobDetail(jobName, LOG_DISPLAYER_GROUP, NoOpJob.class);
      jobDetail.addJobListener(jobName);
      CronTrigger trigger = new CronTrigger();
      trigger.setName(jobName);
      trigger.setGroup(LOG_DISPLAYER_GROUP);
      trigger.setCronExpression("* * * * * ?");
 
View Full Code Here

Examples of org.quartz.JobDetail

        } catch (SchedulerException e) {
          log_.warn("refreshUIState: Got a SchedulerException while asking for the updateStatisticsTrigger's state", e);
        }
      }
      CronTriggerBean triggerBean = (CronTriggerBean) CoreSpringFactory.getBean("updateStatisticsTrigger");
      JobDetail jobDetail = triggerBean.getJobDetail();
      enabled &= jobDetail.getName().equals("org.olat.statistics.job.enabled");
      log_.info("refreshUIState: org.olat.statistics.job.enabled check, enabled now: "+enabled);
      cronExpression = triggerBean.getCronExpression();
      StatisticUpdateManager statisticUpdateManager = getStatisticUpdateManager();
      if (statisticUpdateManager==null) {
        log_.info("refreshUIState: statisticUpdateManager not configured");
View Full Code Here

Examples of org.quartz.JobDetail

    // create a crontrigger inside because cron expression is random generated -> this can not be done by config? REVIEW:gs:
    Scheduler scheduler = (Scheduler) CoreSpringFactory.getBean("schedulerFactoryBean");
    String cronExpression = "ERROR";
    try {
      // Create job with cron trigger configuration
      JobDetail jobDetail = new JobDetail(SCHEDULER_NAME, Scheduler.DEFAULT_GROUP, SystemRegistrationJob.class);
      CronTrigger trigger = new CronTrigger();
      trigger.setName("system_registration_trigger");
      cronExpression = persitedProperties.getStringPropertyValue(CONF_KEY_REGISTRATION_CRON, true);
      if (!CronExpression.isValidExpression(cronExpression)) {
        cronExpression = createCronTriggerExpression();
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.