论坛首页 入门技术论坛

seam 组件的默认作用域

浏览 2552 次
该帖已经被评为新手帖
作者 正文
   发表时间:2008-06-16  
无状态Session Bean : 总是属于无状态上下文中。
有状态Session Bean : Conversation Context。它们绝不会绑定到page
                     或stateless context


Entity Bean        : Conversation Context
JavaBeans           : Event Context

消息驱动Bean         : 不能被绑定到Seam上下文
   发表时间:2008-06-16  
Entity Bean默认绑定到了Conversation Context ?
0 请登录后投票
   发表时间:2008-06-17  
无语...
请不要把EJB的组件和Seam的JSF组件混为一谈,EJB是个规范,不是由SEAM来决定它的生命周期的
0 请登录后投票
   发表时间:2008-06-17  
无语...
请不要把EJB的组件和Seam的JSF组件混为一谈,EJB是个规范,不是由SEAM来决定它的生命周期的


seam 属于扩展ejb应用,将ejb内容无缝的粘合到整个应用框架。
seam的思想将来会成为标准的j2ee web beans实现
0 请登录后投票
   发表时间:2008-06-17  

hantsy 19 小时前
Entity Bean默认绑定到了Conversation Context ?

我查过官方手册了,Entity Bean确实是默认绑定到了Conversation Context。
下面的原文:
4.2.3. Entity beans
Entity beans may be bound to a context variable and function as a seam component. Because entities have a persistent identity in addition to their contextual identity, entity instances are usually bound explicitly in Java code, rather than being instantiated implicitly by Seam.

Entity bean components do not support bijection or context demarcation. Nor does invocation of an entity bean trigger validation.

Entity beans are not usually used as JSF action listeners, but do often function as backing beans that provide properties to JSF components for display or form submission. In particular, it is common to use an entity as a backing bean, together with a stateless session bean action listener to implement create/update/delete type functionality.

By default, entity beans are bound to the conversation context. They may never be bound to the stateless context.


Note that it in a clustered environment is somewhat less efficient to bind an entity bean directly to a conversation or session scoped Seam context variable than it would be to hold a reference to the entity bean in a stateful session bean. For this reason, not all Seam applications define entity beans to be Seam components.

Seam entity bean components may be instantiated using Component.getInstance(), @In(create=true) or directly using the new operator.
0 请登录后投票
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics