Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DA54A6681 for ; Sat, 23 Jul 2011 06:10:46 +0000 (UTC) Received: (qmail 20405 invoked by uid 500); 23 Jul 2011 06:10:43 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 20024 invoked by uid 500); 23 Jul 2011 06:10:32 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 20008 invoked by uid 99); 23 Jul 2011 06:10:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Jul 2011 06:10:27 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of simone.tripodi@gmail.com designates 209.85.213.43 as permitted sender) Received: from [209.85.213.43] (HELO mail-yw0-f43.google.com) (209.85.213.43) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Jul 2011 06:10:19 +0000 Received: by ywt2 with SMTP id 2so1724548ywt.30 for ; Fri, 22 Jul 2011 23:09:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=q0Dd0GMSgLXxgwn/k+4tY8Aqf6abewK0wKtAVfpWKO4=; b=KKwwX3t5wL/NXA5sUVU8shknUB032O4xuuvU6teJCw83YHmhNJELzCNXDX5165Q9Ic xRimX3d/O1o7Epfpoqn23W5v2HGiUEqD1mYQFdXMGXlkUzR/ZBr6KJCTmg8DcDhTj80t A4tjUFDXQvR0C/c3FjyEP8/nBwqiVprnek6oI= MIME-Version: 1.0 Received: by 10.150.158.21 with SMTP id g21mr2670147ybe.58.1311401399021; Fri, 22 Jul 2011 23:09:59 -0700 (PDT) Sender: simone.tripodi@gmail.com Received: by 10.151.48.15 with HTTP; Fri, 22 Jul 2011 23:09:58 -0700 (PDT) In-Reply-To: References: <1311352715.16187.YahooMailClassic@web27808.mail.ukl.yahoo.com> Date: Sat, 23 Jul 2011 08:09:58 +0200 X-Google-Sender-Auth: c1lGHBR4VmLtZKgwR_M-qQtfBgk Message-ID: Subject: Re: [sandbox] class scanning + karma requests From: Simone Tripodi To: Commons Developers List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hallo Mark! just for he record, there is also the any() filter available that doesn't perform any check at all, it should fit better for your use case: +------------------------------------------------------------------------+ createClassPathFromJVM().withConfiguration( new AbstractHandlerConfiguration() { @Override public void configure() { ifMatches( any() ).handleWith( new ClassPathEntryHandler() { public void doHandle( String path, Class classPathEn= try ) { // handle class } } ); } } ).usingContextClassLoader().scan(); +------------------------------------------------------------------------+ Alles gute! Simo http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Fri, Jul 22, 2011 at 7:04 PM, Matt Benson wrote: > On Fri, Jul 22, 2011 at 11:38 AM, Mark Struberg wrote= : >> Hoi Simo! >> >> Yup, looks pretty fine from a users perspective. I'm just not sure if th= is can be done in a performance intense scenario. We would need to do a few= performance tests upfront. >> Remember we often have 50.000++ classes to scan through. And every Class= has ~30 methods and fields w Annotations + method params + Annotations, ..= . >> If you would really invoke this filter method for each and every structu= re element, then you would get performance problems pretty soon. >> >> Of course we need some kind of filtering, but we must be careful and do = lots of performance tests upfront to not propagate an non-performing patter= n. > > Maybe once the basic scan is complete, the client SPIs should be > called back using a concurrent Executor, where most of the real > filtering can take place. > > Matt > >> >> LieGrue, >> strub >> >> >> --- On Fri, 7/22/11, Simone Tripodi wrote: >> >>> From: Simone Tripodi >>> Subject: Re: [sandbox] class scanning + karma requests >>> To: "Commons Developers List" >>> Date: Friday, July 22, 2011, 3:54 PM >>> Hi Mark!!! >>> For meiyo APIs I'd like to keep I mean end-user APIs; as >>> Matt >>> suggested you, since you didn't hear about the already >>> existing >>> sandbox component before, the most interesting parts of >>> meiyo are the >>> filtering/callback APIs, expressed via EDSL. Have a look at >>> the simple >>> included testcase[1] to see how they make clear its usage >>> to end user >>> - of course they can be improved!!! - and I bet should not >>> a big issue >>> integrating them in your more efficient engine :P >>> Looking forward to hear from you soon, all the best! >>> Simo >>> >>> [1] http://s.apache.org/YIF >>> [2] http://s.apache.org/5Gt >>> >>> http://people.apache.org/~simonetripodi/ >>> http://www.99soft.org/ >>> >>> >>> >>> On Fri, Jul 22, 2011 at 4:59 PM, Matt Benson >>> wrote: >>> > On Fri, Jul 22, 2011 at 9:51 AM, Mark Struberg >>> wrote: >>> >> Hi Simo! >>> >> >>> >> Yea, taking the best ideas of both projects (meiyo >>> and xbean-finder) would definitlely be a big bonus. >>> >> But to be honest: I think we should rather stay on >>> the xbean-finder API. The reason is that it's already >>> heavily used in Geronimo, OpenEJB, OpenWebBeans and a few >>> other projects here at the ASF and abroad. So we should aim >>> to make the transition as easy as possible. Of course >>> tweaking the API to some degree is surely possible. >>> >> I also have to admit that I haven't heard of meiyo >>> before yesterday, so I don't know it's capabilities. >>> >> >>> > >>> > IMO the most interesting parts of meiyo to take away >>> are the >>> > filtering/callback APIs. =C2=A0I would think that this is >>> mostly part of >>> > (or at least an option of) the client API e.g. for the >>> single-scan >>> > feature, that we have to rewrite anyway. =C2=A0So I don't >>> think these goals >>> > are incompatible. >>> > >>> > Matt >>> > >>> >> In any case you are highly welcome to join forces >>> - any idea/opinion/help is welcome! >>> >> >>> >> LieGrue, >>> >> strub >>> >> >>> >> --- On Fri, 7/22/11, Simone Tripodi >>> wrote: >>> >> >>> >>> From: Simone Tripodi >>> >>> Subject: Re: [sandbox] class scanning + karma >>> requests >>> >>> To: "Commons Developers List" >>> >>> Date: Friday, July 22, 2011, 2:20 PM >>> >>> Hi all guys! >>> >>> That sounds really interesting!!! >>> >>> I think that bringing the new ideas in >>> existing [meiyo] >>> >>> APIs would >>> >>> allow us releasing a new component soon! >>> >>> Thanks in advance for your help and >>> interesting, looking >>> >>> forward to >>> >>> hear from you soon!!! >>> >>> Simo >>> >>> >>> >>> http://people.apache.org/~simonetripodi/ >>> >>> http://www.99soft.org/ >>> >>> >>> >>> >>> >>> >>> >>> On Fri, Jul 22, 2011 at 11:41 AM, Mark >>> Struberg >>> >>> wrote: >>> >>> > Hi! >>> >>> > >>> >>> > Jakob Korherr (apacheId jakobk) is also >>> interested and >>> >>> did some work in this area in MyFaces and OWB >>> already. >>> >>> > >>> >>> > There are 2 main parts in this project >>> >>> > >>> >>> > a.) A classpath scanner which does _not_ >>> use >>> >>> Class.getDeclaredXxx etc, since this allocates >>> memory in the >>> >>> ClassLoader which cannot get freed up later. >>> In a mid sized >>> >>> project this leads to getting 100MB of >>> PermGenSpace easily! >>> >>> This is what Davids xbean-finder fixes already >>> by just >>> >>> scanning the structure from the bytecode >>> directly. >>> >>> > >>> >>> > b.) Lots of EE apps need to scan the >>> classpath for >>> >>> annotations (e.g. MyFaces, OpenWebBeans, >>> Tomcat, OpenEJB, >>> >>> etc). So this part is done redundantly a few >>> times when >>> >>> starting the server. I hacked a quick API + >>> SPI to do all >>> >>> this in one go. The trick is to introduce a >>> register >>> >>> mechanism where classscan-clients can register >>> their needs >>> >>> before the scan gets performed. >>> >>> > >>> >>> > >>> >>> > We like to do this at commons because >>> it's really >>> >>> decoupled from all the single projects and >>> could be useful >>> >>> for a lot more projects which added some kind >>> of annotation >>> >>> processing lately. >>> >>> > >>> >>> > LieGrue, >>> >>> > strub >>> >>> > >>> >>> > --- On Fri, 7/22/11, Matt Benson >>> >>> wrote: >>> >>> > >>> >>> >> From: Matt Benson >>> >>> >> Subject: [sandbox] class scanning + >>> karma >>> >>> requests >>> >>> >> To: dev@commons.apache.org >>> >>> >> Cc: dblevins@apache.org, >>> >>> "Gerhard Petracek" >>> >>> >> Date: Friday, July 22, 2011, 4:30 AM >>> >>> >> First, Simo added [meiyo] to the >>> >>> >> sandbox.=C2=A0 Now, some of the guys >>> from >>> >>> >> the various JEE-related communities >>> have expressed >>> >>> interest >>> >>> >> in working >>> >>> >> with class scanning here at >>> Commons.=C2=A0 What we >>> >>> would >>> >>> >> propose to do is >>> >>> >> start with the code of Geronimo's >>> xbean-finder, >>> >>> which scans >>> >>> >> classes by >>> >>> >> reading bytecode to populate >>> meta-structures, >>> >>> thereby >>> >>> >> sparing permgen >>> >>> >> space whenever possible.=C2=A0 We plan to >>> carefully >>> >>> prune >>> >>> >> and polish that >>> >>> >> code, pull in the best ideas from >>> [meiyo] (Simo >>> >>> and/or any >>> >>> >> of the rest >>> >>> >> of you Commons developers are of >>> course welcome >>> >>> to >>> >>> >> participate as >>> >>> >> always!), and add a single-scan SPI >>> strategy to >>> >>> allow the >>> >>> >> majority of >>> >>> >> consumers to share the impact of >>> scanning.=C2=A0 For >>> >>> my own >>> >>> >> part, I hope to >>> >>> >> be able to contribute such that the >>> final API can >>> >>> >> accommodate most if >>> >>> >> not all conceivable use-cases for >>> classpath >>> >>> scanning, while >>> >>> >> not >>> >>> >> becoming too unwieldy.=C2=A0 We'd like to >>> get started >>> >>> ASAP >>> >>> >> (and obviously >>> >>> >> nothing stops me from going ahead and >>> taking the >>> >>> first >>> >>> >> steps).=C2=A0 I >>> >>> >> would also request our new chair >>> grant sandbox >>> >>> karma to: >>> >>> >> >>> >>> >> struberg (Mark Struberg) >>> >>> >> dblevins (David Blevins) >>> >>> >> gpetracek (Gerhard Petracek} >>> >>> >> >>> >>> >> Thanks, >>> >>> >> Matt >>> >>> >> >>> >>> >> >>> >>> >>> --------------------------------------------------------------------- >>> >>> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> >>> >> For additional commands, e-mail: dev-help@commons.apache.org >>> >>> >> >>> >>> >> >>> >>> > >>> >>> > >>> >>> >>> --------------------------------------------------------------------- >>> >>> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> >>> > For additional commands, e-mail: dev-help@commons.apache.org >>> >>> > >>> >>> > >>> >>> >>> >>> >>> --------------------------------------------------------------------- >>> >>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> >>> For additional commands, e-mail: dev-help@commons.apache.org >>> >>> >>> >>> >>> >> >>> >> >>> --------------------------------------------------------------------- >>> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> >> For additional commands, e-mail: dev-help@commons.apache.org >>> >> >>> >> >>> > >>> > >>> --------------------------------------------------------------------- >>> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> > For additional commands, e-mail: dev-help@commons.apache.org >>> > >>> > >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> For additional commands, e-mail: dev-help@commons.apache.org >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >> For additional commands, e-mail: dev-help@commons.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org