当前位置: 首页>>代码示例>>Java>>正文


Java TriggerFiredBundle类代码示例

本文整理汇总了Java中org.quartz.spi.TriggerFiredBundle的典型用法代码示例。如果您正苦于以下问题:Java TriggerFiredBundle类的具体用法?Java TriggerFiredBundle怎么用?Java TriggerFiredBundle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TriggerFiredBundle类属于org.quartz.spi包,在下文中一共展示了TriggerFiredBundle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initJob

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
protected void initJob(TriggerFiredBundle bundle, Object job) {
	// The following code is copied from SpringBeanJobFactory in spring-context-support-4.2.5.RELEASE
	BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(job);
	if (isEligibleForPropertyPopulation(bw.getWrappedInstance())) {
		MutablePropertyValues pvs = new MutablePropertyValues();
		if (schedulerContext != null) {
			pvs.addPropertyValues(this.schedulerContext);
		}
		pvs.addPropertyValues(bundle.getJobDetail().getJobDataMap());
		pvs.addPropertyValues(bundle.getTrigger().getJobDataMap());
		if (this.ignoredUnknownProperties != null) {
			for (String propName : this.ignoredUnknownProperties) {
				if (pvs.contains(propName) && !bw.isWritableProperty(propName)) {
					pvs.removePropertyValue(propName);
				}
			}
			bw.setPropertyValues(pvs);
		}
		else {
			bw.setPropertyValues(pvs, true);
		}
	}
}
 
开发者ID:xtianus,项目名称:yadaframework,代码行数:24,代码来源:YadaQuartzJobFactory.java

示例2: createJobInstance

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
/**
 * Create the job instance, populating it with property values taken
 * from the scheduler context, job data map and trigger data map.
 */
@Override
protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception {
	Object job = super.createJobInstance(bundle);
	BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(job);
	if (isEligibleForPropertyPopulation(bw.getWrappedInstance())) {
		MutablePropertyValues pvs = new MutablePropertyValues();
		if (this.schedulerContext != null) {
			pvs.addPropertyValues(this.schedulerContext);
		}
		pvs.addPropertyValues(bundle.getJobDetail().getJobDataMap());
		pvs.addPropertyValues(bundle.getTrigger().getJobDataMap());
		if (this.ignoredUnknownProperties != null) {
			for (String propName : this.ignoredUnknownProperties) {
				if (pvs.contains(propName) && !bw.isWritableProperty(propName)) {
					pvs.removePropertyValue(propName);
				}
			}
			bw.setPropertyValues(pvs);
		}
		else {
			bw.setPropertyValues(pvs, true);
		}
	}
	return job;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:30,代码来源:SpringBeanJobFactory.java

示例3: createJobInstance

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
/**
 * Create the job instance, populating it with property values taken
 * from the scheduler context, job data map and trigger data map.
 */
@Override
protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception {
	Object job = super.createJobInstance(bundle);
	BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(job);
	if (isEligibleForPropertyPopulation(bw.getWrappedInstance())) {
		MutablePropertyValues pvs = new MutablePropertyValues();
		if (this.schedulerContext != null) {
			pvs.addPropertyValues(this.schedulerContext);
		}
		pvs.addPropertyValues(getJobDetailDataMap(bundle));
		pvs.addPropertyValues(getTriggerDataMap(bundle));
		if (this.ignoredUnknownProperties != null) {
			for (String propName : this.ignoredUnknownProperties) {
				if (pvs.contains(propName) && !bw.isWritableProperty(propName)) {
					pvs.removePropertyValue(propName);
				}
			}
			bw.setPropertyValues(pvs);
		}
		else {
			bw.setPropertyValues(pvs, true);
		}
	}
	return job;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:SpringBeanJobFactory.java

示例4: newJob

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
public Job newJob(TriggerFiredBundle bundle, Scheduler Scheduler) throws SchedulerException {

        JobDetail jobDetail = bundle.getJobDetail();
        Class<? extends Job> jobClass = jobDetail.getJobClass();
        try {
            if(log.isDebugEnabled()) {
                log.debug(
                    "Producing instance of Job '" + jobDetail.getKey() + 
                    "', class=" + jobClass.getName());
            }
            
            return jobClass.newInstance();
        } catch (Exception e) {
            SchedulerException se = new SchedulerException(
                    "Problem instantiating class '"
                            + jobDetail.getJobClass().getName() + "'", e);
            throw se;
        }
    }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:SimpleJobFactory.java

示例5: JobExecutionContextImpl

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
/**
 * <p>
 * Create a JobExcecutionContext with the given context data.
 * </p>
 */
public JobExecutionContextImpl(Scheduler scheduler,
        TriggerFiredBundle firedBundle, Job job) {
    this.scheduler = scheduler;
    this.trigger = firedBundle.getTrigger();
    this.calendar = firedBundle.getCalendar();
    this.jobDetail = firedBundle.getJobDetail();
    this.job = job;
    this.recovering = firedBundle.isRecovering();
    this.fireTime = firedBundle.getFireTime();
    this.scheduledFireTime = firedBundle.getScheduledFireTime();
    this.prevFireTime = firedBundle.getPrevFireTime();
    this.nextFireTime = firedBundle.getNextFireTime();
    
    this.jobDataMap = new JobDataMap();
    this.jobDataMap.putAll(jobDetail.getJobDataMap());
    this.jobDataMap.putAll(trigger.getJobDataMap());
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:JobExecutionContextImpl.java

示例6: newJob

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
public Job newJob(TriggerFiredBundle bundle) throws SchedulerException {

        JobDetail jobDetail = bundle.getJobDetail();
        Class jobClass = jobDetail.getJobClass();
        try {
            if(log.isDebugEnabled()) {
                log.debug(
                    "Producing instance of Job '" + jobDetail.getFullName() + 
                    "', class=" + jobClass.getName());
            }
            
            return (Job) jobClass.newInstance();
        } catch (Exception e) {
            SchedulerException se = new SchedulerException(
                    "Problem instantiating class '"
                            + jobDetail.getJobClass().getName() + "'", e);
            throw se;
        }
    }
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:20,代码来源:SimpleJobFactory.java

示例7: JobExecutionContext

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
/**
 * <p>
 * Create a JobExcecutionContext with the given context data.
 * </p>
 */
public JobExecutionContext(Scheduler scheduler,
        TriggerFiredBundle firedBundle, Job job) {
    this.scheduler = scheduler;
    this.trigger = firedBundle.getTrigger();
    this.calendar = firedBundle.getCalendar();
    this.jobDetail = firedBundle.getJobDetail();
    this.job = job;
    this.recovering = firedBundle.isRecovering();
    this.fireTime = firedBundle.getFireTime();
    this.scheduledFireTime = firedBundle.getScheduledFireTime();
    this.prevFireTime = firedBundle.getPrevFireTime();
    this.nextFireTime = firedBundle.getNextFireTime();
    
    this.jobDataMap = new JobDataMap();
    this.jobDataMap.putAll(jobDetail.getJobDataMap());
    this.jobDataMap.putAll(trigger.getJobDataMap());
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:23,代码来源:JobExecutionContext.java

示例8: newJob

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
@Override
public Job newJob(final TriggerFiredBundle bundle, final Scheduler scheduler) throws SchedulerException {
    Preconditions.checkNotNull(applicationContext, "applicationContext cannot be null, should call setApplicationContext first.");
    Job job = null;
    try {
        for (Job each : applicationContext.getBeansOfType(Job.class).values()) {
            if (AopUtils.getTargetClass(each) == bundle.getJobDetail().getJobClass()) {
                job = each;
                break;
            }
        }
        if (null == job) {
            throw new NoSuchBeanDefinitionException("");
        }
    } catch (final BeansException ex) {
        log.info("Elastic job: cannot found bean for class: '{}'. This job is not managed for spring.", bundle.getJobDetail().getJobClass().getCanonicalName());
        return super.newJob(bundle, scheduler);
    }
    JobDataMap jobDataMap = new JobDataMap();
    jobDataMap.putAll(scheduler.getContext());
    jobDataMap.putAll(bundle.getJobDetail().getJobDataMap());
    jobDataMap.putAll(bundle.getTrigger().getJobDataMap());
    Job target = (Job) AopTargetUtils.getTarget(job);
    setBeanProps(target, jobDataMap);
    return target;
}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:27,代码来源:SpringJobFactory.java

示例9: newJob

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
@Override
public Job newJob(TriggerFiredBundle arg0, Scheduler arg1) throws SchedulerException {
	JobDataMap data = arg0.getJobDetail().getJobDataMap();
	ExecutionRunnable task;
	Execution execution;
	if(data.containsKey(Executor.EXECUTION_ID)) {
		String executionID = data.getString(Executor.EXECUTION_ID);
		execution = context.getExecutionAccessor().get(executionID);
	} else {
		String executionTaskID = data.getString(Executor.EXECUTION_TASK_ID);
		ExecutionParameters executionParams = (ExecutionParameters) data.get(Executor.EXECUTION_PARAMETERS);
		execution = executionRunnableFactory.createExecution(executionParams, executionTaskID);			
	}
	task = executionRunnableFactory.newExecutionRunnable(execution);
	
	ExecutionJob job = new ExecutionJob(task);
	return job;
}
 
开发者ID:denkbar,项目名称:step,代码行数:19,代码来源:ExecutionJobFactory.java

示例10: newJob

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
@Override
public Job newJob(TriggerFiredBundle bundle, Scheduler scheduler) throws SchedulerException {
    final Job job = super.newJob(bundle, scheduler);
    Injections.inject(job, servletContext, null);
    return new Job() {
        @Override
        public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
            job.execute(jobExecutionContext);
            try {
                //In a different class to make the database module optional at runtime
                SessionCleaner.closeSessions(servletContext);
            } catch (NoClassDefFoundError e) {
                logger.debug("Database module not available, not closing sessions", e);
            }
        }
    };
}
 
开发者ID:ManyDesigns,项目名称:Portofino,代码行数:18,代码来源:PortofinoJobFactory.java

示例11: newJob

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
@Override
public Job newJob(final TriggerFiredBundle triggerFiredBundle, final Scheduler schdlr) throws SchedulerException {
    // Get the job detail so we can get the job class
    final JobDetail jobDetail = triggerFiredBundle.getJobDetail();
    final Class jobClass = jobDetail.getJobClass();

    try {
        // Get a new instance of that class from Guice so we can do dependency injection
        return (Job) injector.getInstance(jobClass);
    } catch (Exception e) {
        // Something went wrong.  Print out the stack trace here so SLF4J doesn't hide it.
        LOGGER.error("Problem with building job.", e);

        // Rethrow the exception as an UnsupportedOperationException
        throw new UnsupportedOperationException(e);
    }
}
 
开发者ID:SoftTeco,项目名称:st-toolset,代码行数:18,代码来源:GuiceJobFactory.java

示例12: createJobInstance

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
@Override
protected Object createJobInstance(final TriggerFiredBundle bundle) throws Exception {
    Object job = beanFactory.getBean(bundle.getJobDetail().getKey().getName());
    if (isEligibleForPropertyPopulation(job)) {
        BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(job);
        MutablePropertyValues pvs = new MutablePropertyValues();
        if (this.schedulerContext != null) {
            pvs.addPropertyValues(this.schedulerContext);
        }
        pvs.addPropertyValues(bundle.getJobDetail().getJobDataMap());
        pvs.addPropertyValues(bundle.getTrigger().getJobDataMap());
        if (this.ignoredUnknownProperties != null) {
            for (String propName : this.ignoredUnknownProperties) {
                if (pvs.contains(propName) && !bw.isWritableProperty(propName)) {
                    pvs.removePropertyValue(propName);
                }
            }
            bw.setPropertyValues(pvs);
        } else {
            bw.setPropertyValues(pvs, true);
        }
    }
    return job;
}
 
开发者ID:apache,项目名称:syncope,代码行数:25,代码来源:AutowiringSpringBeanJobFactory.java

示例13: newJob

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
/** {@inheritDoc} */
public Job newJob(TriggerFiredBundle bundle) throws SchedulerException {

    JobDetail jobDetail = bundle.getJobDetail();
    Class<ReportJob> jobClass = getJobClass(jobDetail);
    
    ReportJob job = null;
    
    try {
        job = jobClass.newInstance();
        job.setReportd(getReportd());
        return job;
    } catch (Throwable e) {
        SchedulerException se = new SchedulerException("failed to create job class: "+ jobDetail.getJobClass().getName()+"; "+
                                                       e.getLocalizedMessage(), e);
        throw se;
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:19,代码来源:ReportJobFactory.java

示例14: newJob

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
/** {@inheritDoc} */
public Job newJob(TriggerFiredBundle bundle) throws SchedulerException {

    JobDetail jobDetail = bundle.getJobDetail();
    Class<ImportJob> jobClass = getJobClass(jobDetail);
    
    ImportJob job = null;
    
    try {
        job = jobClass.newInstance();
        job.setProvisioner(getProvisioner());
        return job;
    } catch (Throwable e) {
        SchedulerException se = new SchedulerException("failed to create job class: "+jobDetail.getJobClass().getName()+"; "+
                                                       e.getLocalizedMessage(), e);
        throw se;
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:19,代码来源:ImportJobFactory.java

示例15: triggersFired

import org.quartz.spi.TriggerFiredBundle; //导入依赖的package包/类
@Override
public List<TriggerFiredResult> triggersFired(List<OperableTrigger> triggers) throws JobPersistenceException {
    if (logger.isInfoEnabled()) {
        logger.info("Triggers fired " + triggers.size());
        logger.trace(triggers);
    }

    List<CouchDbTrigger> couchdbTriggers = fetchCouchDbTriggers(triggers);
    Map<String, Calendar> triggerCalendars = fetchCalendars(triggers);
    Map<JobKey, JobDetail> jobDetailMap = fetchJobDetails(triggers);

    List<TriggerFiredResult> firedResults = new ArrayList<TriggerFiredResult>();
    List<CouchDbTrigger> firedTriggers = triggerStore.triggersFired(couchdbTriggers, triggerCalendars);
    for (CouchDbTrigger firedTrigger : firedTriggers) {

        Date prevFireTime = find(couchdbTriggers, firedTrigger.getKey()).getPreviousFireTime();
        Calendar calendar = triggerCalendars.get(firedTrigger.getCalendarName());
        JobDetail job = jobDetailMap.get(firedTrigger.getJobKey());

        TriggerFiredBundle triggerFiredBundle = buildTriggerFiredBundle(firedTrigger, prevFireTime, calendar, job);
        firedResults.add(new TriggerFiredResult(triggerFiredBundle));
    }
    return firedResults;
}
 
开发者ID:motech,项目名称:quartz-couchdb-store,代码行数:25,代码来源:CouchDbStore.java


注:本文中的org.quartz.spi.TriggerFiredBundle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。