Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8AF7F9CC4 for ; Wed, 19 Oct 2011 17:14:23 +0000 (UTC) Received: (qmail 87605 invoked by uid 500); 19 Oct 2011 17:14:22 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 87574 invoked by uid 500); 19 Oct 2011 17:14:22 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 87566 invoked by uid 99); 19 Oct 2011 17:14:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2011 17:14:22 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gokturk.gezer@gmail.com designates 209.85.160.177 as permitted sender) Received: from [209.85.160.177] (HELO mail-gy0-f177.google.com) (209.85.160.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2011 17:14:14 +0000 Received: by gyd10 with SMTP id 10so2659082gyd.22 for ; Wed, 19 Oct 2011 10:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=qaHesK01bOV0oYqqRBRuKlSF6OLy9U0Y2C6ty59XhTI=; b=bvaPrrMHqPIMM0X5v5h/MMKO9fCSH4R/GNP/xgWSm3SOHKpbGrY0tPpw7QK0Kih6vV A1m+V3qSD3M2QhjIru/UGQV6e7LT3Vb4AAd30rrTweCU9bgVgjU9BbtPzFhgwO4mwHa7 ZbT2/jJjsj7GZpL7KSsGSWWv/nlFOJJvZjREc= MIME-Version: 1.0 Received: by 10.68.26.193 with SMTP id n1mr7306876pbg.125.1319044433466; Wed, 19 Oct 2011 10:13:53 -0700 (PDT) Received: by 10.68.43.69 with HTTP; Wed, 19 Oct 2011 10:13:53 -0700 (PDT) In-Reply-To: <2F8C0EF8-472C-462A-9A77-843AAB978907@gmail.com> References: <2F8C0EF8-472C-462A-9A77-843AAB978907@gmail.com> Date: Wed, 19 Oct 2011 20:13:53 +0300 Message-ID: Subject: Re: Instantiating Manipulated Class without IPojo From: =?UTF-8?B?R8O2a3TDvHJrIEdlemVy?= To: users@felix.apache.org Content-Type: multipart/alternative; boundary=bcaec521549fe656d604afa9f6ba X-Virus-Checked: Checked by ClamAV on apache.org --bcaec521549fe656d604afa9f6ba Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Clement, On Wed, Oct 19, 2011 at 5:06 PM, Clement Escoffier < clement.escoffier@gmail.com> wrote: > Hi, > > On 19.10.2011, at 05:21, G=C3=B6kt=C3=BCrk Gezer wrote: > > > Hi Everyone, > > > > We're in the middle of moving our codebase to OSGI using IPojo. Problem > is, > > I can not instantiate the manipulated classes without IPojo. > > > > AFAIK, IPojo manipulates the constructors with no argument and > BundleContext > > argument. So we can use other constructors for instance creation withou= t > > getting through IPojo, and all field and method delegations will be > disabled > > in that case. Am i wrong? > > You're mostly right. iPOJO 'replaces' all constructors (since the 1.8.0 > because of the constructor injection support). However, original > constructors are still existing, and accessible. > Yes, much more like it. > > So, if you have a class with: > public class Foo { > > public String m_foo; > > public ConstructorCheck(String foo) { > m_foo =3D foo; > } > > } > > You will get: > public ConstructorCheck(String s) > { > this(null, s); > } > > private ConstructorCheck(InstanceManager _manager, String foo) > { > _setInstanceManager(_manager); > __setm_foo(foo); > } > > It means that you need to have iPOJO in your class path, but the semantic > is not changed. > (For information, __setm_foo(foo); will just do m_foo =3D foo; ) > I have almost the same semantic, except generics involved. > > > > > IPojoized classes are subclasses of some generic type, and i just use > > @Component and @Provides on them. That's all, just for easy service > > publication. But after that i can not instantiate them using > _ctor(String) > > constructor. > > Inheritance (using annotations on parent classes) is not yet supported. > This is on the roadmap of iPOJO 2.0. > I'm not using it. But maybe i over modified files. Its about 30 classes, so maybe i wrongly modified some parent. I'll look into that. > > > > > If you ask why you're using normal instantiation, these usages without > IPojo > > are just on unit tests. Eventually we'll move these tests to OSGI, but = it > > would be cool to be able to still use them until we do. > > > > I'm doing the same. So, avoid the inheritance, and it should work. > I'll go through it again with caution. Thanks. > > Regards, > > Clement > > > > > Regards, > > Gokturk > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org > For additional commands, e-mail: users-help@felix.apache.org > --bcaec521549fe656d604afa9f6ba--