[weld-dev] Stateless scope in Weld?

Adam Warski adam at warski.org
Sat Jan 15 05:38:58 EST 2011


> Can you provide some detail on why ApplicationScope does not work in your case?

It would work, but also as a workaround. When I see an @AS bean it means to me that the bean contains application-wide data. And that it needs to be a singleton. Which isn't the case for the stateless beans - they neither contain data shared by the whole application, nor they need to be a singleton.

But this brought me another unrelated idea: @ClusterScoped. E.g.;

@Produces @ClusterScoped @ProductCache
public void Map<String, Product> createCache() { ... }

- a scope backed by Infinispan, with state shared across the cluster. Wouldn't it be cool? ;)

-- 
Adam Warski
http://www.warski.org
http://www.softwaremill.eu







More information about the weld-dev mailing list