- 浏览: 180740 次
最新评论
-
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 977今天超级爆发,整理出来第四章中文版翻译。 -
JQuery CookBook翻译连载6(第三章)
2010-06-29 11:31 963放出jQuery CookBook翻译的第三章。 最近找工作 ... -
JQuery CookBook 翻译连载6(第2章发布)
2010-06-01 14:15 905jQuery Cookbook第1、2章合订版。 不知 ... -
JQuery CookBook 翻译连载5(第1章发布)
2010-05-16 16:55 885jQuery cookBook 第一章翻译打包发布。 ... -
JQuery CookBook翻译连载1
2010-05-14 11:46 7811.1 在HTML页面中添加j ... -
JQuery CookBook翻译连载2
2010-05-14 11:45 7641.2 在页面DOM加载结束后、整个页面加载结束前执行jQue ... -
JQuery CookBook翻译连载3
2010-05-14 11:34 6541.3 使用选择器及jQuery函 ... -
JQuery CookBook翻译连载4
2010-05-14 11:09 6361.4 在特定的上下文 中查找元素 问 ... -
Quartz Job Scheduling Framework第11章翻译初稿
2007-10-27 15:21 1020内容在附件中 -
Quartz Job Scheduling Framework第7章翻译初稿
2007-10-27 15:18 1082内容在附件中 -
Quartz Job Scheduling Framework第5章翻译初稿
2007-10-27 15:18 928在附件中 -
Quartz Job Scheduling Framework第2章翻译初稿
2007-10-27 15:17 1110在附件中 -
Quartz Job Scheduling Framework第8章翻译初稿 续
2007-09-27 19:46 2110You can have as many properti ... -
Quartz Job Scheduling Framework第8章翻译初稿
2007-09-27 19:42 2590Chapter 8. Using Quartz Plug- ... -
Quartz Job Scheduling Framework翻译初稿奉上
2007-09-26 21:55 1546由于时间与水平限制。这本经典书籍翻译的可能并不尽如人意,在此先 ... -
Quartz Job Scheduling Framework第10章翻译初稿 续
2007-09-26 21:53 1934In the example in Listing 10. ...
相关推荐
Quartz Job Scheduling Framework第2章翻译初稿 博文链接:https://adamed.iteye.com/blog/135880
博文链接:https://adamed.iteye.com/blog/135883
博文链接:https://adamed.iteye.com/blog/135881
博文链接:https://adamed.iteye.com/blog/135882
三菱PLC例程源码QD75P八轴定位系统程序本资源系百度网盘分享地址
Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。Python库的丰富性是Python成为最受欢迎的编程语言之一的关键原因之一。这些库不仅为初学者提供了快速入门的途径,而且为经验丰富的开发者提供了强大的工具,以高效率、高质量地完成复杂任务。例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。
Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。Python库的丰富性是Python成为最受欢迎的编程语言之一的关键原因之一。这些库不仅为初学者提供了快速入门的途径,而且为经验丰富的开发者提供了强大的工具,以高效率、高质量地完成复杂任务。例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。
三菱PLC例程源码ro1_chun shui本资源系百度网盘分享地址
互联网产品经理在向技术部门递交产品策划方案时,除了详尽的需求阐述,一份清晰易懂的产品原型设计方案同样不可或缺。一份出色的原型设计,不仅能促进前期的深入讨论,更能让美工和开发人员更直观地理解产品特性,进而优化工作流程,减少不必要的时间消耗,提升整体工作效率。接下来,我想就产品经理与原型设计之间的关系进行简要的探讨,并期待能与大家进行深入的交流和探讨。 产品原型,简而言之,是产品设计最终成形之前的一个基础框架。对于网站而言,它意味着对页面模块和元素进行初步、大致的排版与布局。进一步讲,我们还会加入一些交互性元素,使原型更加具体、生动,更贴近最终产品的形态,从而帮助团队成员更好地理解和构建产品。 很多人存在一个误区,认为UI、UE设计师的职责就是将产品原型转化为具体的页面效果。然而,实际上他们的工作流程是在原型设计完成之后展开的。在整个产品开发流程中,产品经理是最了解产品特性、用户和市场需求的角色。尽管设计师在视觉设计方面可能表现得非常出色,但他们在理解产品、用户、市场及业务方面的深度与准确性上,往往无法与产品经理相提并论。准确地说,设计师的工作是将产品原型转化为产品经理所期望的视觉效果。
小红书娱乐营销520明星大事件《全明星告白季》招商方案ss.pptx
人工智能毕业设计&课程设计
三菱PLC例程源码车辆进出车库本资源系百度网盘分享地址
三菱PLC例程源码PLCFX0N三层三站程序本资源系百度网盘分享地址
三菱PLC例程源码纯水控制三菱PLC实例和触摸屏程序本资源系百度网盘分享地址
三菱PLC例程源码pp復卷機三菱伺服編程本资源系百度网盘分享地址
三菱PLC例程源码变频器16段速控制本资源系百度网盘分享地址
Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。Python库的丰富性是Python成为最受欢迎的编程语言之一的关键原因之一。这些库不仅为初学者提供了快速入门的途径,而且为经验丰富的开发者提供了强大的工具,以高效率、高质量地完成复杂任务。例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。
这是一个基于SSM框架的二手物品交易管理系统设计,使用Java语言开发,包含344个文件。主要文件类型包括59个JPG图片文件、59个Java源文件、48个PNG图片文件、37个JAR包文件、34个JavaScript文件、28个JSP文件、26个CSS文件、16个XML文件和5个GIF图片文件。该项目提供了一个全面的二手物品交易平台,支持用户发布商品、查看闲置、充值账户、查看所有订单和发布求购信息,旨在为用户提供便捷、安全的交易环境。
Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。Python库的丰富性是Python成为最受欢迎的编程语言之一的关键原因之一。这些库不仅为初学者提供了快速入门的途径,而且为经验丰富的开发者提供了强大的工具,以高效率、高质量地完成复杂任务。例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。
使用DS Client在PPT中动态展示分子三维结构