<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Sorry you're right. First time working with git...
<div><br>
<div>I've added them.</div>
<div><br>
</div>
<div>Paul<br>
<div><br>
<div><font face="Tahoma" size="2"></font></div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF850837" style="direction: ltr; "><font face="Tahoma" size="2" color="#000000"><b>From:</b> Ales Justin [ales.justin@gmail.com]<br>
<b>Sent:</b> 13 November 2010 15:35<br>
<b>To:</b> Paul Bakker<br>
<b>Cc:</b> Pete Muir; weld-dev@lists.jboss.org<br>
<b>Subject:</b> Re: [weld-dev] Specifying the classes to install<br>
</font><br>
</div>
<div></div>
<div>The commit looks partial -- I only see two changes, and no DefaultServletDeployment, WeldContext, ...<br>
* <a href="https://github.com/paulbakker/core/tree/master/environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet" target="_blank">
https://github.com/paulbakker/core/tree/master/environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet</a><br>
<br>
<div class="gmail_quote">On Sat, Nov 13, 2010 at 3:17 PM, Paul Bakker <span dir="ltr">
<<a href="mailto:paulb@infosupport.com" target="_blank">paulb@infosupport.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
Hey Pete,<br>
<br>
I took a first shot a the JavaConfig prototype and it seems to be working well. I had to refactor a bit to decouple some implementation classes and add some interfaces to add it in a clean way, hope that's ok with you. I notice a difference of about 2 seconds
on startup time of a small project :-)<br>
<br>
Take a look here for the general idea: <a href="https://github.com/paulbakker/core/commit/03c615b43f2ea682e1dd9ee584bea8ab86afc76f" target="_blank">
https://github.com/paulbakker/core/commit/03c615b43f2ea682e1dd9ee584bea8ab86afc76f</a><br>
<br>
The code is still a bit messy (some sysouts etc...) but I'm happy the idea seems to be working at least, I'll clean the code up tomorrow.<br>
<br>
A user would have to change the following in the web.xml:<br>
<br>
<!-- The class that implements WeldContext --><br>
<context-param><br>
<param-name>weld.javaconfig.class</param-name><br>
<param-value>org.nljug.cfp.WeldApplicationContext</param-value><br>
</context-param><br>
<br>
<!-- Instead of the standard Listener --><br>
<listener><br>
<listener-class>org.jboss.weld.environment.servlet.JavaConfigListener</listener-class><br>
</listener><br>
<br>
I have a vague idea how to solve the wildcard problem too. Maybe we can add another method to the WeldContext class: 'registerPackages' that returns a list of Strings of package names. Using these strings we can scan selectively in those packages.<br>
<div class="im"><br>
Paul<br>
<br>
<br>
________________________________________<br>
From: Pete Muir [<a href="mailto:pmuir@redhat.com" target="_blank">pmuir@redhat.com</a>]<br>
</div>
Sent: 12 November 2010 18:14<br>
To: Paul Bakker<br>
Cc: <a href="mailto:weld-dev@lists.jboss.org" target="_blank">weld-dev@lists.jboss.org</a><br>
Subject: Re: Specifying the classes to install<br>
<div>
<div></div>
<div class="h5"><br>
Yes, that's exactly what we were thinking of for the "Java API". I argued exactly the same point about the refactoring as well :-)<br>
<br>
And the tool is for just that reason -- maybe we can even reuse the existing beans.xml excludes syntax, and apply the excludes that we can (i.e. not the ones conditional upon the runtime env) at that point, via this generated class.<br>
<br>
So, prototype away!<br>
<br>
Also, can you sign a cla at <a href="http://cla.jboss.org" target="_blank">cla.jboss.org</a>?<br>
<br>
On 12 Nov 2010, at 17:03, Paul Bakker wrote:<br>
<br>
> I think the following might work:<br>
><br>
> 1- Introduce an interface 'WeldApplication' with a method: Class<?>[] registerClasses();<br>
> 2- A user implements this interface and returns an array of class literals for all classes that should become managed.<br>
> 3- Register the user's implementation as a context-param in web.xml<br>
> 4- Check if this parameter is set in the ServletListener, and if it is, instantiate it. We can now completely skip scanning and just go forward with the classes specified by registerClasses().<br>
><br>
> I believe a Java class is a lot more user friendly then a plain text file because it's type safe. It will at least not brake if you refactor a class name. We could still provide a tool to generate this kind of class because the lack of wildcards might be
unconfinient for larger applications.<br>
><br>
> What do you think? If this idea generally fits your idea about it I can try to prototype it this weekend.<br>
><br>
> Paul<br>
><br>
> ________________________________________<br>
> From: Pete Muir [<a href="mailto:pmuir@redhat.com" target="_blank">pmuir@redhat.com</a>]<br>
> Sent: 12 November 2010 17:05<br>
> To: Pete Muir<br>
> Cc: Paul Bakker; <a href="mailto:weld-dev@lists.jboss.org" target="_blank">weld-dev@lists.jboss.org</a><br>
> Subject: Specifying the classes to install<br>
><br>
> On 11 Nov 2010, at 12:54, Pete Muir wrote:<br>
><br>
>><br>
>> On 10 Nov 2010, at 21:59, Paul Bakker wrote:<br>
>><br>
>>> It's not easy to drop because it's part of the CDI spec I guess. But besides that I don't think it's a conceptual problem, it has a lot of advantages (injecting third party classes for example). In some cases (when startup times are important, e.g. on GAE)
it would be nice to override this behavior though.<br>
>><br>
>> Agreed, Ales has started prototyping this in Weld already :-)<br>
><br>
> Ales and I discussed this on IM. Points of note:<br>
><br>
> * The deployment for Weld is split up like:<br>
><br>
> 1) scan classloader<br>
> 2) load classes<br>
> 3) send PAT events<br>
> 4) create beans<br>
><br>
> Weld already supports skipping (2), (3), (4) via the beans.xml support for excluding classes, so we have removed some overhead, but being able to skip (1) will help as well.<br>
><br>
> * We could introduce a Java API for this, where you can specify classes to load in a list, array or similar (refactor safe compared to a plain text file)<br>
><br>
> * You need to specify each class, no support for wildcards etc. here<br>
><br>
> * We could introduce a build-time tool that does support wildcards, and generates the plain text descriptor<br>
><br>
> * A build time tool would also fit well with the support for jandex that we want to add<br>
><br>
> Op dit e-mail bericht is de disclaimer van Info Support van toepassing, zie <a href="http://www.infosupport.com/disclaimer" target="_blank">
http://www.infosupport.com/disclaimer</a><br>
<br>
<br>
_______________________________________________<br>
weld-dev mailing list<br>
<a href="mailto:weld-dev@lists.jboss.org" target="_blank">weld-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>