[webbeans-dev] Session-scoped beans and clustering

Gavin King gavin.king at gmail.com
Tue May 26 15:06:23 EDT 2009


So, yesterday I was thinking about the problem of session/conversation
context passivation and clustering.

Currently there is no notion of a "unique id" of a Bean object, which
the container would need in order to identify the session attribute
holding the Bean object.

In a pure-local execution model this is no big deal, since you can
just generate one the first time you see a Bean. However, in a
clustered environment it becomes an issue, especially when we have
custom Beans provided by portable extensions.

I don't see a better solution than introducing a new interface with a
getId() method:

   interface PassivationCapable<X> extends Bean<X> {
      String getId();
   }

Instances of Bean could optionally implement PassivationCapable.

We would also need to add a method to BeanManager:

   interface BeanManager {
      PassivationCapable<?> getPassivationCapableBean(String id);
   }

WDYT?

-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org



More information about the weld-dev mailing list