开发者

Seam out param with application scope

A question regarding the scopes of Seam out params.

Suppose I have

@Out(required = false, scope = ScopeType.APPLICATION)
private GlobalStuff globalStuff= new GlobalStuff();

in a stateful session bean,and another stateful session bean with

@In(required = true)
private GlobalStuff globalStuff;

Do I get th开发者_C百科e guarantee that there will only be 1 instance of the object GlobalStuff in my application (suppose it's deployed to a single jboss server)?

Thanks!


Seam Outjection is same as setAttribute()
So it'll add the instance with name "globalStuff" to APPLICATION context. If any other class/object tries to add by same name, it'll overwrite.
So Yes, there'll only one instance with the same NAME.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜