本文整理汇总了Java中org.quartz.JobDataMap.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java JobDataMap.getInt方法的具体用法?Java JobDataMap.getInt怎么用?Java JobDataMap.getInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.quartz.JobDataMap
的用法示例。
在下文中一共展示了JobDataMap.getInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.quartz.JobDataMap; //导入方法依赖的package包/类
public void execute(JobExecutionContext context) throws JobExecutionException {
JobDataMap map=context.getJobDetail().getJobDataMap();
if(map.containsKey("overdueDays")){
int overdueDays=map.getInt("overdueDays");
Date createDate=(Date)map.get("createDate");
if(defaultCalculateOverdueDays(overdueDays,createDate)){
if(map.getBoolean("overdueMethodSendMessage")){
executeRemind(map);
}else{
String overdueCustomBeanProcessor=map.getString("overdueCustomBeanProcessor");
ITaskOverdueProcessor processor=ContextHolder.getBean(overdueCustomBeanProcessor);
processor.process(map.getString("taskId"));
String reminderJobId=map.getString("reminderJobId");
CancelReminderJobBean cancelReminderJobBean=ContextHolder.getBean(CancelReminderJobBean.BEAN_ID);
cancelReminderJobBean.cancelReminderJob(reminderJobId);
}
}
}else{
executeRemind(map);
}
}
示例2: execute
import org.quartz.JobDataMap; //导入方法依赖的package包/类
public void execute(final JobExecutionContext jobCtx)
throws JobExecutionException {
Connection conn = null;
Session sess = null;
MessageProducer producer = null;
try {
final JobDetail detail = jobCtx.getJobDetail();
final JobDataMap dataMap = detail.getJobDataMap();
final Context namingCtx = JmsHelper.getInitialContext(dataMap);
final ConnectionFactory connFactory = (ConnectionFactory) namingCtx
.lookup(dataMap
.getString(JmsHelper.JMS_CONNECTION_FACTORY_JNDI));
if (!JmsHelper.isDestinationSecure(dataMap)) {
conn = connFactory.createConnection();
} else {
final String user = dataMap.getString(JmsHelper.JMS_USER);
final String password = dataMap
.getString(JmsHelper.JMS_PASSWORD);
conn = connFactory.createConnection(user, password);
}
final boolean useTransaction = JmsHelper.useTransaction(dataMap);
final int ackMode = dataMap.getInt(JmsHelper.JMS_ACK_MODE);
sess = conn.createSession(useTransaction, ackMode);
final Destination destination = (Destination) namingCtx
.lookup(dataMap.getString(JmsHelper.JMS_DESTINATION_JNDI));
producer = sess.createProducer(destination);
final String msgFactoryClassName = dataMap
.getString(JmsHelper.JMS_MSG_FACTORY_CLASS_NAME);
final JmsMessageFactory messageFactory = JmsHelper
.getMessageFactory(msgFactoryClassName);
final Message msg = messageFactory.createMessage(dataMap, sess);
producer.send(msg);
} catch (final Exception e) {
throw new JobExecutionException(e);
} finally {
JmsHelper.closeResource(producer);
JmsHelper.closeResource(sess);
JmsHelper.closeResource(conn);
}
}