本文整理匯總了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);
}
}