Examples of JobDetail


Examples of org.quartz.JobDetail

    //FIXME: move this to spring and add a delay otherwise the job may accesses the database and the database it not yet ready, see examples in spring with jobs
    // Use scheduler from spring config
    Scheduler scheduler = (Scheduler) CoreSpringFactory.getBean("schedulerFactoryBean");
    try {
      // Create job with cron trigger configuration
      JobDetail jobDetail = new JobDetail("LDAP_Cron_Syncer_Job", Scheduler.DEFAULT_GROUP, LDAPUserSynchronizerJob.class);
      CronTrigger trigger = new CronTrigger();
      trigger.setName("LDAP_Cron_Syncer_Trigger");
      trigger.setCronExpression(ldapSyncCronSyncExpression);
      // Schedule job now
      scheduler.scheduleJob(jobDetail, trigger);
View Full Code Here

Examples of org.quartz.JobDetail

  void captureScreenStart(){
    try {
     
      System.err.println("captureScreenStart");
     
      JobDetail jobDetail = new JobDetail(ConnectionBean.quartzScreenJobName, Scheduler.DEFAULT_GROUP, ScreenJob.class);
     
      Trigger trigger = TriggerUtils.makeSecondlyTrigger(ConnectionBean.intervallSeconds);
      trigger.setStartTime(new Date());
      trigger.setName("myTrigger");
     
View Full Code Here

Examples of org.quartz.JobDetail

   *
   * @return the simple trigger
   */
  private MySimpleTrigger getSimpleTrigger(String key)
  {
    JobDetail jobDetail = new JobDetail();
    JobDataMap jobDataMap = new JobDataMap();
    jobDataMap.put("process", _wp);
    jobDetail.setJobDataMap(jobDataMap);

    Class jobClass = getJobClass(key);
    if (jobClass == null)
      return null;
    jobDetail.setJobClass(jobClass);
    jobDetail.setName(key);

    MySimpleTrigger trigger = new MySimpleTrigger(jobDetail);
    Date startTime = getStartTime(key);
    if (startTime != null)
    {
View Full Code Here

Examples of org.quartz.JobDetail

   *
   * @return the cron trigger
   */
  private MyCronTrigger getCronTrigger(String key)
  {
    JobDetail jobDetail = new JobDetail();
    JobDataMap jobDataMap = new JobDataMap();
    jobDataMap.put("process", _wp);
    jobDetail.setJobDataMap(jobDataMap);
    jobDetail.setName(key);

    Class jobClass = getJobClass(key);
    if (jobClass == null)
      return null;
    jobDetail.setJobClass(jobClass);

    MyCronTrigger trigger = new MyCronTrigger(jobDetail);
    CronExpression cronExpression = getCronExpression(key);
    if (cronExpression != null)
    {
View Full Code Here

Examples of org.quartz.JobDetail

   *
   * @return the simple trigger
   */
  private MySimpleTrigger getSimpleTrigger(String key)
  {
    JobDetail jobDetail = new JobDetail();
    JobDataMap jobDataMap = new JobDataMap();
    jobDataMap.put("process", _wp);
    jobDetail.setJobDataMap(jobDataMap);

    Class jobClass = getJobClass(key);
    if (jobClass == null)
      return null;
    jobDetail.setJobClass(jobClass);
    jobDetail.setName(key);

    MySimpleTrigger trigger = new MySimpleTrigger(jobDetail);
    Date startTime = getStartTime(key);
    if (startTime != null)
    {
View Full Code Here

Examples of org.quartz.JobDetail

   *
   * @return the cron trigger
   */
  private MyCronTrigger getCronTrigger(String key)
  {
    JobDetail jobDetail = new JobDetail();
    JobDataMap jobDataMap = new JobDataMap();
    jobDataMap.put("process", _wp);
    jobDetail.setJobDataMap(jobDataMap);
    jobDetail.setName(key);

    Class jobClass = getJobClass(key);
    if (jobClass == null)
      return null;
    jobDetail.setJobClass(jobClass);

    MyCronTrigger trigger = new MyCronTrigger(jobDetail);
    CronExpression cronExpression = getCronExpression(key);
    if (cronExpression != null)
    {
View Full Code Here

Examples of org.quartz.JobDetail

        if (resources == null) {
            resources = new HashMap<String, Object>();
        }

        JobDetail jobDetail = new JobDetail();
        jobDetail.setJobClass(jobClass);

        String name = taskDescription.getName();
        if (name == null || "".equals(name)) {
            throw new SynapseTaskException("Name cannot be found.", log);
        }
        jobDetail.setName(name);


        String group = taskDescription.getGroup();
        if (group != null && !"".equals(group)) {
            jobDetail.setGroup(group);
        } else {
            jobDetail.setGroup(TaskDescription.DEFAULT_GROUP);
        }

        JobDataMap jobDataMap = new JobDataMap(resources);

        String className = taskDescription.getTaskClass();
        if (className != null && !"".equals(className)) {
            jobDataMap.put(TaskDescription.CLASSNAME, className);
        }

        Set xmlProperties = taskDescription.getProperties();
        if (xmlProperties != null) {
            jobDataMap.put(TaskDescription.PROPERTIES, xmlProperties);
        }
        jobDetail.setJobDataMap(jobDataMap);

        return jobDetail;
    }
View Full Code Here

Examples of org.quartz.JobDetail

                    try {
                        final List<String> groups = s.getJobGroupNames();
                        for(final String group : groups) {
                            final Set<JobKey> keys = s.getJobKeys(GroupMatcher.jobGroupEquals(group));
                            for(final JobKey key : keys) {
                                final JobDetail detail = s.getJobDetail(key);
                                final String jobName = (String) detail.getJobDataMap().get(QuartzScheduler.DATA_MAP_NAME);
                                final Object job = detail.getJobDataMap().get(QuartzScheduler.DATA_MAP_OBJECT);

                                if ( jobName != null && job != null ) {
                                    final Long jobBundleId = (Long) detail.getJobDataMap().get(QuartzScheduler.DATA_MAP_BUNDLE_ID);
                                    if ( jobBundleId != null && jobBundleId.equals(bundleId) ) {
                                        s.deleteJob(key);
                                        this.logger.debug("Unscheduling job with name {}", jobName);
                                    }
                                }
View Full Code Here

Examples of org.quartz.JobDetail

     * @return
     */
    private JobDetail createJobDetail(final String name,
                                        final JobDataMap jobDataMap,
                                        final boolean concurrent) {
        final JobDetail detail = JobBuilder.newJob((concurrent ? QuartzJobExecutor.class : NonParallelQuartzJobExecutor.class))
                .withIdentity(name)
                .usingJobData(jobDataMap)
                .build();
        return detail;
    }
View Full Code Here

Examples of org.quartz.JobDetail

        final org.quartz.Scheduler s = this.scheduler;
        if ( jobName != null && s != null ) {
            synchronized ( this ) {
                try {
                    final JobKey key = JobKey.jobKey(jobName);
                    final JobDetail jobdetail = s.getJobDetail(key);
                    if (jobdetail != null) {
                        s.deleteJob(key);
                        this.logger.debug("Unscheduling job with name {}", jobName);
                        return true;
                    }
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.