[
https://issues.jboss.org/browse/CDI-360?page=com.atlassian.jira.plugin.sy...
]
Mark Struberg commented on CDI-360:
-----------------------------------
Pete, the real underlying issue is that all the PassivationCapable or not does not depend
on the serialization of the contextual instance but rather on the need to serialize away
the Contextual Reference (the proxy).
How does a typical proxy look like?
{code}
public class MailService$$CdiProxy extends MailService {
privte Bean<MailService> bean;
...
}
{code}
Now use this in the following class
{code}
@SessionScoped
public class User {
private @Inject MailService mailSvc;
...
{code}
The mailSvc is actually of type MailService$$CdiProxy. And this proxy needs the
Bean<MailService> to be PassivationCapable, because the passivationId is the only
way to re-attach to the Bean on the other side of the serialization.
Got me? This has no whatever connection to the actual scope of the contextual instance! If
you need it or not only depends on the bean you inject it INTO (aka the bean containing
the InjectionPoint).
NormalScoped Bean<T> should all be forced to implement
PassivationCapable
-------------------------------------------------------------------------
Key: CDI-360
URL:
https://issues.jboss.org/browse/CDI-360
Project: CDI Specification Issues
Issue Type: Bug
Components: Beans
Affects Versions: 1.0
Reporter: Mark Struberg
Priority: Blocker
Fix For: 1.1.FD
When serializing a Contextual Reference of a CDI bean, we need to transport over it's
proxy. This proxy internally need to serialize it's Bean<T>. But this is only
really possible if the Bean implements PassivationCapable. Any attempt to use the type +
qualifier is doomed to fail, as this still leaves room for clashes. E.g. if an Extension
registers multiple Bean<T> with Object.class and @Default qualifier but a different
name (kind of Spring XML style).
6.6.2 comes most close to this requirement, though it doesn't really define that all
NormalScoped beans really need to implement PassivationCapable. At least it seems to point
into the right direction - but it's nowhere near a clear definition.
We should force Containers to check whether Bean<T> which serve a NormalScoped
scope do implement PassivationCapable.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira