Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-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 9A788DFFA for ; Tue, 12 Feb 2013 10:01:10 +0000 (UTC) Received: (qmail 10391 invoked by uid 500); 12 Feb 2013 10:01:10 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 10126 invoked by uid 500); 12 Feb 2013 10:01:10 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 10096 invoked by uid 99); 12 Feb 2013 10:01:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 10:01:09 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 10:01:02 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1U5CfJ-00054D-E8 for dev@camel.apache.org; Tue, 12 Feb 2013 02:00:41 -0800 Date: Tue, 12 Feb 2013 02:00:41 -0800 (PST) From: Babak Vahdat To: dev@camel.apache.org Message-ID: <1360663241412-5727412.post@n5.nabble.com> In-Reply-To: References: <1360320138019-5727207.post@n5.nabble.com> Subject: Re: About 4 method signatures by the ClassResolver API MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Thanks for your feedback Christian! Currently I'm in Holiday. Will take care of this when I'm back in town again. Babak Christian Mueller wrote > +1 > I see your point. Doesn't make sense to me too. > > Best, > Christian > > On Fri, Feb 8, 2013 at 11:42 AM, Babak Vahdat > < > babak.vahdat@ > >wrote: > >> Hi >> >> Looking at the public ClassResolver API (among others) it provides 4 >> methods >> taking over the concrete to be loaded Class type: >> >> >> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/ClassResolver.html#resolveClass%28java.lang.String,%20java.lang.Class%29 >> >> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/ClassResolver.html#resolveClass%28java.lang.String,%20java.lang.Class,%20java.lang.ClassLoader%29 >> >> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/ClassResolver.html#resolveMandatoryClass%28java.lang.String,%20java.lang.Class%29 >> >> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/ClassResolver.html#resolveMandatoryClass%28java.lang.String,%20java.lang.Class,%20java.lang.ClassLoader%29 >> >> However referencing the to be loaded Class type in this way would make >> the >> given Class object to be already loaded statically through the JVM itself >> :-) so that as soon as the actual parameters are put on the call stack >> for >> these methods the concrete Class object is already loaded even *before* >> these methods return! >> >> I think originally the idea behind these methods was to avoid a need to >> (explicitly) type cast for the caller, e.g. like the following method >> we've >> got by the Exchange interface: >> >> >> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html#getProperty%28java.lang.String,%20java.lang.Class%29 >> >> However in case of the ClassResolver API the same doesn't make much sense >> (correct me if I'm wrong) so IMHO we should better @deprecate these >> methods >> and remove them in 3.0 because the idea behind the ClassResolver API is >> to >> *dynamically* load the classes, however using these methods make the >> given >> classes already being *statically* loaded. >> >> Thoughts? >> >> Babak >> >> >> >> >> -- >> View this message in context: >> http://camel.465427.n5.nabble.com/About-4-method-signatures-by-the-ClassResolver-API-tp5727207.html >> Sent from the Camel Development mailing list archive at Nabble.com. >> > > > > -- -- View this message in context: http://camel.465427.n5.nabble.com/About-4-method-signatures-by-the-ClassResolver-API-tp5727207p5727412.html Sent from the Camel Development mailing list archive at Nabble.com.