[cdi-dev] [JBoss JIRA] (CDI-513) AddingPassivatingScopeTest is illegal as addScope for passivating non-normalscopes is perfectly fine

Jozef Hartinger (JIRA) issues at jboss.org
Tue Mar 3 10:33:49 EST 2015


    [ https://issues.jboss.org/browse/CDI-513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13045684#comment-13045684 ] 

Jozef Hartinger commented on CDI-513:
-------------------------------------

Dear EG, 

please clarify whether the notion of a passivating pseudo-scope is valid in CDI. The following indirect evidence seems to contradict this:
1) There is no way to mark a pseudo-scope as passivating using annotations. Using BeforeBeanDiscovery.addScope(annotation, false, true) therefore looks like a possible hack (misuse of lenient signature) instead of an intended use case.
2) The author of the BeforeBeanDiscovery API himself implemented a check which treats passivating pseudo-scopes as invalid. See https://issues.jboss.org/browse/WELD-307 for details. The same author implemented the TCK test mentioned in https://issues.jboss.org/browse/CDITCK-466
3) 6.6.4 says: 
{quote}
Passivating scopes must be explicitly declared @NormalScope(passivating=true).
{quote}


On the other hand, if passivating pseudoscopes were allowed it should not conflict with anything and this feature may be useful for certain use cases.



> AddingPassivatingScopeTest is illegal as addScope for passivating non-normalscopes is perfectly fine
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CDI-513
>                 URL: https://issues.jboss.org/browse/CDI-513
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>    Affects Versions: 1.2.Final
>            Reporter: Mark Struberg
>
> On behalf of Jozef I copied this to a CDI ticket... See CDITCK-466
> I personally think it is clear as there is no single word which forbids this and there is a very vocal description about the single flags.
> -----
> AddingPassivatingScopeTest is illegal as addScope for passivating non-normalscopes is perfectly fine.
> There is nothing in the spec which says that a non-normalscope cannot be passivating.
> The practical use case for this is e.g. when bridging over to Spring. Those beans might need to get checked for Serializable BUT spring brings it's own proxies. So we do not need to wrap it into just another normalscoping proxy.
> Actually the test should come in 2 flavours:
> 1.) RomanEmpire being Serializable -> all fine must work
> 2.) RomainEmpire not Serializable -> DefinitionException



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the cdi-dev mailing list