tags:

views:

150

answers:

1

Hi,

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 the 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!

+2  A: 

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.

Padmarag