- 浏览: 184531 次
-
最新评论
-
adamed:
zhangwenzhuo 写道为什么this.get()会返回 ...
jQuery源码历代记5 -
zhangwenzhuo:
为什么this.get()会返回本身的呢?
jQuery源码历代记5 -
narutolby:
支持下~,哈哈~
jQuery历代记1 -
cpszy:
mark下
jQuery历代记1 -
gleams:
支持你
jQuery历代记1
Listing 10.1. An Example Stateless Session Bean<o:p></o:p>
列表10.1 一个无状态会话Bean的例子<o:p></o:p>
- import java.rmi.RemoteException;
- import javax.ejb.EJBException;
- import javax.ejb.SessionBean;
- import javax.ejb.SessionContext;
- public class TestBean implements SessionBean {
- /** The session context */
- /** session上下文*/
- private SessionContext context;
- public TestBean() {
- super();
- }
- // EJB Lifecycle Methods not shown for brevity
- //为了简洁起见不显示EJB的生命周期方法
- public void helloWorld() throws EJBException {
- System.out.println("Hello World");
- }
- public void helloWorld(String msg) throws EJBException {
- System.out.println("Hello World - " + msg);
- }
- }
With this EJB deployed and ready in your J2EE application server of choice, you can use the EJBInvokerJob to invoke one of the helloWorld() methods available to remote clients.
将这个EJB部署到你准备好的J2EE容器中,你就可以使用EJBInvokerJob调用一个helloWorld()方法发送给远程客户端。
<o:p> </o:p>
You set up the EJBInvokerJob just as you would for any other job. Listing 10.2 shows an example of using the EJBInvokerJob to invoke the helloWorld() on the SLSB.
你可以像配置其他Job一样配置EJBInvokerJob。列表10.2显示一个在SLSB使用EJBInvokerJob调用helloWorld()方法的例子。
<o:p> </o:p>
Listing 10.2. A Simple Example Using the EJBInvokerJob<o:p></o:p>
列表10.2 一个使用EJBInvokerJob的简单例子<o:p></o:p>
- package org.cavaness.quartzbook.chapter10;
- import java.util.Date;
- import org.apache.commons.logging.Log;
- import org.apache.commons.logging.LogFactory;
- import org.quartz.JobDetail;
- import org.quartz.Scheduler;
- import org.quartz.SchedulerException;
- import org.quartz.Trigger;
- import org.quartz.TriggerUtils;
- import org.quartz.impl.StdSchedulerFactory;
- import org.quartz.jobs.ee.ejb.EJBInvokerJob;
- public class Listing_10_2 {
- static Log logger = LogFactory.getLog(Listing_10_2.class);
- public static void main(String[] args) {
- Listing_10_2 example = new Listing_10_2();
- try {
- // Create a Scheduler and schedule the Job
- //建立Scheduler并且调度Job
- Scheduler scheduler = example.createScheduler();
- example.scheduleJob(scheduler);
- // Start the Scheduler running
- //执行Scheduler
- scheduler.start();
- logger.info("Scheduler started at " + new Date());
- } catch (SchedulerException ex) {
- logger.error(ex);
- }
- }
- // Schedule the EJBInvokerJob
- private void scheduleJob(Scheduler scheduler) throws SchedulerException {
- // Create a JobDetail for the Job
- JobDetail jobDetail = new JobDetail("HelloWorldJob",
- Scheduler.DEFAULT_GROUP,
- org.quartz.jobs.ee.ejb.EJBInvokerJob.class);
- loadJobDataMap(jobDetail);
- // Create a trigger that fires every 10 seconds, forever
- //建立一个每隔10秒运行一次且无限循环的触发器。
- Trigger trigger = TriggerUtils.makeSecondlyTrigger(10);
- trigger.setName("helloWorldTrigger");
- // Start the trigger firing from now
- //现在开始执行触发器
- trigger.setStartTime(new Date())
- // Associate the trigger with the job in the scheduler
- //在scheduler中关联触发器与作业
- scheduler.scheduleJob(jobDetail, trigger);
- }
- /*
- * Configure the EJB parameters in the JobDataMap
- * 在JobDataMap中配置EJB参数
- */
- public JobDetail loadJobDataMap(JobDetail jobDetail) {
- jobDetail.getJobDataMap().put(EJBInvokerJob.EJB_JNDI_NAME_KEY,
- "ejb/HelloWorldSession");
- jobDetail.getJobDataMap().put(EJBInvokerJob.EJB_METHOD_KEY,
- "helloWorld");
- jobDetail.getJobDataMap().put(EJBInvokerJob.PROVIDER_URL,
- "t3://localhost:7001");
- jobDetail.getJobDataMap().put(
- EJBInvokerJob.INITIAL_CONTEXT_FACTORY,
- "weblogic.jndi.WLInitialContextFactory");
- return jobDetail;
- }
- /*
- * return an instance of the Scheduler from the factory
- * 从工厂中返回一个Scheduler实例
- */
- public Scheduler createScheduler() throws SchedulerException {
- return StdSchedulerFactory.getDefaultScheduler();
- }
- }
As you can see from Listing 10.2, the EJBInvokerJob is configured like any other job. A JobDetail and trigger are created and registered with the Scheduler. Several JobDataMap parameters can be used for the job to function properly with various J2EE containers. Table 10.1 lists the JobDataMap parameters that the job supports.
The parameters you add to the JobDataMap depend on which J2EE server you're using and what its requirements are. For example, if you're using BEA WebLogic, you would need to specify at least the ones from Listing 10.1, obviously substituting values for your specific environment. If you were using WebSphere, most of the values would be different.
<o:p> </o:p>
传入JobDataMap中的参数依赖于你使用的容器的需要。例如:如果你使用BEA 的WebLogic你需要指定至少从列表10.1中定义的参数,当然如果你指定了其他环境则需要使用其他参数。如果你使用WebSphere,大部分的值都是不一样的。
<o:p> </o:p>
When we set up and run Listing 10.2 within our external Quartz application, every 10 seconds the helloWorld() method on the EJB is invoked. This approach is nice because we don't have to worry about deploying the Quartz application within the J2EE container. It enforces a separation of job information from business processing logic.
<o:p> </o:p>
当我们定义并运行外部Quartz应用程序(列表10.2中定义的),每隔10秒EJB都会调用helloWord()方法。这种方法的好处在于我们不用考虑如何将Quartz应用部署到J2EE容器中。它分离了job信息与业务处理逻辑。
<o:p> </o:p>
Table 10.1. The EJBInvokerJob Uses Several Parameters, Depending on Your Specific J2EE Server<o:p></o:p> 表10.1 依赖与不同的J2EE服务器EJBInvokerJob使用的参数<o:p></o:p> |
|
Static Constant<o:p></o:p> 静态常数<o:p></o:p> |
String Value<o:p></o:p> 字符串值<o:p></o:p> |
EJB_JNDI_NAME_KEY |
ejb |
Notes: JNDI name of the bean's home interface |
|
PROVIDER_URL |
java.naming.provider.url |
Notes: Vendor-specific URL that specifies where the server can be found |
|
INITIAL_CONTEXT_FACTORY |
java.naming.factory.initial |
Notes: Vendor-specific context factory that is used to look up resources |
|
EJB_METHOD_KEY |
method |
Notes: Name of the method to invoke on the EJB |
|
EJB_ARGS_KEY |
args |
Notes: Object[] of the args to pass to the method (optional, if left out, there are no arguments) |
|
EJB_ARG_TYPES_KEY |
argType |
Notes: Class[] of the args to pass to the method (optionalif left out, the types will be derived by calling getClass() on each of the arguments) |
|
PRINCIPAL |
java.naming.security.principal |
Notes: The principal (user) to be used for the EJB method call |
|
CREDENTIALS |
java.naming.security.credentials |
Notes: The credentials to be used for the EJB method call |
<o:p> </o:p>
发表评论
-
JQuery CookBook翻译连载7(第四章)
2010-06-29 18:45 1031今天超级爆发,整理出来第四章中文版翻译。 -
JQuery CookBook翻译连载6(第三章)
2010-06-29 11:31 1017放出jQuery CookBook翻译的第三章。 最近找工作 ... -
JQuery CookBook 翻译连载6(第2章发布)
2010-06-01 14:15 955jQuery Cookbook第1、2章合订版。 不知 ... -
JQuery CookBook 翻译连载5(第1章发布)
2010-05-16 16:55 933jQuery cookBook 第一章翻译打包发布。 ... -
JQuery CookBook翻译连载1
2010-05-14 11:46 8231.1 在HTML页面中添加j ... -
JQuery CookBook翻译连载2
2010-05-14 11:45 8111.2 在页面DOM加载结束后、整个页面加载结束前执行jQue ... -
JQuery CookBook翻译连载3
2010-05-14 11:34 7091.3 使用选择器及jQuery函 ... -
JQuery CookBook翻译连载4
2010-05-14 11:09 6891.4 在特定的上下文 中查找元素 问 ... -
Quartz Job Scheduling Framework第11章翻译初稿
2007-10-27 15:21 1070内容在附件中 -
Quartz Job Scheduling Framework第7章翻译初稿
2007-10-27 15:18 1145内容在附件中 -
Quartz Job Scheduling Framework第5章翻译初稿
2007-10-27 15:18 976在附件中 -
Quartz Job Scheduling Framework第2章翻译初稿
2007-10-27 15:17 1155在附件中 -
Quartz Job Scheduling Framework第8章翻译初稿 续
2007-09-27 19:46 2188You can have as many properti ... -
Quartz Job Scheduling Framework第8章翻译初稿
2007-09-27 19:42 2633Chapter 8. Using Quartz Plug- ... -
Quartz Job Scheduling Framework翻译初稿奉上
2007-09-26 21:55 1609由于时间与水平限制。这本经典书籍翻译的可能并不尽如人意,在此先 ... -
Quartz Job Scheduling Framework第10章翻译初稿 续
2007-09-26 21:53 2024In the example in Listing 10. ...
相关推荐
Quartz Job Scheduling Framework是一个强大的、开放源代码的作业调度框架,它使应用程序能够在指定的时间执行任务,无需人工干预。这个框架广泛应用于Java应用程序中,用于实现定时任务和工作流管理。在第11章中,...
在阅读《Quartz Job Scheduling Framework》第5章时,你会了解到如何创建和配置Cron Triggers,如何结合SimpleTrigger和CalendarIntervalTrigger实现不同类型的定时任务,以及如何优化Quartz的配置以适应大规模的...
Quartz Job Scheduling Framework第2章翻译初稿 博文链接:https://adamed.iteye.com/blog/135880
Quartz Job Scheduling Framework是一个强大的、开源的作业调度框架,用于在Java应用程序中安排任务执行。这个框架允许开发者创建和管理作业,以及定义作业的触发时间。第7章的主题聚焦于实现Quartz监听器,这是一个...
qtz40塔式起重机总体及塔身有限元分析法设计().zip
Elasticsearch是一个基于Lucene的搜索服务器
资源内项目源码是来自个人的毕业设计,代码都测试ok,包含源码、数据集、可视化页面和部署说明,可产生核心指标曲线图、混淆矩阵、F1分数曲线、精确率-召回率曲线、验证集预测结果、标签分布图。都是运行成功后才上传资源,毕设答辩评审绝对信服的保底85分以上,放心下载使用,拿来就能用。包含源码、数据集、可视化页面和部署说明一站式服务,拿来就能用的绝对好资源!!! 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、大作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.txt文件,仅供学习参考, 切勿用于商业用途。
美国纽约HVAC(暖通空调)数据示例,谷歌地图数据包括:时间戳、名称、类别、地址、描述、开放网站、电话号码、开放时间、更新开放时间、评论计数、评级、主图像、评论、url、纬度、经度、地点id、国家等。 在地理位置服务(LBS)中,谷歌地图数据采集尤其受到关注,因为它提供了关于各种商业实体的详尽信息,这对于消费者和企业都有极大的价值。本篇文章将详细介绍美国纽约地区的HVAC(暖通空调)系统相关数据示例,此示例数据是通过谷歌地图抓取得到的,展示了此技术在商业和消费者领域的应用潜力。 无需外网,无需任何软件抓取谷歌地图数据:wmhuoke.com
2023-04-06-项目笔记-第四百五十五阶段-课前小分享_小分享1.坚持提交gitee 小分享2.作业中提交代码 小分享3.写代码注意代码风格 4.3.1变量的使用 4.4变量的作用域与生命周期 4.4.1局部变量的作用域 4.4.2全局变量的作用域 4.4.2.1全局变量的作用域_1 4.4.2.453局变量的作用域_453- 2025-04-01
1_实验三 扰码、卷积编码及交织.ppt
北京交通大学901软件工程导论必备知识点.pdf
内容概要:本文档总结了 MyBatis 的常见面试题,涵盖了 MyBatis 的基本概念、优缺点、适用场合、SQL 语句编写技巧、分页机制、主键生成、参数传递方式、动态 SQL、缓存机制、关联查询及接口绑定等内容。通过对这些问题的解答,帮助开发者深入理解 MyBatis 的工作原理及其在实际项目中的应用。文档不仅介绍了 MyBatis 的核心功能,还详细解释了其在不同场景下的具体实现方法,如通过 XML 或注解配置 SQL 语句、处理复杂查询、优化性能等。 适合人群:具备一定 Java 开发经验,尤其是对 MyBatis 有初步了解的研发人员,以及希望深入了解 MyBatis 框架原理和最佳实践的开发人员。 使用场景及目标:①理解 MyBatis 的核心概念和工作原理,如 SQL 映射、参数传递、结果映射等;②掌握 MyBatis 在实际项目中的应用技巧,包括 SQL 编写、分页、主键生成、关联查询等;③学习如何通过 XML 和注解配置 SQL 语句,优化 MyBatis 性能,解决实际开发中的问题。 其他说明:文档内容详尽,涵盖面广,适合用于面试准备和技术学习。建议读者在学习过程中结合实际项目进行练习,以更好地掌握 MyBatis 的使用方法和技巧。此外,文档还提供了丰富的示例代码和配置细节,帮助读者加深理解和应用。
《基于YOLOv8的智能电网设备锈蚀评估系统》(包含源码、可视化界面、完整数据集、部署教程)简单部署即可运行。功能完善、操作简单,适合毕设或课程设计
插头模具 CAD图纸.zip
资源内项目源码是来自个人的毕业设计,代码都测试ok,包含源码、数据集、可视化页面和部署说明,可产生核心指标曲线图、混淆矩阵、F1分数曲线、精确率-召回率曲线、验证集预测结果、标签分布图。都是运行成功后才上传资源,毕设答辩评审绝对信服的保底85分以上,放心下载使用,拿来就能用。包含源码、数据集、可视化页面和部署说明一站式服务,拿来就能用的绝对好资源!!! 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、大作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.txt文件,仅供学习参考, 切勿用于商业用途。
《基于YOLOv8的智慧农业水肥一体化控制系统》(包含源码、可视化界面、完整数据集、部署教程)简单部署即可运行。功能完善、操作简单,适合毕设或课程设计
python爬虫;智能切换策略,反爬检测机制
台区终端电科院送检文档
e235d-main.zip
丁祖昱:疫情对中国房地产市场影响分析及未来展望