Examples of JobDataMap


Examples of org.quartz.JobDataMap

     * Sets the document URL of a job.
     * @param jobDetail The job detail.
     * @param url The URL.
     */
    public void setDocumentUrl(JobDetail jobDetail, String url) {
        JobDataMap map = jobDetail.getJobDataMap();
        NamespaceMap wrapper = new NamespaceMap(map, LoadQuartzServlet.PREFIX);
        wrapper.put(PARAMETER_DOCUMENT_URL, url);
        jobDetail.setJobDataMap(map);
    }
View Full Code Here

Examples of org.quartz.JobDataMap

        } else {
            name = "Sling Quartz Scheduler " + UUID.randomUUID().toString();
        }

        // create the data map
        final JobDataMap jobDataMap = this.initDataMap(name, job, config, canRunConcurrently);

        final JobDetail detail = this.createJobDetail(name, jobDataMap);

        this.logger.debug("Scheduling job {} with name {} and trigger {}", new Object[] {job, name, trigger});
        this.scheduler.scheduleJob(detail, trigger);
View Full Code Here

Examples of org.quartz.JobDataMap

     */
    protected JobDataMap initDataMap(String  jobName,
                                     Object  job,
                                     Map<String, Serializable> config,
                                     boolean concurent) {
        final JobDataMap jobDataMap = new JobDataMap();

        jobDataMap.put(DATA_MAP_OBJECT, job);

        jobDataMap.put(DATA_MAP_NAME, jobName);
        jobDataMap.put(DATA_MAP_RUN_CONCURRENT, (concurent? Boolean.TRUE: Boolean.FALSE));
        jobDataMap.put(DATA_MAP_LOGGER, this.logger);
        if ( config != null ) {
            jobDataMap.put(DATA_MAP_CONFIGURATION, config);
        }

        return jobDataMap;
    }
View Full Code Here

Examples of org.quartz.JobDataMap

     */
    public void fireJob(Object job, Map<String, Serializable> config)
    throws Exception {
        this.checkJob(job);
        final String name = job.getClass().getName();
        final JobDataMap dataMap = this.initDataMap(name, job, config, true);

        final JobDetail detail = this.createJobDetail(name, dataMap);

        final Trigger trigger = new SimpleTrigger(name, DEFAULT_QUARTZ_JOB_GROUP);
        this.scheduler.scheduleJob(detail, trigger);
View Full Code Here

Examples of org.quartz.JobDataMap

    /**
     * @see org.quartz.Job#execute(org.quartz.JobExecutionContext)
     */
    public void execute(final JobExecutionContext context) throws JobExecutionException {

        final JobDataMap data = context.getJobDetail().getJobDataMap();

        final Boolean canRunConcurrentlyB = ((Boolean) data.get(QuartzScheduler.DATA_MAP_RUN_CONCURRENT));
        final boolean canRunConcurrently = ((canRunConcurrentlyB == null) ? true : canRunConcurrentlyB.booleanValue());

        if (!canRunConcurrently) {
            Boolean isRunning = (Boolean) data.get(QuartzScheduler.DATA_MAP_KEY_ISRUNNING);
            if (Boolean.TRUE.equals(isRunning)) {
                return;
            }
        }

        this.setup(data);

        final Object job = data.get(QuartzScheduler.DATA_MAP_OBJECT);
        final Logger logger = (Logger)data.get(QuartzScheduler.DATA_MAP_LOGGER);

        try {
            logger.debug("Executing job {} with name {}", job, data.get(QuartzScheduler.DATA_MAP_NAME));
            if (job instanceof org.apache.sling.commons.scheduler.Job) {
                @SuppressWarnings("unchecked")
                final Map<String, Serializable> configuration = (Map<String, Serializable>) data.get(QuartzScheduler.DATA_MAP_CONFIGURATION);
                final String name = (String) data.get(QuartzScheduler.DATA_MAP_NAME);

                final JobContext jobCtx = new JobContextImpl(name, configuration);
                ((org.apache.sling.commons.scheduler.Job) job).execute(jobCtx);
            } else if (job instanceof Runnable) {
                ((Runnable) job).run();
View Full Code Here

Examples of org.quartz.JobDataMap

                try {
                    jobInstanceLoader.registerJob(task,
                            ((SchedTask) task).getJobClassName(),
                            ((SchedTask) task).getCronExpression());

                    JobDataMap map = new JobDataMap();
                    map.put(AbstractTaskJob.DRY_RUN_JOBDETAIL_KEY, dryRun);

                    scheduler.getScheduler().triggerJob(
                            new JobKey(JobInstanceLoader.getJobName(task), Scheduler.DEFAULT_GROUP), map);
                } catch (Exception e) {
                    LOG.error("While executing task {}", task, e);
View Full Code Here

Examples of org.quartz.JobDataMap

    public void populateNormalizedMessage(NormalizedMessage message, JobExecutionContext context)
        throws JobExecutionException, MessagingException {

        JobDetail detail = context.getJobDetail();
        JobDataMap dataMap = detail.getJobDataMap();
        for (Iterator iter = dataMap.entrySet().iterator(); iter.hasNext();) {
            Map.Entry entry = (Map.Entry) iter.next();
            String key = (String) entry.getKey();
            if (!key.equals(ServiceMixJob.COMPONENT_NAME) && !key.equals(ServiceMixJob.ENDPOINT_NAME)) {
                Object value = entry.getValue();
                message.setProperty(key, value);
View Full Code Here

Examples of org.quartz.JobDataMap

            // Give the job a name
            jobDetail.setName(name);
            jobDetail.setGroup("synapse.simple.quartz");
            jobDetail.setJobClass(SimpleQuartzJob.class);
            JobDataMap jdm = new JobDataMap();
            jdm.put(SimpleQuartzJob.SYNAPSE_ENVIRONMENT, synapseEnvironment);
            jdm.put(SimpleQuartzJob.CLASSNAME, className);
            jdm.put(SimpleQuartzJob.PROPERTIES, xmlProperties);
            jobDetail.setJobDataMap(jdm);

            sch.scheduleJob(jobDetail, trigger);
            sch.start();
            log.info("Scheduled job " + jobDetail.getFullName() + " for class " + className);
View Full Code Here

Examples of org.quartz.JobDataMap

            LOG.debug("Triggering a new execution of report {}", report);

            try {
                jobInstanceLoader.registerJob(report);

                JobDataMap map = new JobDataMap();
                scheduler.getScheduler().triggerJob(JobInstanceLoader.getJobName(report), Scheduler.DEFAULT_GROUP, map);

                auditManager.audit(Category.report, ReportSubCategory.execute, Result.success,
                        "Successfully started execution for report: " + report.getId());
            } catch (Exception e) {
View Full Code Here

Examples of org.quartz.JobDataMap

        {
            log.info( "Not scheduling " + schedule.getName() );
            return;
        }

        JobDataMap dataMap = new JobDataMap();

        dataMap.put( "continuum", continuum );

        dataMap.put( AbstractJob.LOGGER, log );

        dataMap.put( ContinuumSchedulerConstants.SCHEDULE, schedule );

        // the name + group makes the job unique

        JobDetail jobDetail = new JobDetail( schedule.getName(), group, jobClass );
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.