Package org.quartz

Examples of org.quartz.JobDataMap


            atrigger.setJobName(OPENEJB_TIMEOUT_JOB_NAME);
            atrigger.setJobGroup(OPENEJB_TIMEOUT_JOB_GROUP_NAME);
        } else {
            throw new OpenEJBRuntimeException("the trigger was not an AbstractTrigger - it shouldn't be possible");
        }
        JobDataMap triggerDataMap = trigger.getJobDataMap();
        triggerDataMap.put(EjbTimeoutJob.EJB_TIMERS_SERVICE, this);
        triggerDataMap.put(EjbTimeoutJob.TIMER_DATA,timerData);
        try {
            scheduler.scheduleJob(trigger);
        } catch (Exception e) {
            //TODO Any other actions we could do ?
            log.warning("Could not schedule timer " + timerData, e);
View Full Code Here


        }
    }

    private void updateJobDataMap(JobDetail jobDetail) {
        // Store this camelContext name into the job data
        JobDataMap jobDataMap = jobDetail.getJobDataMap();
        String camelContextName = QuartzHelper.getQuartzContextName(getCamelContext());
        String endpointUri = getEndpointUri();
        LOG.debug("Adding camelContextName={}, endpointUri={} into job data map.", camelContextName, endpointUri);
        jobDataMap.put(QuartzConstants.QUARTZ_CAMEL_CONTEXT_NAME, camelContextName);
        jobDataMap.put(QuartzConstants.QUARTZ_ENDPOINT_URI, endpointUri);
    }
View Full Code Here

        }
    }

    private void updateJobDataMap(JobDetail jobDetail) {
        // Store this camelContext name into the job data
        JobDataMap jobDataMap = jobDetail.getJobDataMap();
        String camelContextName = QuartzHelper.getQuartzContextName(getCamelContext());
        String endpointUri = getEndpointUri();
        LOG.debug("Adding camelContextName={}, endpointUri={} into job data map.", camelContextName, endpointUri);
        jobDataMap.put(QuartzConstants.QUARTZ_CAMEL_CONTEXT_NAME, camelContextName);
        jobDataMap.put(QuartzConstants.QUARTZ_ENDPOINT_URI, endpointUri);
    }
View Full Code Here

        }
    }

    private void updateJobDataMap(JobDetail jobDetail) {
        // Store this camelContext name into the job data
        JobDataMap jobDataMap = jobDetail.getJobDataMap();
        String camelContextName = QuartzHelper.getQuartzContextName(getCamelContext());
        String endpointUri = getEndpointUri();
        LOG.debug("Adding camelContextName={}, endpointUri={} into job data map.", camelContextName, endpointUri);
        jobDataMap.put(QuartzConstants.QUARTZ_CAMEL_CONTEXT_NAME, camelContextName);
        jobDataMap.put(QuartzConstants.QUARTZ_ENDPOINT_URI, endpointUri);
    }
View Full Code Here

     * @throws SchedulerException when something went wrong.
     */
    public JobDataMap createJobData(HttpServletRequest request)
        throws SchedulerException {
        log.debug("Creating job data map:");
        JobDataMap map = super.createJobData(request);

        Enumeration parameters = request.getParameterNames();
        Map wrapperMap = new HashMap();
        while (parameters.hasMoreElements()) {
            String key = (String) parameters.nextElement();
            Object value;
            String[] values = request.getParameterValues(key);
            if (values.length == 1) {
                value = values[0];
            }
            else {
                value = values;
            }
            wrapperMap.put(key, value);
        }

        map.putAll(stripPrefixes(wrapperMap));
        return map;
    }
View Full Code Here

       
        NamespaceHelper helper = SchedulerStore.getNamespaceHelper();
        DefaultTaskWrapper wrapper = new DefaultTaskWrapper(helper, jobElement);
        wrapper.getTaskParameters().setServletContextPath(servletContextPath);
       
        JobDataMap map = new JobDataMap(wrapper.getParameters());
        jobDetail.setJobDataMap(map);
       
        return jobDetail;
    }
View Full Code Here

            // FIXME: more flexible
            Class jobClass = TaskJob.class;

            ServletJob job = ServletJobFactory.createJob(jobClass);
            JobDataMap map = job.createJobData(request);

            addJob(jobGroup, startTime, jobClass, map);
        } catch (Exception e) {
            log.error("Adding job failed: ", e);
            throw new SchedulerException(e);
View Full Code Here

     * @return A job data map.
     * @throws SchedulerException when something went wrong.
     */
    public JobDataMap createJobData(HttpServletRequest request)
        throws SchedulerException {
        JobDataMap map = new JobDataMap();
        String key = NamespaceMap.getFullName(LoadQuartzServlet.PREFIX, PARAMETER_DOCUMENT_URL);
        String documentUrl = request.getParameter(key);
        if (documentUrl == null) {
            throw new SchedulerException("Document URL must not be null!");
        }
        map.put(key, documentUrl);
        return map;
    }
View Full Code Here

     * Returns the document URL of a certain job.
     * @param jobDetail The job detail.
     * @return A string.
     */
    public String getDocumentUrl(JobDetail jobDetail) {
        JobDataMap map = jobDetail.getJobDataMap();
        NamespaceMap wrapper = new NamespaceMap(map, LoadQuartzServlet.PREFIX);
        String documentUrl = (String) wrapper.get(PARAMETER_DOCUMENT_URL);
        return documentUrl;
    }
View Full Code Here

     * 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

TOP

Related Classes of org.quartz.JobDataMap

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.