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.
精彩评论