开发者

Seam out param with application scope

开发者 https://www.devze.com 2022-12-20 03:02 出处:网络
A question regarding the scopes of Seam out params. Suppose I have @Out(required = false, scope = ScopeType.APPLICATION)

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

精彩评论

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