當前位置: 首頁>>代碼示例>>Java>>正文


Java JobDataMap.getInt方法代碼示例

本文整理匯總了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);			
	}
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:22,代碼來源:TaskReminderJob.java

示例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);
    }

}
 
開發者ID:AsuraTeam,項目名稱:asura,代碼行數:62,代碼來源:SendDestinationMessageJob.java


注:本文中的org.quartz.JobDataMap.getInt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。