Package org.quartz

Examples of org.quartz.JobDataMap


        }
    }

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        final JobDataMap jobDataMap = context.getMergedJobDataMap();

        unscheduleJob(jobDataMap);

        // On a best effort basic, ask the relevant agents that their next avail report be full, so that we get
        // the current avail type for the newly enabled resources.  If we can't contact the agent don't worry about
        // it; if it's down we'll get a full report when it comes up.
        AgentManagerLocal agentManager = LookupUtil.getAgentManager();
        for (Agent agent : internalizeJobValues((String) jobDataMap.get(AGENTS))) {
            try {
                AgentClient agentClient = agentManager.getAgentClient(agent);
                agentClient.getDiscoveryAgentService().requestFullAvailabilityReport();
            } catch (Throwable t) {
                if (log.isDebugEnabled()) {
View Full Code Here


        SubjectManagerLocal subjectMgr = LookupUtil.getSubjectManager();
        return subjectMgr.getOverlord();
    }

    private int getResourceId(JobDetail jobDetail) {
        JobDataMap jobDataMap = jobDetail.getJobDataMap();
        return jobDataMap.getIntFromString(DATAMAP_INT_RESOURCE_ID);
    }
View Full Code Here

    public void createJobDataMap() throws Exception {
        // Setup
        String repoName = "testRepo";
        Repo repo = new Repo(repoName);

        JobDataMap existingMap = new JobDataMap();
        JobDetail detail = new JobDetail();
        detail.setJobDataMap(existingMap);

        // Test
        JobDataMap nullDetailsMap = RepoSyncJob.createJobDataMap(null, repo);
        JobDataMap existingDetailsMap = RepoSyncJob.createJobDataMap(detail, repo);

        // Verify
        assert nullDetailsMap.getString(RepoSyncJob.KEY_REPO_NAME).equals(repoName);

        assert existingDetailsMap.getString(RepoSyncJob.KEY_REPO_NAME).equals(repoName);
        assert existingDetailsMap == existingMap;
    }
View Full Code Here

            MessageEndpoint endpoint = messageEndpointFactory.createEndpoint(null);
            spec.setEndpoint(endpoint);

            Job job = (Job) endpoint;

            JobDataMap jobDataMap = spec.getDetail().getJobDataMap();
            jobDataMap.setAllowsTransientData(true);
            jobDataMap.put(Data.class.getName(), new Data(job));

            scheduler.scheduleJob(spec.getDetail(), spec.getTrigger());
        } catch (SchedulerException e) {
            throw new ResourceException("Failed to schedule job", e);
        }
View Full Code Here

            MessageEndpoint endpoint = null;

            try {

                JobDataMap jobDataMap = execution.getJobDetail().getJobDataMap();

                Data data = Data.class.cast(jobDataMap.get(Data.class.getName()));

                Job job = data.job;

                endpoint = (MessageEndpoint) job;
View Full Code Here

        removeTransientData(job);
        return delegate.updateJobData(conn, job);
    }

    private void removeTransientData(JobDetail job) {
        JobDataMap map = job.getJobDataMap();
        if (map != null) {
            this.logger.debug("QuartzDriverDelegate: Removing transient data");
            map.remove(QuartzJobScheduler.DATA_MAP_LOGGER);
            map.remove(QuartzJobScheduler.DATA_MAP_CONTEXT);
            map.remove(QuartzJobScheduler.DATA_MAP_MANAGER);
        }
    }
View Full Code Here

    public JobDetail selectJobDetail(Connection conn, String jobName,
                                     String groupName, ClassLoadHelper loadHelper)
    throws ClassNotFoundException, IOException, SQLException {
        JobDetail job = delegate.selectJobDetail(conn, jobName, groupName, loadHelper);
        if (job != null) {
            JobDataMap map = job.getJobDataMap();
            if (map != null) {
                this.logger.debug("QuartzDriverDelegate: Adding transient data");
                map.put(QuartzJobScheduler.DATA_MAP_LOGGER, this.logger);
                map.put(QuartzJobScheduler.DATA_MAP_CONTEXT, this.context);
                map.put(QuartzJobScheduler.DATA_MAP_MANAGER, this.manager);
            }
        }
        return job;
    }
View Full Code Here

  {
    log.debug("Scheduled Report Executing....");
       
        ApplicationContext appContext = init(context);
           
    JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();

    ReportSchedule reportSchedule =
      (ReportSchedule) jobDataMap.get(ORStatics.REPORT_SCHEDULE);
    reportSchedule.setScheduleDescription(context.getJobDetail().getDescription());

    Report report = reportSchedule.getReport();
    ReportUser user = reportSchedule.getUser();
    Map<String,Object> reportParameters = reportSchedule.getReportParameters();
View Full Code Here

     */
    @Override
    public void execute( JobExecutionContext context )
        throws JobExecutionException
    {
        JobDataMap dataMap = context.getJobDetail().getJobDataMap();
        setJobDataMap( dataMap );

        TaskQueue taskQueue = (TaskQueue) dataMap.get( DefaultRepositoryArchivaTaskScheduler.TASK_QUEUE );

        String repositoryId = (String) dataMap.get( DefaultRepositoryArchivaTaskScheduler.TASK_REPOSITORY );
        RepositoryTask task = new RepositoryTask();
        task.setRepositoryId( repositoryId );

        try
        {
View Full Code Here

            log.warn( "Cron expression [{}] for repository [{}] is invalid.  Defaulting to hourly.", cronString,
                      repoConfig.getId() );
            cronString = CRON_HOURLY;
        }

        JobDataMap jobDataMap = new JobDataMap( );
        jobDataMap.put( TASK_QUEUE, repositoryScanningQueue );
        jobDataMap.put( TASK_REPOSITORY, repoConfig.getId() );

        // setup the unprocessed artifact job
        JobDetail repositoryJob = JobBuilder.newJob( RepositoryTaskJob.class )
                                        .withIdentity( REPOSITORY_JOB + ":" + repoConfig.getId(), REPOSITORY_SCAN_GROUP )
                                        .setJobData( jobDataMap )
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.