中国开发网: 论坛: 程序员情感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

相关信息:


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