本文整理汇总了Java中org.quartz.JobDetail.setJobClass方法的典型用法代码示例。如果您正苦于以下问题:Java JobDetail.setJobClass方法的具体用法?Java JobDetail.setJobClass怎么用?Java JobDetail.setJobClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.quartz.JobDetail
的用法示例。
在下文中一共展示了JobDetail.setJobClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newJobDetail
import org.quartz.JobDetail; //导入方法依赖的package包/类
/**
* @param cData
* @return JobDetail
*/
public static JobDetail newJobDetail(CompositeData cData) {
JobDetail jobDetail = new JobDetail();
int i = 0;
jobDetail.setName((String) cData.get(ITEM_NAMES[i++]));
jobDetail.setGroup((String) cData.get(ITEM_NAMES[i++]));
jobDetail.setDescription((String) cData.get(ITEM_NAMES[i++]));
try {
Class c = Class.forName((String) cData.get(ITEM_NAMES[i++]));
jobDetail.setJobClass(c);
} catch (ClassNotFoundException cnfe) {
/**/
}
jobDetail.setJobDataMap(JobDataMapSupport
.newJobDataMap((TabularData) cData.get(ITEM_NAMES[i++])));
jobDetail.setVolatility((Boolean) cData.get(ITEM_NAMES[i++]));
jobDetail.setDurability((Boolean) cData.get(ITEM_NAMES[i++]));
jobDetail.setRequestsRecovery((Boolean) cData.get(ITEM_NAMES[i++]));
return jobDetail;
}
示例2: getJobDetail
import org.quartz.JobDetail; //导入方法依赖的package包/类
/**
* Get the job detail.
*
* @return - the job detail.
*/
private JobDetail getJobDetail()
{
JobDataMap jobDataMap = new JobDataMap();
jobDataMap.put(ACTION_JOB_DATA_MAP_KEY, this);
JobDetail jobDetail = new JobDetail();
jobDetail.setName(getJobName());
jobDetail.setGroup(getJobGroup());
jobDetail.setJobDataMap(jobDataMap);
jobDetail.setJobClass(JobDefinition.class);
return jobDetail;
}
示例3: selectJobForTrigger
import org.quartz.JobDetail; //导入方法依赖的package包/类
/**
* <p>
* Select the job to which the trigger is associated.
* </p>
*
* @param conn
* the DB Connection
* @param triggerName
* the name of the trigger
* @param groupName
* the group containing the trigger
* @return the <code>{@link org.quartz.JobDetail}</code> object
* associated with the given trigger
* @throws SQLException
* @throws ClassNotFoundException
*/
public JobDetail selectJobForTrigger(Connection conn, String triggerName,
String groupName, ClassLoadHelper loadHelper) throws ClassNotFoundException, SQLException {
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = conn.prepareStatement(rtp(SELECT_JOB_FOR_TRIGGER));
ps.setString(1, triggerName);
ps.setString(2, groupName);
rs = ps.executeQuery();
if (rs.next()) {
JobDetail job = new JobDetail();
job.setName(rs.getString(1));
job.setGroup(rs.getString(2));
job.setDurability(getBoolean(rs, 3));
job.setJobClass(loadHelper.loadClass(rs
.getString(4)));
job.setRequestsRecovery(getBoolean(rs, 5));
return job;
} else {
if (logger.isDebugEnabled()) {
logger.debug("No job for trigger '" + groupName + "."
+ triggerName + "'.");
}
return null;
}
} finally {
closeResultSet(rs);
closeStatement(ps);
}
}
示例4: makeJobDetail
import org.quartz.JobDetail; //导入方法依赖的package包/类
/**
* Helper method to create job detail
*/
public static JobDetail makeJobDetail(final int buildID, final Class jobClass) {
final JobDetail jobDetail = new JobDetail();
jobDetail.setJobClass(jobClass);
jobDetail.setGroup(makeGroupName(buildID));
jobDetail.setRequestsRecovery(false);
jobDetail.setDurability(false);
jobDetail.setVolatility(true);
return jobDetail;
}