Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 66450 invoked from network); 27 Jul 2009 15:08:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jul 2009 15:08:15 -0000 Received: (qmail 7317 invoked by uid 500); 27 Jul 2009 15:09:19 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 7224 invoked by uid 500); 27 Jul 2009 15:09:19 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 7207 invoked by uid 99); 27 Jul 2009 15:09:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2009 15:09:19 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jgawor@gmail.com designates 209.85.221.186 as permitted sender) Received: from [209.85.221.186] (HELO mail-qy0-f186.google.com) (209.85.221.186) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2009 15:09:09 +0000 Received: by qyk16 with SMTP id 16so4815940qyk.27 for ; Mon, 27 Jul 2009 08:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=BHZz7uU+IGJKcl10b/WdHwFCnlGpOqjrclpX/lkvrho=; b=bDToAY4ToqBvOmMEZ1+S0USmrpCWpIRhUN4qxGty5S3cs5XurjTIybDFzeA3R7WO75 u6INbNJWYhDsXloOL1uUuXSiG/Q70ovpdpLjt92kyVaA/1k5ugF1vT/QHAVJKbUChai3 Ug/dt15XPj5tHZiZ7zz/TYRDGEb04CkVDUhyY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=uEZxZZJA+yId/YSbiFKDTsmRlE/HbA9pGI8trFN5JDuNhGzMwl19PRauty+etbucJw 8V5ortZD0tGScoqjYQ3V0lPr7Wlq19WL73o1M+teiGuhF/5Wvl+9OVR7RMGKr8ce6M9E 5VPW8v5MYKv949L68fZ8vhYnA/mcB9g11ELjk= MIME-Version: 1.0 Received: by 10.231.12.5 with SMTP id v5mr2040281ibv.55.1248707328364; Mon, 27 Jul 2009 08:08:48 -0700 (PDT) In-Reply-To: References: <20090724184235.3BCF22388872@eris.apache.org> Date: Mon, 27 Jul 2009 11:08:48 -0400 Message-ID: <5eb405c70907270808h4f450119gd838bc9f29ace5e9@mail.gmail.com> Subject: Re: svn commit: r797601 - in /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint: ExtendedBlueprintContainer.java container/BlueprintContainerImpl.java container/ServiceRecipe.java From: Jarek Gawor To: Guillaume Nodet Cc: dev Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I reverted all those changes. My understanding of how this was supposed to work was incorrect. Jarek On Mon, Jul 27, 2009 at 9:52 AM, Guillaume Nodet wrote: > I've made a quick revert at rev 798132, but a cleaner one is needed. > > 2009/7/27 Guillaume Nodet : >> For more informations, see section 121.6.10 and 121.6.11 of the OSGi >> compendium spec, but there is a clear different between the service >> being enabled or not and the lazy / eager activation. >> >> 2009/7/27 Guillaume Nodet : >>> Lazy activation of services does not mean that the service is not regis= tered, but simply that the service object is not eagerly created. >>> Else, the service will never be registered in the OSGi registry. >>> Could you please revert this commit ? >>> >>> 2009/7/24 gawor : >>>> Author: gawor >>>> Date: Fri Jul 24 18:42:34 2009 >>>> New Revision: 797601 >>>> >>>> URL: http://svn.apache.org/viewvc?rev=3D797601&view=3Drev >>>> Log: >>>> services can also have eager or lazy activation >>>> >>>> Modified: >>>> =A0 =A0geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apa= che/geronimo/blueprint/ExtendedBlueprintContainer.java >>>> =A0 =A0geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apa= che/geronimo/blueprint/container/BlueprintContainerImpl.java >>>> =A0 =A0geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apa= che/geronimo/blueprint/container/ServiceRecipe.java >>>> >>>> Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/= apache/geronimo/blueprint/ExtendedBlueprintContainer.java >>>> URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint= -core/src/main/java/org/apache/geronimo/blueprint/ExtendedBlueprintContaine= r.java?rev=3D797601&r1=3D797600&r2=3D797601&view=3Ddiff >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>> --- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache= /geronimo/blueprint/ExtendedBlueprintContainer.java (original) >>>> +++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache= /geronimo/blueprint/ExtendedBlueprintContainer.java Fri Jul 24 18:42:34 200= 9 >>>> @@ -20,6 +20,7 @@ >>>> =A0import java.util.Dictionary; >>>> =A0import java.util.List; >>>> >>>> +import org.apache.geronimo.blueprint.container.ServiceRecipe; >>>> =A0import org.apache.geronimo.blueprint.di.Repository; >>>> =A0import org.osgi.framework.Bundle; >>>> =A0import org.osgi.framework.BundleContext; >>>> @@ -59,4 +60,6 @@ >>>> >>>> =A0 =A0 AccessControlContext getAccessControlContext(); >>>> >>>> + =A0 =A0boolean isServiceEnabled(ServiceRecipe service); >>>> + >>>> =A0} >>>> >>>> Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/= apache/geronimo/blueprint/container/BlueprintContainerImpl.java >>>> URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint= -core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContai= nerImpl.java?rev=3D797601&r1=3D797600&r2=3D797601&view=3Ddiff >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>> --- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache= /geronimo/blueprint/container/BlueprintContainerImpl.java (original) >>>> +++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache= /geronimo/blueprint/container/BlueprintContainerImpl.java Fri Jul 24 18:42:= 34 2009 >>>> @@ -592,6 +592,20 @@ >>>> =A0 =A0 =A0 =A0 } >>>> =A0 =A0 } >>>> >>>> + =A0 =A0public boolean isServiceEnabled(ServiceRecipe r) { >>>> + =A0 =A0 =A0 =A0List dependencies =3D getSatisfiab= leDependenciesMap().get(r.getName()); >>>> + =A0 =A0 =A0 =A0boolean enabled =3D true; >>>> + =A0 =A0 =A0 =A0if (dependencies !=3D null) { >>>> + =A0 =A0 =A0 =A0 =A0 =A0for (SatisfiableRecipe recipe : dependencies)= { >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!recipe.isSatisfied()) { >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0enabled =3D false; >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >>>> + =A0 =A0 =A0 =A0 =A0 =A0} >>>> + =A0 =A0 =A0 =A0} >>>> + =A0 =A0 =A0 =A0return enabled; >>>> + =A0 =A0} >>>> + >>>> =A0 =A0 private void instantiateEagerComponents() { >>>> =A0 =A0 =A0 =A0 List components =3D new ArrayList(); >>>> =A0 =A0 =A0 =A0 for (String name : componentDefinitionRegistry.getComp= onentDefinitionNames()) { >>>> @@ -619,16 +633,16 @@ >>>> =A0 =A0 =A0 =A0 services =3D repository.getAllRecipes(ServiceRecipe.cl= ass); >>>> =A0 =A0 =A0 =A0 for (ServiceRecipe r : services) { >>>> =A0 =A0 =A0 =A0 =A0 =A0 List dependencies =3D getSa= tisfiableDependenciesMap().get(r.getName()); >>>> - =A0 =A0 =A0 =A0 =A0 =A0boolean satisfied =3D true; >>>> + =A0 =A0 =A0 =A0 =A0 =A0boolean enabled =3D true; >>>> =A0 =A0 =A0 =A0 =A0 =A0 if (dependencies !=3D null) { >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 for (SatisfiableRecipe recipe : depend= encies) { >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!recipe.isSatisfied()) { >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0satisfied =3D false; >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0enabled =3D false; >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >>>> =A0 =A0 =A0 =A0 =A0 =A0 } >>>> - =A0 =A0 =A0 =A0 =A0 =A0if (satisfied) { >>>> + =A0 =A0 =A0 =A0 =A0 =A0if (r.isEager() && enabled) { >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 r.register(); >>>> =A0 =A0 =A0 =A0 =A0 =A0 } >>>> =A0 =A0 =A0 =A0 } >>>> >>>> Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/= apache/geronimo/blueprint/container/ServiceRecipe.java >>>> URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint= -core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.j= ava?rev=3D797601&r1=3D797600&r2=3D797601&view=3Ddiff >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>> --- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache= /geronimo/blueprint/container/ServiceRecipe.java (original) >>>> +++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache= /geronimo/blueprint/container/ServiceRecipe.java Fri Jul 24 18:42:34 2009 >>>> @@ -94,6 +94,10 @@ >>>> =A0 =A0 =A0 =A0 this.prototypeService =3D isPrototypeService(metadata.= getServiceComponent()); >>>> =A0 =A0 } >>>> >>>> + =A0 =A0public boolean isEager() { >>>> + =A0 =A0 =A0 =A0return (metadata.getActivation() =3D=3D ComponentMeta= data.ACTIVATION_EAGER); >>>> + =A0 =A0} >>>> + >>>> =A0 =A0 public Recipe getServiceRecipe() { >>>> =A0 =A0 =A0 =A0 return serviceRecipe; >>>> =A0 =A0 } >>>> @@ -127,6 +131,9 @@ >>>> =A0 =A0 =A0 =A0 } >>>> =A0 =A0 =A0 =A0 ServiceRegistrationProxy proxy =3D new ServiceRegistra= tionProxy(); >>>> =A0 =A0 =A0 =A0 addObject(proxy, true); >>>> + =A0 =A0 =A0 =A0if (blueprintContainer.isServiceEnabled(this)) { >>>> + =A0 =A0 =A0 =A0 =A0 =A0register(); >>>> + =A0 =A0 =A0 =A0} >>>> =A0 =A0 =A0 =A0 internalGetService(null, null); // null bundle means w= e don't want to retrieve the actual service when used with a ServiceFactory >>>> =A0 =A0 =A0 =A0 return proxy; >>>> =A0 =A0 } >>>> >>>> >>>> >>> >>> >>> >>> -- >>> Cheers, >>> Guillaume Nodet >>> ------------------------ >>> Blog: http://gnodet.blogspot.com/ >>> ------------------------ >>> Open Source SOA >>> http://fusesource.com >>> >>> >>> >>> >> >> >> >> -- >> Cheers, >> Guillaume Nodet >> ------------------------ >> Blog: http://gnodet.blogspot.com/ >> ------------------------ >> Open Source SOA >> http://fusesource.com >> > > > > -- > Cheers, > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ > ------------------------ > Open Source SOA > http://fusesource.com >