当前位置: 首页>>代码示例>>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;未经允许,请勿转载。