中国开发网: 论坛: 程序员情感CBD: 贴子 191658
老玉米
嗯,看这是这样的,这是ejb3.0 specification里面的:
3.4.1 Obtaining a Session Bean’s Business Interface
A client can obtain a session bean’s business interface through dependency injection or lookup in the
JNDI namespace.
For example, the business interface Cart for the CartBean session bean may be obtained using
dependency injection as follows:
@EJB Cart cart;
The Cart business interface could also be looked up using JNDI as shown in the following code segment
using the lookup method provided by the EJBContext interface. In this example, a reference to
the client bean’s SessionContext object is obtained through dependency injection:
@Resource SessionContext ctx;
Cart cart = (Cart)ctx.lookup(“cart”);
In both cases, the syntax used in obtaining the reference to the Cart business interface is independent
of whether the business interface is local or remote. In the case of remote access, the actual location of a
referenced enterprise bean and EJB
民主不同于专制,不需要强加于人。--- 賴斯

大道之行也,天下为公,选贤与能,讲信修睦。故人不独亲其亲,不独子其子,使老有所终,壮有所用,幼有所长,矜、寡、孤、独、废疾者,皆有所养。男有分,女有归。货恶其弃於地也,不必藏於己;力恶其不出於身也,不必为己。是故,谋闭而不兴,盗窃乱贼而不作,故外户而不闭,是谓大同。--《礼运·大同篇》

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录