<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>But Mark&#8217;s idea is good anyway. Couldn&#8217;t that check be made by the container? The spec just would need to write down the visibility-rules.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>It seems to have to do something with the classloader of the Context and the classloader of the bean type.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Something like &#8220;A bean is visible to a context if the bean-class is the same (meanding Object identity) as the class of the same name that is returned by the classloader of the Context-Instance&#8221;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Cheers,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Arne</span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> cdi-dev-bounces@lists.jboss.org [mailto:cdi-dev-bounces@lists.jboss.org] <b>Im Auftrag von </b>Fabien Marsaud<br><b>Gesendet:</b> Donnerstag, 15. Dezember 2011 13:20<br><b>An:</b> Mark Struberg<br><b>Cc:</b> cdi-dev<br><b>Betreff:</b> Re: [cdi-dev] easy solution for class visibility checks?<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>&gt;Yup, I also don't really like it to make the Contexts responsible alone, because it might make it harder to implement portable Contexts.<br><br>I was about to say the same. Usually a scope is straightforward:<br>@Scope @Retention @Target public @interface MyScope {}<br><br>But the context taking care of it has to drag the whole carriage: the beanstore, the 2 get() methods and the cleanup. This may be not tedious for you, but it definitely is for the average programmer (if he dares ot make it right, threadsafe, etc).<br><br>A visibility method would add more complications and give a serious opportunity to the developper to wreck havoc. There should be at least a default impl and/or a higher order instance taking care of the visibility things.<br><br>fm.<o:p></o:p></p><div><p class=MsoNormal>On Thu, Dec 15, 2011 at 12:28 PM, Mark Struberg &lt;<a href="mailto:struberg@yahoo.de" target="_blank">struberg@yahoo.de</a>&gt; wrote:<o:p></o:p></p><p class=MsoNormal>another point is that currently 1 BDA == 1 single jar file (or WEB-INF/classes)<br><br><br>But that's just way too restrictive imo. IF, then it should treat all jars/classes in the same webapp as 1 BDA and all shared EAR jars as another BDA.<br>But still then, there is a lot left undefined. Imo all the BDA stuff is not worth the pita.<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><br><br>&gt; Good point. There is definitely a shared responsibility though here, and I'm<br>&gt; not sure we can shift all responsibility to the context.<o:p></o:p></p></div><p class=MsoNormal>Yup, I also don't really like it to make the Contexts responsible alone, because it might make it harder to implement portable Contexts.<br>Otoh it's pretty pragmatic and is doable in all situations I knew.<br><br>Maybe we can collect samples (use-cases) and play with them?<o:p></o:p></p><div><p class=MsoNormal><br>LieGrue,<br>strub<br><br><br><br>----- Original Message -----<br>&gt; From: Pete Muir &lt;<a href="mailto:pmuir@redhat.com" target="_blank">pmuir@redhat.com</a>&gt;<br>&gt; To: Mark Struberg &lt;<a href="mailto:struberg@yahoo.de" target="_blank">struberg@yahoo.de</a>&gt;<br>&gt; Cc: cdi-dev &lt;<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a>&gt;<o:p></o:p></p></div><div><p class=MsoNormal>&gt; Sent: Thursday, December 15, 2011 12:14 PM<br>&gt; Subject: Re: [cdi-dev] easy solution for class visibility checks?<br>&gt;<br>&gt;<o:p></o:p></p></div><div><div><p class=MsoNormal>&gt; On 15 Dec 2011, at 11:10, Mark Struberg wrote:<br>&gt;<br>&gt;&gt; &nbsp;The BDA stuff is not only broken for @Alternatives, but also for<br>&gt; &lt;interceptors&gt; and &lt;decorators&gt;<br>&gt;<br>&gt; Right, I wrote e.g. not i.e. ;-) Sorry, was just being lazy.<br>&gt;<br>&gt;&gt;<br>&gt;&gt; &nbsp;Plus: @Specializes is NOT affected by BDA as per CDI-1.0. But still gets<br>&gt; hit by class visibility issues.<br>&gt;<br>&gt; Right, this is not right in the CDI spec.<br>&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; &nbsp;Imo the container just cannot know whether a 3rd party Context is going to<br>&gt; use the ThreadContextClassLoader, the SystemClassloader, the<br>&gt; MyScoped.class.getClassLoader() etc. There is nothing a container can do about<br>&gt; it, because _only_ the Context knows where it will store it's stuff.<br>&gt;<br>&gt; Good point. There is definitely a shared responsibility though here, and I'm<br>&gt; not sure we can shift all responsibility to the context.<br>&gt;<br>_______________________________________________<br>cdi-dev mailing list<br><a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><o:p></o:p></p></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><br><br clear=all><br>-- <br><a href="http://www.suntriprecords.com" target="_blank">http://www.suntriprecords.com</a><o:p></o:p></p></div></body></html>