You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by Guillaume Nodet <gn...@gmail.com> on 2011/02/04 19:22:04 UTC

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

While I do not question the validity of such changes, it tends to
confirm my impression that we have components that are quite tied
together and that we'll never be able to release them independantly
(apart from bug fix release which do not matter here).
How easy would such things be if we had several trunks, one jira per
component, each jira associated to a different version in jira...
This also changes the constraints on the packages imported by a
component, so you'd have to change some package versions.  That's
kinda bad as if a user want to update one bundle, he has to actually
update a bunch of bundles.  if we're going to use a different version
for each component, we'd have to keep track of the compatibility
somewhere so that this can appear in the release notes.

i'll stop to lobby on the release cycle versioning, but I just want to
make everyone knows where we're going.

I wonder if we'll have to change to a more manual management of the
imported packages in the pom, disabling * packages expansions by bnd
and also disabling auto computation of version ranges to make sure
we're aware of changes

On Friday, February 4, 2011,  <ti...@apache.org> wrote:
> Author: timothyjward
> Date: Fri Feb  4 16:13:32 2011
> New Revision: 1067207
>
> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
> Log:
> ARIES-567 - Add a common utility for safe unregistration
>
> Added:
>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
> Removed:
>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
> Modified:
>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>     aries/trunk/quiesce/quiesce-manager/pom.xml
>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>     aries/trunk/transaction/pom.xml
>     aries/trunk/transaction/transaction-manager/pom.xml
>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>     aries/trunk/transaction/transaction-wrappers/pom.xml
>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>
> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
> ==============================================================================
> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
> @@ -57,6 +57,10 @@
>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>        </dependency>
>        <dependency>
> +          <groupId>org.apache.aries</groupId>
> +          <artifactId>org.apache.aries.util</artifactId>
> +      </dependency>
> +      <dependency>
>            <groupId>org.osgi</groupId>
>            <artifactId>org.osgi.core</artifactId>
>            <scope>provided</scope>
>
> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
> ==============================================================================
> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>  import java.util.Dictionary;
>  import java.util.Hashtable;
>
> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
> +import org.apache.aries.util.AriesFrameworkUtil;
>  import org.osgi.framework.BundleActivator;
>  import org.osgi.framework.BundleContext;
>  import org.osgi.framework.Constants;
>  import org.osgi.framework.ServiceRegistration;
> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>
>  public class Activator implements BundleActivator {
>
> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>      }
>
>      public void stop(BundleContext context) {
> -        if (sr != null) {
> -            sr.unregister();
> -        }
> +      AriesFrameworkUtil.safeUnregisterService(sr);
>      }
>
>  }
>
> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
> ==============================================================================
> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>  import org.apache.aries.blueprint.container.ServiceListener;
>  import org.apache.aries.blueprint.utils.JavaUtils;
>  import org.apache.aries.blueprint.utils.ReflectionUtils;
> +import org.apache.aries.util.AriesFrameworkUtil;
>  import org.osgi.framework.Bundle;
>  import org.osgi.framework.Constants;
>  import org.osgi.framework.ServiceReference;
> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>      }
>
>      public void destroy() {
> -        if (registration != null) {
> -            registration.unregister();
> -        }
> +        AriesFrameworkUtil.safeUnregisterService(registration);
>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>          }
> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>              }
>          }
>          destroyComponent(component, code);
> -        registration.unregister();
> +        AriesFrameworkUtil.safeUnregisterService(registration);
>      }
>
>      public Map<ServiceRegistration, Object> getServiceMap() {
>
> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
> ==============================================================================
> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
> @@ -25,6 +25,7 @@ import java.util.HashMap;
>  import java.util.List;
>  import java.util.Properties;
>
> +import org.apache.aries.util.AriesFrameworkUtil;
>  import org.osgi.framework.ServiceRegistration;
>  import org.osgi.service.cm.ConfigurationException;
>  import org.osgi.service.cm.ManagedService;
> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>              reg.remove(cm);
>              if (reg.isEmpty()) {
>                  map.remove(key);
> -                reg.getRegistration().unregister();
> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>              }
>          }
>      }
>
> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
> ==============================================================================
> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>  import org.apache.aries.blueprint.utils.HeaderParser;
>  import org.apache.aries.blueprint.utils.JavaUtils;
>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
> +import org.apache.aries.util.AriesFrameworkUtil;
>  import org.osgi.framework.Bundle;
>  import org.osgi.framework.BundleContext;
>  import org.osgi.framework.Constants;
> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>          if (timeoutFuture != null) {
>              timeoutFuture.cancel(false);
>          }
> -        if (registration != null) {
> -            registration.unregister();
> -        }
> +        AriesFrameworkUtil.safeUnregisterService(registration);
>          if (handlerSet != null) {
>              handlerSet.removeListener(this);
>              handlerSet.destroy();
> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>          if (timeoutFuture != null) {
>              timeoutFuture.cancel(false);
>          }
> -        if (registration != null) {
> -            registration.unregister();
> -        }
> +        AriesFrameworkUtil.safeUnregisterService(registration);
>          if (handlerSet != null) {
>              handlerSet.removeListener(this);
>              handlerSet.destroy();
>
> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
> ==============================================================================
> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>  import org.apache.aries.blueprint.utils.HeaderParser;
>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>  import org.apache.aries.proxy.ProxyManager;
> -import org.apache.aries.util.SingleServiceTracker;
> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
> +import org.apache.aries.util.AriesFrameworkUtil;
>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
> +import org.apache.aries.util.tracker.SingleServiceTracker;
> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>  import org.osgi.framework.Bundle;
>  import org.osgi.framework.BundleActivator;
>  import org.osgi.framework.BundleContext;
> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>                 bt.close();
>          }
>
> -        parserServiceReg.unregister();
> -
> -        if (quiesceParticipantReg != null)
> -               quiesceParticipantReg.unregister();
> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
> +
> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>
>          // Orderly shutdown of containers
>          while (!containers.isEmpty()) {
>
> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
> ==============================================================================
> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>  import org.

-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Alasdair Nottingham <no...@apache.org>.
I think blueprint-cm should be a fragment on blueprint-core and we
should stop exporting those internals.

I think that would fix this problem. I would also need to look further
to see why we get this issue.

Alasdair

On 21 February 2011 13:30, Guillaume Nodet <gn...@gmail.com> wrote:
> On Mon, Feb 21, 2011 at 14:12, Alasdair Nottingham <no...@apache.org> wrote:
>> Let me try an example of what I mean.
>>
>> Bundle A:
>>    package org.example.first
>>    public interface AnInterface {
>>             public org.example.second.AUsefulType createAUsefulType();
>>    }
>>    public class AUsefulStaticUtility {
>>             public void doSomeStuff() {
>>
>> org.example.third.ANotherUsefulUtility.doReallyCoolFunkyStuff();
>>             }
>>    }
>>
>> Bundle B:
>>    package org.example.second
>>    interface AUsefulType {}
>>
>> Bundle C:
>>    package org.example.third
>>    public class ANotherUsefulUtility {
>>            public void doReallyCoolFunkyStuff() {}
>>    }
>>
>> Bundle A exports org.example.first and imports org.example.second and
>> org.example.third.
>> Including uses its export clauses should look like this:
>>
>>   org.example.first; uses="org.example.second"
>>
>> It should not contain org.example.third. A fourth bundle D could
>> easily use org.example.first and
>> org.example.third and have org.example.third imported from a different
>> version to Bundle A because they
>> never attempt to share the types in the package org.example.third. The
>> usage is completely internal, the fact
>> that org.example.first is exported is irrelevant.
>
> I think we agree.  But your example rely on a bad use of uses
> constraints.  Do you reckon my example would need to have a major
> version bump ?
> Btw, I haven't checked, but does BND put the third package in uses
> clauses in your example ?  if so, maybe it should get fixed if
> possible.
>
>> Going back to the blueprint example I do not believe that the
>> blueprint API references any types from the
>> util package, so the usage is internal and therefore does not affect
>> the uses clause. As a result blueprint can
>> use 1.0.0 without affecting its clients.
>
> So blueprint-core actually export org.apache.aries.blueprint.container
> with a use constraint on org.apache.aries.util and
> org.apache.aries.util.tracker.
> So in the current state, the org.apache.aries.blueprint.container
> package version would have to be bumped to a major version, hence the
> whole blueprint-core bundle version.
> Though maybe those use constraints should not be here as you depicted
> in your example.
>
>> On 21 February 2011 12:53, Guillaume Nodet <gn...@gmail.com> wrote:
>>> Oops, hit send too early
>>>
>>> On Mon, Feb 21, 2011 at 13:46, Guillaume Nodet <gn...@gmail.com> wrote:
>>>> On Mon, Feb 21, 2011 at 13:42, Alasdair Nottingham <no...@apache.org> wrote:
>>>>> On 21 February 2011 12:19, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>> On Mon, Feb 21, 2011 at 12:28, Alasdair Nottingham <no...@apache.org> wrote:
>>>>>>> So assume we released util as a 1.0 bundle, why would that prevent
>>>>>>> blueprint 0.4
>>>>>>> using it? I don't think I've seen anything that says you have to bump your major
>>>>>>> version based on the dependency doing so. That seems like a crazy idea. You
>>>>>>> should only bump your major version if you have to.
>>>>>>
>>>>>> Ok, so let's think about that a bit more.  I think the case is a bit
>>>>>> different if the package is exported or not.
>>>>>> If the package is exported, the dependent package will be imported and
>>>>>> end up in uses constraints, so if you change the import range to be
>>>>>> incompatible, you actually have a major incompatibility I think.  If I
>>>>>> have a bundle that depend on both packages, my bundle would clearly
>>>>>> become unusable with the new version, which means it's a major change
>>>>>> on the package actually.
>>>>>> If the package isn't exported, the change would at least require other
>>>>>> updates in bundles, so while the packages would still be fully
>>>>>> compatible, the bundle version should be incremented from at least a
>>>>>> minor version imho.
>>>>>> Here, I'm not sure that any package depending on aries-util is
>>>>>> actually exported, but we'd have to check.
>>>>>>
>>>>>
>>>>> I do not think this is how uses should be interpreted. uses is designed to solve
>>>>> the problem whereby a package A returns, or receives types from package B and
>>>>> you want to ensure the bundle and its clients have a consistent view
>>>>> of A and B. It
>>>>> is not there to ensure that bundle A and bundle B share the same copy
>>>>> of a package
>>>>> A when package A is strictly part of the internals. As a result the
>>>>> scenario you describe
>>>>> would never happen.
>>>>
>>>
>>> That's what I said about non exported packages.   But uses constraints
>>> are on exported packages and one of the goal of uses constraints is to
>>> ensure a consistent class-space.  If you change it in an incompatible
>>> way, that is an incompatible change.  Unless we differ on the notion
>>> of compatible.    Let's take a clear example:
>>>
>>> Bundle bundle.a exports a package named package.a in version 1.0
>>> Bundle bundle.b exports a package named package.b in version 1.0 which
>>> uses package.a with a range [1,2)
>>> Bundle bundle.c imports package.a with [1,2) and package.b with [1,2)
>>>
>>> Now, the use case here is the following modification:
>>>  bundle.a exports package.a in version 2.0
>>>  bundle.b exports package.b in version 1.1 and imports bundle.a in
>>> version [2,3)
>>>
>>> Now I can use bundle.c anymore with the newer version of bundle.v as
>>> the resolver won't allow such an inconsistent class-space caused by
>>> the two incompaitble versions of bundle.a.
>>> WHich is to me a clear indication that package.b has changed in an
>>> incompatible way.
>>>
>>> Am I wrong somehwere ?
>>>
>>>
>>>>
>>>>>
>>>>>>> I would also say that until we have had a vote about exactly what we are doing
>>>>>>> regarding releasing and versioning this kind of activity is a little premature.
>>>>>>
>>>>>> Well, I'm raising things that we need to keep in mind when we vote for
>>>>>> the policy we'll use.   We were supposed to use a release cycle at the
>>>>>> component level, so I'm actually trying to release blueprint without
>>>>>> having to release everything, that's all.  If/when we move that at the
>>>>>> bundle level, things will be even more complicated.
>>>>>>
>>>>>
>>>>> I am not saying that raising the issue is premature, I am saying that creating a
>>>>> branch is premature.
>>>>
>>>> So are you suggesting I release aries-util 0.4 with such a major
>>>> incompatiblity (meaning I may break all other aries components) in
>>>> order to be able to release blueprint 0.4 ?
>>>>
>>>>>
>>>>>>> Alasdair
>>>>>>>
>>>>>>> On 21 February 2011 11:21, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>> Sorry for not being more clear, I was referring to the following change:
>>>>>>>>
>>>>>>>>> Removed:
>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>
>>>>>>>> One class has been deleted from a package, so that's a major
>>>>>>>> incompabible change which needs aries-util version to be bumped to 1.0
>>>>>>>> according to semantic versioning rules.  What I'm not sure is how it
>>>>>>>> affect other projects, for example blueprint trunk would need to
>>>>>>>> change the aries-util dependency from [0.3,1) to [1,2) and I'm not
>>>>>>>> sure how the blueprint version should reflect that change.
>>>>>>>>
>>>>>>>> I don't really want to include an update to a new major version of a
>>>>>>>> dependency in a minor release of blueprint, so I think we should bump
>>>>>>>> blueprint to 1.0, hence my point of creating a 0.4 branch for
>>>>>>>> blueprint.
>>>>>>>>
>>>>>>>> Hope it's a bit more clear now.
>>>>>>>>
>>>>>>>> On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham <no...@apache.org> wrote:
>>>>>>>>> Can you clarify what in this commit you are objecting to? There were
>>>>>>>>> rather a large number of
>>>>>>>>> changes not all of which are included in your email.
>>>>>>>>>
>>>>>>>>> Why would you create a branch for blueprint 0.4? What is the point?
>>>>>>>>>
>>>>>>>>> Alasdair
>>>>>>>>>
>>>>>>>>> On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>>>> I come back to this commit as this is a *major* incompatibility change.
>>>>>>>>>> The util package major version need be bumped up.  I'm not quite sure
>>>>>>>>>> what kind of changes that impact on downstream bundles (blueprint,
>>>>>>>>>> jndi, jpa, etc...) but I think the cascading effect is that their
>>>>>>>>>> major version need to be bumped too.  Can someone please have a look
>>>>>>>>>> at that and fix the problems ?
>>>>>>>>>>
>>>>>>>>>> I'll create a branch for blueprint 0.4.x which can work with other
>>>>>>>>>> components in 0.3 as that's what is implied the version range is
>>>>>>>>>> afaik.
>>>>>>>>>>
>>>>>>>>>> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>>>>> While I do not question the validity of such changes, it tends to
>>>>>>>>>>> confirm my impression that we have components that are quite tied
>>>>>>>>>>> together and that we'll never be able to release them independantly
>>>>>>>>>>> (apart from bug fix release which do not matter here).
>>>>>>>>>>> How easy would such things be if we had several trunks, one jira per
>>>>>>>>>>> component, each jira associated to a different version in jira...
>>>>>>>>>>> This also changes the constraints on the packages imported by a
>>>>>>>>>>> component, so you'd have to change some package versions.  That's
>>>>>>>>>>> kinda bad as if a user want to update one bundle, he has to actually
>>>>>>>>>>> update a bunch of bundles.  if we're going to use a different version
>>>>>>>>>>> for each component, we'd have to keep track of the compatibility
>>>>>>>>>>> somewhere so that this can appear in the release notes.
>>>>>>>>>>>
>>>>>>>>>>> i'll stop to lobby on the release cycle versioning, but I just want to
>>>>>>>>>>> make everyone knows where we're going.
>>>>>>>>>>>
>>>>>>>>>>> I wonder if we'll have to change to a more manual management of the
>>>>>>>>>>> imported packages in the pom, disabling * packages expansions by bnd
>>>>>>>>>>> and also disabling auto computation of version ranges to make sure
>>>>>>>>>>> we're aware of changes
>>>>>>>>>>>
>>>>>>>>>>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>>>>>>>>>>> Author: timothyjward
>>>>>>>>>>>> Date: Fri Feb  4 16:13:32 2011
>>>>>>>>>>>> New Revision: 1067207
>>>>>>>>>>>>
>>>>>>>>>>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>>>>>>>>>>> Log:
>>>>>>>>>>>> ARIES-567 - Add a common utility for safe unregistration
>>>>>>>>>>>>
>>>>>>>>>>>> Added:
>>>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>>>>>>>>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>>>>> Removed:
>>>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>>>>> Modified:
>>>>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>>>>>>>>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>>>>>>>>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>>>>>>>>>>     aries/trunk/transaction/pom.xml
>>>>>>>>>>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>>>>>>>>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>>>>>>>>>>
>>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>>> ==============================================================================
>>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>>>>>>>>>>> @@ -57,6 +57,10 @@
>>>>>>>>>>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>>>>>>>>>>        </dependency>
>>>>>>>>>>>>        <dependency>
>>>>>>>>>>>> +          <groupId>org.apache.aries</groupId>
>>>>>>>>>>>> +          <artifactId>org.apache.aries.util</artifactId>
>>>>>>>>>>>> +      </dependency>
>>>>>>>>>>>> +      <dependency>
>>>>>>>>>>>>            <groupId>org.osgi</groupId>
>>>>>>>>>>>>            <artifactId>org.osgi.core</artifactId>
>>>>>>>>>>>>            <scope>provided</scope>
>>>>>>>>>>>>
>>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>>> ==============================================================================
>>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>>>>>>>>>>  import java.util.Dictionary;
>>>>>>>>>>>>  import java.util.Hashtable;
>>>>>>>>>>>>
>>>>>>>>>>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>>>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>>>>>
>>>>>>>>>>>>  public class Activator implements BundleActivator {
>>>>>>>>>>>>
>>>>>>>>>>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>>>>>>>>>>      }
>>>>>>>>>>>>
>>>>>>>>>>>>      public void stop(BundleContext context) {
>>>>>>>>>>>> -        if (sr != null) {
>>>>>>>>>>>> -            sr.unregister();
>>>>>>>>>>>> -        }
>>>>>>>>>>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>>>>>>>>>>      }
>>>>>>>>>>>>
>>>>>>>>>>>>  }
>>>>>>>>>>>>
>>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>>> ==============================================================================
>>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>>>>>>>>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>>>  import org.osgi.framework.ServiceReference;
>>>>>>>>>>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>>>>      }
>>>>>>>>>>>>
>>>>>>>>>>>>      public void destroy() {
>>>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>>>> -            registration.unregister();
>>>>>>>>>>>> -        }
>>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>>>>>>>>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>>>>>>>>>>          }
>>>>>>>>>>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>>>>              }
>>>>>>>>>>>>          }
>>>>>>>>>>>>          destroyComponent(component, code);
>>>>>>>>>>>> -        registration.unregister();
>>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>>>      }
>>>>>>>>>>>>
>>>>>>>>>>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>>>>>>>>>>
>>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>>> ==============================================================================
>>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>>>>>>>>>>  import java.util.List;
>>>>>>>>>>>>  import java.util.Properties;
>>>>>>>>>>>>
>>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>>>>>  import org.osgi.service.cm.ConfigurationException;
>>>>>>>>>>>>  import org.osgi.service.cm.ManagedService;
>>>>>>>>>>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>>>>>>>>>>              reg.remove(cm);
>>>>>>>>>>>>              if (reg.isEmpty()) {
>>>>>>>>>>>>                  map.remove(key);
>>>>>>>>>>>> -                reg.getRegistration().unregister();
>>>>>>>>>>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>>>>>>>>>>              }
>>>>>>>>>>>>          }
>>>>>>>>>>>>      }
>>>>>>>>>>>>
>>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>>> ==============================================================================
>>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>>>>          }
>>>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>>>> -            registration.unregister();
>>>>>>>>>>>> -        }
>>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>>>>              handlerSet.destroy();
>>>>>>>>>>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>>>>          }
>>>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>>>> -            registration.unregister();
>>>>>>>>>>>> -        }
>>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>>>>              handlerSet.destroy();
>>>>>>>>>>>>
>>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>>> ==============================================================================
>>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>>>>>  import org.apache.aries.proxy.ProxyManager;
>>>>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker;
>>>>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>>>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>>>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>>>>>>>>>>                 bt.close();
>>>>>>>>>>>>          }
>>>>>>>>>>>>
>>>>>>>>>>>> -        parserServiceReg.unregister();
>>>>>>>>>>>> -
>>>>>>>>>>>> -        if (quiesceParticipantReg != null)
>>>>>>>>>>>> -               quiesceParticipantReg.unregister();
>>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>>>>>>>>>>> +
>>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>>>>>>>>>>
>>>>>>>>>>>>          // Orderly shutdown of containers
>>>>>>>>>>>>          while (!containers.isEmpty()) {
>>>>>>>>>>>>
>>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>>> ==============================================================================
>>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>>>>>>>>>>  import org.
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> 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
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Alasdair Nottingham
>>>>>>>>> not@apache.org
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Cheers,
>>>>>>>> Guillaume Nodet
>>>>>>>> ------------------------
>>>>>>>> Blog: http://gnodet.blogspot.com/
>>>>>>>> ------------------------
>>>>>>>> Open Source SOA
>>>>>>>> http://fusesource.com
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Alasdair Nottingham
>>>>>>> not@apache.org
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Cheers,
>>>>>> Guillaume Nodet
>>>>>> ------------------------
>>>>>> Blog: http://gnodet.blogspot.com/
>>>>>> ------------------------
>>>>>> Open Source SOA
>>>>>> http://fusesource.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Alasdair Nottingham
>>>>> not@apache.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> 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
>>>
>>
>>
>>
>> --
>> Alasdair Nottingham
>> not@apache.org
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>



-- 
Alasdair Nottingham
not@apache.org

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Guillaume Nodet <gn...@gmail.com>.
On Mon, Feb 21, 2011 at 14:12, Alasdair Nottingham <no...@apache.org> wrote:
> Let me try an example of what I mean.
>
> Bundle A:
>    package org.example.first
>    public interface AnInterface {
>             public org.example.second.AUsefulType createAUsefulType();
>    }
>    public class AUsefulStaticUtility {
>             public void doSomeStuff() {
>
> org.example.third.ANotherUsefulUtility.doReallyCoolFunkyStuff();
>             }
>    }
>
> Bundle B:
>    package org.example.second
>    interface AUsefulType {}
>
> Bundle C:
>    package org.example.third
>    public class ANotherUsefulUtility {
>            public void doReallyCoolFunkyStuff() {}
>    }
>
> Bundle A exports org.example.first and imports org.example.second and
> org.example.third.
> Including uses its export clauses should look like this:
>
>   org.example.first; uses="org.example.second"
>
> It should not contain org.example.third. A fourth bundle D could
> easily use org.example.first and
> org.example.third and have org.example.third imported from a different
> version to Bundle A because they
> never attempt to share the types in the package org.example.third. The
> usage is completely internal, the fact
> that org.example.first is exported is irrelevant.

I think we agree.  But your example rely on a bad use of uses
constraints.  Do you reckon my example would need to have a major
version bump ?
Btw, I haven't checked, but does BND put the third package in uses
clauses in your example ?  if so, maybe it should get fixed if
possible.

> Going back to the blueprint example I do not believe that the
> blueprint API references any types from the
> util package, so the usage is internal and therefore does not affect
> the uses clause. As a result blueprint can
> use 1.0.0 without affecting its clients.

So blueprint-core actually export org.apache.aries.blueprint.container
with a use constraint on org.apache.aries.util and
org.apache.aries.util.tracker.
So in the current state, the org.apache.aries.blueprint.container
package version would have to be bumped to a major version, hence the
whole blueprint-core bundle version.
Though maybe those use constraints should not be here as you depicted
in your example.

> On 21 February 2011 12:53, Guillaume Nodet <gn...@gmail.com> wrote:
>> Oops, hit send too early
>>
>> On Mon, Feb 21, 2011 at 13:46, Guillaume Nodet <gn...@gmail.com> wrote:
>>> On Mon, Feb 21, 2011 at 13:42, Alasdair Nottingham <no...@apache.org> wrote:
>>>> On 21 February 2011 12:19, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>> On Mon, Feb 21, 2011 at 12:28, Alasdair Nottingham <no...@apache.org> wrote:
>>>>>> So assume we released util as a 1.0 bundle, why would that prevent
>>>>>> blueprint 0.4
>>>>>> using it? I don't think I've seen anything that says you have to bump your major
>>>>>> version based on the dependency doing so. That seems like a crazy idea. You
>>>>>> should only bump your major version if you have to.
>>>>>
>>>>> Ok, so let's think about that a bit more.  I think the case is a bit
>>>>> different if the package is exported or not.
>>>>> If the package is exported, the dependent package will be imported and
>>>>> end up in uses constraints, so if you change the import range to be
>>>>> incompatible, you actually have a major incompatibility I think.  If I
>>>>> have a bundle that depend on both packages, my bundle would clearly
>>>>> become unusable with the new version, which means it's a major change
>>>>> on the package actually.
>>>>> If the package isn't exported, the change would at least require other
>>>>> updates in bundles, so while the packages would still be fully
>>>>> compatible, the bundle version should be incremented from at least a
>>>>> minor version imho.
>>>>> Here, I'm not sure that any package depending on aries-util is
>>>>> actually exported, but we'd have to check.
>>>>>
>>>>
>>>> I do not think this is how uses should be interpreted. uses is designed to solve
>>>> the problem whereby a package A returns, or receives types from package B and
>>>> you want to ensure the bundle and its clients have a consistent view
>>>> of A and B. It
>>>> is not there to ensure that bundle A and bundle B share the same copy
>>>> of a package
>>>> A when package A is strictly part of the internals. As a result the
>>>> scenario you describe
>>>> would never happen.
>>>
>>
>> That's what I said about non exported packages.   But uses constraints
>> are on exported packages and one of the goal of uses constraints is to
>> ensure a consistent class-space.  If you change it in an incompatible
>> way, that is an incompatible change.  Unless we differ on the notion
>> of compatible.    Let's take a clear example:
>>
>> Bundle bundle.a exports a package named package.a in version 1.0
>> Bundle bundle.b exports a package named package.b in version 1.0 which
>> uses package.a with a range [1,2)
>> Bundle bundle.c imports package.a with [1,2) and package.b with [1,2)
>>
>> Now, the use case here is the following modification:
>>  bundle.a exports package.a in version 2.0
>>  bundle.b exports package.b in version 1.1 and imports bundle.a in
>> version [2,3)
>>
>> Now I can use bundle.c anymore with the newer version of bundle.v as
>> the resolver won't allow such an inconsistent class-space caused by
>> the two incompaitble versions of bundle.a.
>> WHich is to me a clear indication that package.b has changed in an
>> incompatible way.
>>
>> Am I wrong somehwere ?
>>
>>
>>>
>>>>
>>>>>> I would also say that until we have had a vote about exactly what we are doing
>>>>>> regarding releasing and versioning this kind of activity is a little premature.
>>>>>
>>>>> Well, I'm raising things that we need to keep in mind when we vote for
>>>>> the policy we'll use.   We were supposed to use a release cycle at the
>>>>> component level, so I'm actually trying to release blueprint without
>>>>> having to release everything, that's all.  If/when we move that at the
>>>>> bundle level, things will be even more complicated.
>>>>>
>>>>
>>>> I am not saying that raising the issue is premature, I am saying that creating a
>>>> branch is premature.
>>>
>>> So are you suggesting I release aries-util 0.4 with such a major
>>> incompatiblity (meaning I may break all other aries components) in
>>> order to be able to release blueprint 0.4 ?
>>>
>>>>
>>>>>> Alasdair
>>>>>>
>>>>>> On 21 February 2011 11:21, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>> Sorry for not being more clear, I was referring to the following change:
>>>>>>>
>>>>>>>> Removed:
>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>
>>>>>>> One class has been deleted from a package, so that's a major
>>>>>>> incompabible change which needs aries-util version to be bumped to 1.0
>>>>>>> according to semantic versioning rules.  What I'm not sure is how it
>>>>>>> affect other projects, for example blueprint trunk would need to
>>>>>>> change the aries-util dependency from [0.3,1) to [1,2) and I'm not
>>>>>>> sure how the blueprint version should reflect that change.
>>>>>>>
>>>>>>> I don't really want to include an update to a new major version of a
>>>>>>> dependency in a minor release of blueprint, so I think we should bump
>>>>>>> blueprint to 1.0, hence my point of creating a 0.4 branch for
>>>>>>> blueprint.
>>>>>>>
>>>>>>> Hope it's a bit more clear now.
>>>>>>>
>>>>>>> On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham <no...@apache.org> wrote:
>>>>>>>> Can you clarify what in this commit you are objecting to? There were
>>>>>>>> rather a large number of
>>>>>>>> changes not all of which are included in your email.
>>>>>>>>
>>>>>>>> Why would you create a branch for blueprint 0.4? What is the point?
>>>>>>>>
>>>>>>>> Alasdair
>>>>>>>>
>>>>>>>> On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>>> I come back to this commit as this is a *major* incompatibility change.
>>>>>>>>> The util package major version need be bumped up.  I'm not quite sure
>>>>>>>>> what kind of changes that impact on downstream bundles (blueprint,
>>>>>>>>> jndi, jpa, etc...) but I think the cascading effect is that their
>>>>>>>>> major version need to be bumped too.  Can someone please have a look
>>>>>>>>> at that and fix the problems ?
>>>>>>>>>
>>>>>>>>> I'll create a branch for blueprint 0.4.x which can work with other
>>>>>>>>> components in 0.3 as that's what is implied the version range is
>>>>>>>>> afaik.
>>>>>>>>>
>>>>>>>>> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>>>> While I do not question the validity of such changes, it tends to
>>>>>>>>>> confirm my impression that we have components that are quite tied
>>>>>>>>>> together and that we'll never be able to release them independantly
>>>>>>>>>> (apart from bug fix release which do not matter here).
>>>>>>>>>> How easy would such things be if we had several trunks, one jira per
>>>>>>>>>> component, each jira associated to a different version in jira...
>>>>>>>>>> This also changes the constraints on the packages imported by a
>>>>>>>>>> component, so you'd have to change some package versions.  That's
>>>>>>>>>> kinda bad as if a user want to update one bundle, he has to actually
>>>>>>>>>> update a bunch of bundles.  if we're going to use a different version
>>>>>>>>>> for each component, we'd have to keep track of the compatibility
>>>>>>>>>> somewhere so that this can appear in the release notes.
>>>>>>>>>>
>>>>>>>>>> i'll stop to lobby on the release cycle versioning, but I just want to
>>>>>>>>>> make everyone knows where we're going.
>>>>>>>>>>
>>>>>>>>>> I wonder if we'll have to change to a more manual management of the
>>>>>>>>>> imported packages in the pom, disabling * packages expansions by bnd
>>>>>>>>>> and also disabling auto computation of version ranges to make sure
>>>>>>>>>> we're aware of changes
>>>>>>>>>>
>>>>>>>>>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>>>>>>>>>> Author: timothyjward
>>>>>>>>>>> Date: Fri Feb  4 16:13:32 2011
>>>>>>>>>>> New Revision: 1067207
>>>>>>>>>>>
>>>>>>>>>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>>>>>>>>>> Log:
>>>>>>>>>>> ARIES-567 - Add a common utility for safe unregistration
>>>>>>>>>>>
>>>>>>>>>>> Added:
>>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>>>>>>>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>>>> Removed:
>>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>>>> Modified:
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>>>>>>>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>>>>>>>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>>>>>>>>>     aries/trunk/transaction/pom.xml
>>>>>>>>>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>>>>>>>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -57,6 +57,10 @@
>>>>>>>>>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>>>>>>>>>        </dependency>
>>>>>>>>>>>        <dependency>
>>>>>>>>>>> +          <groupId>org.apache.aries</groupId>
>>>>>>>>>>> +          <artifactId>org.apache.aries.util</artifactId>
>>>>>>>>>>> +      </dependency>
>>>>>>>>>>> +      <dependency>
>>>>>>>>>>>            <groupId>org.osgi</groupId>
>>>>>>>>>>>            <artifactId>org.osgi.core</artifactId>
>>>>>>>>>>>            <scope>provided</scope>
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>>>>>>>>>  import java.util.Dictionary;
>>>>>>>>>>>  import java.util.Hashtable;
>>>>>>>>>>>
>>>>>>>>>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>>>>
>>>>>>>>>>>  public class Activator implements BundleActivator {
>>>>>>>>>>>
>>>>>>>>>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>>>>>>>>>      }
>>>>>>>>>>>
>>>>>>>>>>>      public void stop(BundleContext context) {
>>>>>>>>>>> -        if (sr != null) {
>>>>>>>>>>> -            sr.unregister();
>>>>>>>>>>> -        }
>>>>>>>>>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>>>>>>>>>      }
>>>>>>>>>>>
>>>>>>>>>>>  }
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>>>>>>>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>>  import org.osgi.framework.ServiceReference;
>>>>>>>>>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>>>      }
>>>>>>>>>>>
>>>>>>>>>>>      public void destroy() {
>>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>>> -            registration.unregister();
>>>>>>>>>>> -        }
>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>>>>>>>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>>>>>>>>>          }
>>>>>>>>>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>>>              }
>>>>>>>>>>>          }
>>>>>>>>>>>          destroyComponent(component, code);
>>>>>>>>>>> -        registration.unregister();
>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>>      }
>>>>>>>>>>>
>>>>>>>>>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>>>>>>>>>  import java.util.List;
>>>>>>>>>>>  import java.util.Properties;
>>>>>>>>>>>
>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>>>>  import org.osgi.service.cm.ConfigurationException;
>>>>>>>>>>>  import org.osgi.service.cm.ManagedService;
>>>>>>>>>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>>>>>>>>>              reg.remove(cm);
>>>>>>>>>>>              if (reg.isEmpty()) {
>>>>>>>>>>>                  map.remove(key);
>>>>>>>>>>> -                reg.getRegistration().unregister();
>>>>>>>>>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>>>>>>>>>              }
>>>>>>>>>>>          }
>>>>>>>>>>>      }
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>>>          }
>>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>>> -            registration.unregister();
>>>>>>>>>>> -        }
>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>>>              handlerSet.destroy();
>>>>>>>>>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>>>          }
>>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>>> -            registration.unregister();
>>>>>>>>>>> -        }
>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>>>              handlerSet.destroy();
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>>>>  import org.apache.aries.proxy.ProxyManager;
>>>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker;
>>>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>>>>>>>>>                 bt.close();
>>>>>>>>>>>          }
>>>>>>>>>>>
>>>>>>>>>>> -        parserServiceReg.unregister();
>>>>>>>>>>> -
>>>>>>>>>>> -        if (quiesceParticipantReg != null)
>>>>>>>>>>> -               quiesceParticipantReg.unregister();
>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>>>>>>>>>> +
>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>>>>>>>>>
>>>>>>>>>>>          // Orderly shutdown of containers
>>>>>>>>>>>          while (!containers.isEmpty()) {
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>>>>>>>>>  import org.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> 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
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Alasdair Nottingham
>>>>>>>> not@apache.org
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Cheers,
>>>>>>> Guillaume Nodet
>>>>>>> ------------------------
>>>>>>> Blog: http://gnodet.blogspot.com/
>>>>>>> ------------------------
>>>>>>> Open Source SOA
>>>>>>> http://fusesource.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Alasdair Nottingham
>>>>>> not@apache.org
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Cheers,
>>>>> Guillaume Nodet
>>>>> ------------------------
>>>>> Blog: http://gnodet.blogspot.com/
>>>>> ------------------------
>>>>> Open Source SOA
>>>>> http://fusesource.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Alasdair Nottingham
>>>> not@apache.org
>>>>
>>>
>>>
>>>
>>> --
>>> 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
>>
>
>
>
> --
> Alasdair Nottingham
> not@apache.org
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Alasdair Nottingham <no...@apache.org>.
Let me try an example of what I mean.

Bundle A:
    package org.example.first
    public interface AnInterface {
             public org.example.second.AUsefulType createAUsefulType();
    }
    public class AUsefulStaticUtility {
             public void doSomeStuff() {

org.example.third.ANotherUsefulUtility.doReallyCoolFunkyStuff();
             }
    }

Bundle B:
    package org.example.second
    interface AUsefulType {}

Bundle C:
    package org.example.third
    public class ANotherUsefulUtility {
            public void doReallyCoolFunkyStuff() {}
    }

Bundle A exports org.example.first and imports org.example.second and
org.example.third.
Including uses its export clauses should look like this:

   org.example.first; uses="org.example.second"

It should not contain org.example.third. A fourth bundle D could
easily use org.example.first and
org.example.third and have org.example.third imported from a different
version to Bundle A because they
never attempt to share the types in the package org.example.third. The
usage is completely internal, the fact
that org.example.first is exported is irrelevant.

Going back to the blueprint example I do not believe that the
blueprint API references any types from the
util package, so the usage is internal and therefore does not affect
the uses clause. As a result blueprint can
use 1.0.0 without affecting its clients.

On 21 February 2011 12:53, Guillaume Nodet <gn...@gmail.com> wrote:
> Oops, hit send too early
>
> On Mon, Feb 21, 2011 at 13:46, Guillaume Nodet <gn...@gmail.com> wrote:
>> On Mon, Feb 21, 2011 at 13:42, Alasdair Nottingham <no...@apache.org> wrote:
>>> On 21 February 2011 12:19, Guillaume Nodet <gn...@gmail.com> wrote:
>>>> On Mon, Feb 21, 2011 at 12:28, Alasdair Nottingham <no...@apache.org> wrote:
>>>>> So assume we released util as a 1.0 bundle, why would that prevent
>>>>> blueprint 0.4
>>>>> using it? I don't think I've seen anything that says you have to bump your major
>>>>> version based on the dependency doing so. That seems like a crazy idea. You
>>>>> should only bump your major version if you have to.
>>>>
>>>> Ok, so let's think about that a bit more.  I think the case is a bit
>>>> different if the package is exported or not.
>>>> If the package is exported, the dependent package will be imported and
>>>> end up in uses constraints, so if you change the import range to be
>>>> incompatible, you actually have a major incompatibility I think.  If I
>>>> have a bundle that depend on both packages, my bundle would clearly
>>>> become unusable with the new version, which means it's a major change
>>>> on the package actually.
>>>> If the package isn't exported, the change would at least require other
>>>> updates in bundles, so while the packages would still be fully
>>>> compatible, the bundle version should be incremented from at least a
>>>> minor version imho.
>>>> Here, I'm not sure that any package depending on aries-util is
>>>> actually exported, but we'd have to check.
>>>>
>>>
>>> I do not think this is how uses should be interpreted. uses is designed to solve
>>> the problem whereby a package A returns, or receives types from package B and
>>> you want to ensure the bundle and its clients have a consistent view
>>> of A and B. It
>>> is not there to ensure that bundle A and bundle B share the same copy
>>> of a package
>>> A when package A is strictly part of the internals. As a result the
>>> scenario you describe
>>> would never happen.
>>
>
> That's what I said about non exported packages.   But uses constraints
> are on exported packages and one of the goal of uses constraints is to
> ensure a consistent class-space.  If you change it in an incompatible
> way, that is an incompatible change.  Unless we differ on the notion
> of compatible.    Let's take a clear example:
>
> Bundle bundle.a exports a package named package.a in version 1.0
> Bundle bundle.b exports a package named package.b in version 1.0 which
> uses package.a with a range [1,2)
> Bundle bundle.c imports package.a with [1,2) and package.b with [1,2)
>
> Now, the use case here is the following modification:
>  bundle.a exports package.a in version 2.0
>  bundle.b exports package.b in version 1.1 and imports bundle.a in
> version [2,3)
>
> Now I can use bundle.c anymore with the newer version of bundle.v as
> the resolver won't allow such an inconsistent class-space caused by
> the two incompaitble versions of bundle.a.
> WHich is to me a clear indication that package.b has changed in an
> incompatible way.
>
> Am I wrong somehwere ?
>
>
>>
>>>
>>>>> I would also say that until we have had a vote about exactly what we are doing
>>>>> regarding releasing and versioning this kind of activity is a little premature.
>>>>
>>>> Well, I'm raising things that we need to keep in mind when we vote for
>>>> the policy we'll use.   We were supposed to use a release cycle at the
>>>> component level, so I'm actually trying to release blueprint without
>>>> having to release everything, that's all.  If/when we move that at the
>>>> bundle level, things will be even more complicated.
>>>>
>>>
>>> I am not saying that raising the issue is premature, I am saying that creating a
>>> branch is premature.
>>
>> So are you suggesting I release aries-util 0.4 with such a major
>> incompatiblity (meaning I may break all other aries components) in
>> order to be able to release blueprint 0.4 ?
>>
>>>
>>>>> Alasdair
>>>>>
>>>>> On 21 February 2011 11:21, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>> Sorry for not being more clear, I was referring to the following change:
>>>>>>
>>>>>>> Removed:
>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>
>>>>>> One class has been deleted from a package, so that's a major
>>>>>> incompabible change which needs aries-util version to be bumped to 1.0
>>>>>> according to semantic versioning rules.  What I'm not sure is how it
>>>>>> affect other projects, for example blueprint trunk would need to
>>>>>> change the aries-util dependency from [0.3,1) to [1,2) and I'm not
>>>>>> sure how the blueprint version should reflect that change.
>>>>>>
>>>>>> I don't really want to include an update to a new major version of a
>>>>>> dependency in a minor release of blueprint, so I think we should bump
>>>>>> blueprint to 1.0, hence my point of creating a 0.4 branch for
>>>>>> blueprint.
>>>>>>
>>>>>> Hope it's a bit more clear now.
>>>>>>
>>>>>> On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham <no...@apache.org> wrote:
>>>>>>> Can you clarify what in this commit you are objecting to? There were
>>>>>>> rather a large number of
>>>>>>> changes not all of which are included in your email.
>>>>>>>
>>>>>>> Why would you create a branch for blueprint 0.4? What is the point?
>>>>>>>
>>>>>>> Alasdair
>>>>>>>
>>>>>>> On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>> I come back to this commit as this is a *major* incompatibility change.
>>>>>>>> The util package major version need be bumped up.  I'm not quite sure
>>>>>>>> what kind of changes that impact on downstream bundles (blueprint,
>>>>>>>> jndi, jpa, etc...) but I think the cascading effect is that their
>>>>>>>> major version need to be bumped too.  Can someone please have a look
>>>>>>>> at that and fix the problems ?
>>>>>>>>
>>>>>>>> I'll create a branch for blueprint 0.4.x which can work with other
>>>>>>>> components in 0.3 as that's what is implied the version range is
>>>>>>>> afaik.
>>>>>>>>
>>>>>>>> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>>> While I do not question the validity of such changes, it tends to
>>>>>>>>> confirm my impression that we have components that are quite tied
>>>>>>>>> together and that we'll never be able to release them independantly
>>>>>>>>> (apart from bug fix release which do not matter here).
>>>>>>>>> How easy would such things be if we had several trunks, one jira per
>>>>>>>>> component, each jira associated to a different version in jira...
>>>>>>>>> This also changes the constraints on the packages imported by a
>>>>>>>>> component, so you'd have to change some package versions.  That's
>>>>>>>>> kinda bad as if a user want to update one bundle, he has to actually
>>>>>>>>> update a bunch of bundles.  if we're going to use a different version
>>>>>>>>> for each component, we'd have to keep track of the compatibility
>>>>>>>>> somewhere so that this can appear in the release notes.
>>>>>>>>>
>>>>>>>>> i'll stop to lobby on the release cycle versioning, but I just want to
>>>>>>>>> make everyone knows where we're going.
>>>>>>>>>
>>>>>>>>> I wonder if we'll have to change to a more manual management of the
>>>>>>>>> imported packages in the pom, disabling * packages expansions by bnd
>>>>>>>>> and also disabling auto computation of version ranges to make sure
>>>>>>>>> we're aware of changes
>>>>>>>>>
>>>>>>>>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>>>>>>>>> Author: timothyjward
>>>>>>>>>> Date: Fri Feb  4 16:13:32 2011
>>>>>>>>>> New Revision: 1067207
>>>>>>>>>>
>>>>>>>>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>>>>>>>>> Log:
>>>>>>>>>> ARIES-567 - Add a common utility for safe unregistration
>>>>>>>>>>
>>>>>>>>>> Added:
>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>>>>>>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>>> Removed:
>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>>> Modified:
>>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>>>>>>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>>>>>>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>>>>>>>>     aries/trunk/transaction/pom.xml
>>>>>>>>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>>>>>>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -57,6 +57,10 @@
>>>>>>>>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>>>>>>>>        </dependency>
>>>>>>>>>>        <dependency>
>>>>>>>>>> +          <groupId>org.apache.aries</groupId>
>>>>>>>>>> +          <artifactId>org.apache.aries.util</artifactId>
>>>>>>>>>> +      </dependency>
>>>>>>>>>> +      <dependency>
>>>>>>>>>>            <groupId>org.osgi</groupId>
>>>>>>>>>>            <artifactId>org.osgi.core</artifactId>
>>>>>>>>>>            <scope>provided</scope>
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>>>>>>>>  import java.util.Dictionary;
>>>>>>>>>>  import java.util.Hashtable;
>>>>>>>>>>
>>>>>>>>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>>>
>>>>>>>>>>  public class Activator implements BundleActivator {
>>>>>>>>>>
>>>>>>>>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>>>>>>>>      }
>>>>>>>>>>
>>>>>>>>>>      public void stop(BundleContext context) {
>>>>>>>>>> -        if (sr != null) {
>>>>>>>>>> -            sr.unregister();
>>>>>>>>>> -        }
>>>>>>>>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>>>>>>>>      }
>>>>>>>>>>
>>>>>>>>>>  }
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>>>>>>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>  import org.osgi.framework.ServiceReference;
>>>>>>>>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>>      }
>>>>>>>>>>
>>>>>>>>>>      public void destroy() {
>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>> -            registration.unregister();
>>>>>>>>>> -        }
>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>>>>>>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>>>>>>>>          }
>>>>>>>>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>>              }
>>>>>>>>>>          }
>>>>>>>>>>          destroyComponent(component, code);
>>>>>>>>>> -        registration.unregister();
>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>      }
>>>>>>>>>>
>>>>>>>>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>>>>>>>>  import java.util.List;
>>>>>>>>>>  import java.util.Properties;
>>>>>>>>>>
>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>>>  import org.osgi.service.cm.ConfigurationException;
>>>>>>>>>>  import org.osgi.service.cm.ManagedService;
>>>>>>>>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>>>>>>>>              reg.remove(cm);
>>>>>>>>>>              if (reg.isEmpty()) {
>>>>>>>>>>                  map.remove(key);
>>>>>>>>>> -                reg.getRegistration().unregister();
>>>>>>>>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>>>>>>>>              }
>>>>>>>>>>          }
>>>>>>>>>>      }
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>>          }
>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>> -            registration.unregister();
>>>>>>>>>> -        }
>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>>              handlerSet.destroy();
>>>>>>>>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>>          }
>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>> -            registration.unregister();
>>>>>>>>>> -        }
>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>>              handlerSet.destroy();
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>>>  import org.apache.aries.proxy.ProxyManager;
>>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker;
>>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>>>>>>>>                 bt.close();
>>>>>>>>>>          }
>>>>>>>>>>
>>>>>>>>>> -        parserServiceReg.unregister();
>>>>>>>>>> -
>>>>>>>>>> -        if (quiesceParticipantReg != null)
>>>>>>>>>> -               quiesceParticipantReg.unregister();
>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>>>>>>>>> +
>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>>>>>>>>
>>>>>>>>>>          // Orderly shutdown of containers
>>>>>>>>>>          while (!containers.isEmpty()) {
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>>>>>>>>  import org.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> 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
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Alasdair Nottingham
>>>>>>> not@apache.org
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Cheers,
>>>>>> Guillaume Nodet
>>>>>> ------------------------
>>>>>> Blog: http://gnodet.blogspot.com/
>>>>>> ------------------------
>>>>>> Open Source SOA
>>>>>> http://fusesource.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Alasdair Nottingham
>>>>> not@apache.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Cheers,
>>>> Guillaume Nodet
>>>> ------------------------
>>>> Blog: http://gnodet.blogspot.com/
>>>> ------------------------
>>>> Open Source SOA
>>>> http://fusesource.com
>>>>
>>>
>>>
>>>
>>> --
>>> Alasdair Nottingham
>>> not@apache.org
>>>
>>
>>
>>
>> --
>> 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
>



-- 
Alasdair Nottingham
not@apache.org

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Guillaume Nodet <gn...@gmail.com>.
Oops, hit send too early

On Mon, Feb 21, 2011 at 13:46, Guillaume Nodet <gn...@gmail.com> wrote:
> On Mon, Feb 21, 2011 at 13:42, Alasdair Nottingham <no...@apache.org> wrote:
>> On 21 February 2011 12:19, Guillaume Nodet <gn...@gmail.com> wrote:
>>> On Mon, Feb 21, 2011 at 12:28, Alasdair Nottingham <no...@apache.org> wrote:
>>>> So assume we released util as a 1.0 bundle, why would that prevent
>>>> blueprint 0.4
>>>> using it? I don't think I've seen anything that says you have to bump your major
>>>> version based on the dependency doing so. That seems like a crazy idea. You
>>>> should only bump your major version if you have to.
>>>
>>> Ok, so let's think about that a bit more.  I think the case is a bit
>>> different if the package is exported or not.
>>> If the package is exported, the dependent package will be imported and
>>> end up in uses constraints, so if you change the import range to be
>>> incompatible, you actually have a major incompatibility I think.  If I
>>> have a bundle that depend on both packages, my bundle would clearly
>>> become unusable with the new version, which means it's a major change
>>> on the package actually.
>>> If the package isn't exported, the change would at least require other
>>> updates in bundles, so while the packages would still be fully
>>> compatible, the bundle version should be incremented from at least a
>>> minor version imho.
>>> Here, I'm not sure that any package depending on aries-util is
>>> actually exported, but we'd have to check.
>>>
>>
>> I do not think this is how uses should be interpreted. uses is designed to solve
>> the problem whereby a package A returns, or receives types from package B and
>> you want to ensure the bundle and its clients have a consistent view
>> of A and B. It
>> is not there to ensure that bundle A and bundle B share the same copy
>> of a package
>> A when package A is strictly part of the internals. As a result the
>> scenario you describe
>> would never happen.
>

That's what I said about non exported packages.   But uses constraints
are on exported packages and one of the goal of uses constraints is to
ensure a consistent class-space.  If you change it in an incompatible
way, that is an incompatible change.  Unless we differ on the notion
of compatible.    Let's take a clear example:

Bundle bundle.a exports a package named package.a in version 1.0
Bundle bundle.b exports a package named package.b in version 1.0 which
uses package.a with a range [1,2)
Bundle bundle.c imports package.a with [1,2) and package.b with [1,2)

Now, the use case here is the following modification:
  bundle.a exports package.a in version 2.0
  bundle.b exports package.b in version 1.1 and imports bundle.a in
version [2,3)

Now I can use bundle.c anymore with the newer version of bundle.v as
the resolver won't allow such an inconsistent class-space caused by
the two incompaitble versions of bundle.a.
WHich is to me a clear indication that package.b has changed in an
incompatible way.

Am I wrong somehwere ?


>
>>
>>>> I would also say that until we have had a vote about exactly what we are doing
>>>> regarding releasing and versioning this kind of activity is a little premature.
>>>
>>> Well, I'm raising things that we need to keep in mind when we vote for
>>> the policy we'll use.   We were supposed to use a release cycle at the
>>> component level, so I'm actually trying to release blueprint without
>>> having to release everything, that's all.  If/when we move that at the
>>> bundle level, things will be even more complicated.
>>>
>>
>> I am not saying that raising the issue is premature, I am saying that creating a
>> branch is premature.
>
> So are you suggesting I release aries-util 0.4 with such a major
> incompatiblity (meaning I may break all other aries components) in
> order to be able to release blueprint 0.4 ?
>
>>
>>>> Alasdair
>>>>
>>>> On 21 February 2011 11:21, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>> Sorry for not being more clear, I was referring to the following change:
>>>>>
>>>>>> Removed:
>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>
>>>>> One class has been deleted from a package, so that's a major
>>>>> incompabible change which needs aries-util version to be bumped to 1.0
>>>>> according to semantic versioning rules.  What I'm not sure is how it
>>>>> affect other projects, for example blueprint trunk would need to
>>>>> change the aries-util dependency from [0.3,1) to [1,2) and I'm not
>>>>> sure how the blueprint version should reflect that change.
>>>>>
>>>>> I don't really want to include an update to a new major version of a
>>>>> dependency in a minor release of blueprint, so I think we should bump
>>>>> blueprint to 1.0, hence my point of creating a 0.4 branch for
>>>>> blueprint.
>>>>>
>>>>> Hope it's a bit more clear now.
>>>>>
>>>>> On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham <no...@apache.org> wrote:
>>>>>> Can you clarify what in this commit you are objecting to? There were
>>>>>> rather a large number of
>>>>>> changes not all of which are included in your email.
>>>>>>
>>>>>> Why would you create a branch for blueprint 0.4? What is the point?
>>>>>>
>>>>>> Alasdair
>>>>>>
>>>>>> On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>> I come back to this commit as this is a *major* incompatibility change.
>>>>>>> The util package major version need be bumped up.  I'm not quite sure
>>>>>>> what kind of changes that impact on downstream bundles (blueprint,
>>>>>>> jndi, jpa, etc...) but I think the cascading effect is that their
>>>>>>> major version need to be bumped too.  Can someone please have a look
>>>>>>> at that and fix the problems ?
>>>>>>>
>>>>>>> I'll create a branch for blueprint 0.4.x which can work with other
>>>>>>> components in 0.3 as that's what is implied the version range is
>>>>>>> afaik.
>>>>>>>
>>>>>>> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>> While I do not question the validity of such changes, it tends to
>>>>>>>> confirm my impression that we have components that are quite tied
>>>>>>>> together and that we'll never be able to release them independantly
>>>>>>>> (apart from bug fix release which do not matter here).
>>>>>>>> How easy would such things be if we had several trunks, one jira per
>>>>>>>> component, each jira associated to a different version in jira...
>>>>>>>> This also changes the constraints on the packages imported by a
>>>>>>>> component, so you'd have to change some package versions.  That's
>>>>>>>> kinda bad as if a user want to update one bundle, he has to actually
>>>>>>>> update a bunch of bundles.  if we're going to use a different version
>>>>>>>> for each component, we'd have to keep track of the compatibility
>>>>>>>> somewhere so that this can appear in the release notes.
>>>>>>>>
>>>>>>>> i'll stop to lobby on the release cycle versioning, but I just want to
>>>>>>>> make everyone knows where we're going.
>>>>>>>>
>>>>>>>> I wonder if we'll have to change to a more manual management of the
>>>>>>>> imported packages in the pom, disabling * packages expansions by bnd
>>>>>>>> and also disabling auto computation of version ranges to make sure
>>>>>>>> we're aware of changes
>>>>>>>>
>>>>>>>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>>>>>>>> Author: timothyjward
>>>>>>>>> Date: Fri Feb  4 16:13:32 2011
>>>>>>>>> New Revision: 1067207
>>>>>>>>>
>>>>>>>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>>>>>>>> Log:
>>>>>>>>> ARIES-567 - Add a common utility for safe unregistration
>>>>>>>>>
>>>>>>>>> Added:
>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>>>>>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>> Removed:
>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>> Modified:
>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>>>>>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>>>>>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>>>>>>>     aries/trunk/transaction/pom.xml
>>>>>>>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>>>>>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -57,6 +57,10 @@
>>>>>>>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>>>>>>>        </dependency>
>>>>>>>>>        <dependency>
>>>>>>>>> +          <groupId>org.apache.aries</groupId>
>>>>>>>>> +          <artifactId>org.apache.aries.util</artifactId>
>>>>>>>>> +      </dependency>
>>>>>>>>> +      <dependency>
>>>>>>>>>            <groupId>org.osgi</groupId>
>>>>>>>>>            <artifactId>org.osgi.core</artifactId>
>>>>>>>>>            <scope>provided</scope>
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>>>>>>>  import java.util.Dictionary;
>>>>>>>>>  import java.util.Hashtable;
>>>>>>>>>
>>>>>>>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>>
>>>>>>>>>  public class Activator implements BundleActivator {
>>>>>>>>>
>>>>>>>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>      public void stop(BundleContext context) {
>>>>>>>>> -        if (sr != null) {
>>>>>>>>> -            sr.unregister();
>>>>>>>>> -        }
>>>>>>>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>  }
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>>>>>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>  import org.osgi.framework.ServiceReference;
>>>>>>>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>      public void destroy() {
>>>>>>>>> -        if (registration != null) {
>>>>>>>>> -            registration.unregister();
>>>>>>>>> -        }
>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>>>>>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>>>>>>>          }
>>>>>>>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>              }
>>>>>>>>>          }
>>>>>>>>>          destroyComponent(component, code);
>>>>>>>>> -        registration.unregister();
>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>>>>>>>  import java.util.List;
>>>>>>>>>  import java.util.Properties;
>>>>>>>>>
>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>>  import org.osgi.service.cm.ConfigurationException;
>>>>>>>>>  import org.osgi.service.cm.ManagedService;
>>>>>>>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>>>>>>>              reg.remove(cm);
>>>>>>>>>              if (reg.isEmpty()) {
>>>>>>>>>                  map.remove(key);
>>>>>>>>> -                reg.getRegistration().unregister();
>>>>>>>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>>>>>>>              }
>>>>>>>>>          }
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>          }
>>>>>>>>> -        if (registration != null) {
>>>>>>>>> -            registration.unregister();
>>>>>>>>> -        }
>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>              handlerSet.destroy();
>>>>>>>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>          }
>>>>>>>>> -        if (registration != null) {
>>>>>>>>> -            registration.unregister();
>>>>>>>>> -        }
>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>              handlerSet.destroy();
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>>  import org.apache.aries.proxy.ProxyManager;
>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker;
>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>>>>>>>                 bt.close();
>>>>>>>>>          }
>>>>>>>>>
>>>>>>>>> -        parserServiceReg.unregister();
>>>>>>>>> -
>>>>>>>>> -        if (quiesceParticipantReg != null)
>>>>>>>>> -               quiesceParticipantReg.unregister();
>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>>>>>>>> +
>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>>>>>>>
>>>>>>>>>          // Orderly shutdown of containers
>>>>>>>>>          while (!containers.isEmpty()) {
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>>>>>>>  import org.
>>>>>>>>
>>>>>>>> --
>>>>>>>> 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
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Alasdair Nottingham
>>>>>> not@apache.org
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Cheers,
>>>>> Guillaume Nodet
>>>>> ------------------------
>>>>> Blog: http://gnodet.blogspot.com/
>>>>> ------------------------
>>>>> Open Source SOA
>>>>> http://fusesource.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Alasdair Nottingham
>>>> not@apache.org
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>> ------------------------
>>> Open Source SOA
>>> http://fusesource.com
>>>
>>
>>
>>
>> --
>> Alasdair Nottingham
>> not@apache.org
>>
>
>
>
> --
> 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

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Alasdair Nottingham <no...@apache.org>.
On 21 February 2011 12:58, Guillaume Nodet <gn...@gmail.com> wrote:
> On Mon, Feb 21, 2011 at 13:51, Alasdair Nottingham <no...@apache.org> wrote:
>> On 21 February 2011 12:46, Guillaume Nodet <gn...@gmail.com> wrote:
>>> On Mon, Feb 21, 2011 at 13:42, Alasdair Nottingham <no...@apache.org> wrote:
>>>> On 21 February 2011 12:19, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>> On Mon, Feb 21, 2011 at 12:28, Alasdair Nottingham <no...@apache.org> wrote:
>>>>>> So assume we released util as a 1.0 bundle, why would that prevent
>>>>>> blueprint 0.4
>>>>>> using it? I don't think I've seen anything that says you have to bump your major
>>>>>> version based on the dependency doing so. That seems like a crazy idea. You
>>>>>> should only bump your major version if you have to.
>>>>>
>>>>> Ok, so let's think about that a bit more.  I think the case is a bit
>>>>> different if the package is exported or not.
>>>>> If the package is exported, the dependent package will be imported and
>>>>> end up in uses constraints, so if you change the import range to be
>>>>> incompatible, you actually have a major incompatibility I think.  If I
>>>>> have a bundle that depend on both packages, my bundle would clearly
>>>>> become unusable with the new version, which means it's a major change
>>>>> on the package actually.
>>>>> If the package isn't exported, the change would at least require other
>>>>> updates in bundles, so while the packages would still be fully
>>>>> compatible, the bundle version should be incremented from at least a
>>>>> minor version imho.
>>>>> Here, I'm not sure that any package depending on aries-util is
>>>>> actually exported, but we'd have to check.
>>>>>
>>>>
>>>> I do not think this is how uses should be interpreted. uses is designed to solve
>>>> the problem whereby a package A returns, or receives types from package B and
>>>> you want to ensure the bundle and its clients have a consistent view
>>>> of A and B. It
>>>> is not there to ensure that bundle A and bundle B share the same copy
>>>> of a package
>>>> A when package A is strictly part of the internals. As a result the
>>>> scenario you describe
>>>> would never happen.
>>>
>>> That's what I said about
>>
>> I'm sorry I don't understand this sentence fragment.
>>
>>>
>>>>
>>>>>> I would also say that until we have had a vote about exactly what we are doing
>>>>>> regarding releasing and versioning this kind of activity is a little premature.
>>>>>
>>>>> Well, I'm raising things that we need to keep in mind when we vote for
>>>>> the policy we'll use.   We were supposed to use a release cycle at the
>>>>> component level, so I'm actually trying to release blueprint without
>>>>> having to release everything, that's all.  If/when we move that at the
>>>>> bundle level, things will be even more complicated.
>>>>>
>>>>
>>>> I am not saying that raising the issue is premature, I am saying that creating a
>>>> branch is premature.
>>>
>>> So are you suggesting I release aries-util 0.4 with such a major
>>> incompatiblity (meaning I may break all other aries components) in
>>> order to be able to release blueprint 0.4 ?
>>>
>>
>> Please see the comment I made in the other thread where you first brought up
>> a release of blueprint 0.4.
>
> I suppose you're referring to the discussion about the "next" version ?
> So I I follow you what you said, I want to release blueprint, but
> given there is an incompatibility, I should call it 1.0 ?
> That's certainly not my goal to release a new major version, so isn't
> my only choice here  to create a branch for 0.4 ?
>

Please read the comment I made. I asked several questions. I need an
answer prior to
being able to attempt to answer any further questions you may give me.

>
>>
>>>>
>>>>>> Alasdair
>>>>>>
>>>>>> On 21 February 2011 11:21, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>> Sorry for not being more clear, I was referring to the following change:
>>>>>>>
>>>>>>>> Removed:
>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>
>>>>>>> One class has been deleted from a package, so that's a major
>>>>>>> incompabible change which needs aries-util version to be bumped to 1.0
>>>>>>> according to semantic versioning rules.  What I'm not sure is how it
>>>>>>> affect other projects, for example blueprint trunk would need to
>>>>>>> change the aries-util dependency from [0.3,1) to [1,2) and I'm not
>>>>>>> sure how the blueprint version should reflect that change.
>>>>>>>
>>>>>>> I don't really want to include an update to a new major version of a
>>>>>>> dependency in a minor release of blueprint, so I think we should bump
>>>>>>> blueprint to 1.0, hence my point of creating a 0.4 branch for
>>>>>>> blueprint.
>>>>>>>
>>>>>>> Hope it's a bit more clear now.
>>>>>>>
>>>>>>> On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham <no...@apache.org> wrote:
>>>>>>>> Can you clarify what in this commit you are objecting to? There were
>>>>>>>> rather a large number of
>>>>>>>> changes not all of which are included in your email.
>>>>>>>>
>>>>>>>> Why would you create a branch for blueprint 0.4? What is the point?
>>>>>>>>
>>>>>>>> Alasdair
>>>>>>>>
>>>>>>>> On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>>> I come back to this commit as this is a *major* incompatibility change.
>>>>>>>>> The util package major version need be bumped up.  I'm not quite sure
>>>>>>>>> what kind of changes that impact on downstream bundles (blueprint,
>>>>>>>>> jndi, jpa, etc...) but I think the cascading effect is that their
>>>>>>>>> major version need to be bumped too.  Can someone please have a look
>>>>>>>>> at that and fix the problems ?
>>>>>>>>>
>>>>>>>>> I'll create a branch for blueprint 0.4.x which can work with other
>>>>>>>>> components in 0.3 as that's what is implied the version range is
>>>>>>>>> afaik.
>>>>>>>>>
>>>>>>>>> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>>>> While I do not question the validity of such changes, it tends to
>>>>>>>>>> confirm my impression that we have components that are quite tied
>>>>>>>>>> together and that we'll never be able to release them independantly
>>>>>>>>>> (apart from bug fix release which do not matter here).
>>>>>>>>>> How easy would such things be if we had several trunks, one jira per
>>>>>>>>>> component, each jira associated to a different version in jira...
>>>>>>>>>> This also changes the constraints on the packages imported by a
>>>>>>>>>> component, so you'd have to change some package versions.  That's
>>>>>>>>>> kinda bad as if a user want to update one bundle, he has to actually
>>>>>>>>>> update a bunch of bundles.  if we're going to use a different version
>>>>>>>>>> for each component, we'd have to keep track of the compatibility
>>>>>>>>>> somewhere so that this can appear in the release notes.
>>>>>>>>>>
>>>>>>>>>> i'll stop to lobby on the release cycle versioning, but I just want to
>>>>>>>>>> make everyone knows where we're going.
>>>>>>>>>>
>>>>>>>>>> I wonder if we'll have to change to a more manual management of the
>>>>>>>>>> imported packages in the pom, disabling * packages expansions by bnd
>>>>>>>>>> and also disabling auto computation of version ranges to make sure
>>>>>>>>>> we're aware of changes
>>>>>>>>>>
>>>>>>>>>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>>>>>>>>>> Author: timothyjward
>>>>>>>>>>> Date: Fri Feb  4 16:13:32 2011
>>>>>>>>>>> New Revision: 1067207
>>>>>>>>>>>
>>>>>>>>>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>>>>>>>>>> Log:
>>>>>>>>>>> ARIES-567 - Add a common utility for safe unregistration
>>>>>>>>>>>
>>>>>>>>>>> Added:
>>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>>>>>>>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>>>> Removed:
>>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>>>> Modified:
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>>>>>>>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>>>>>>>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>>>>>>>>>     aries/trunk/transaction/pom.xml
>>>>>>>>>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>>>>>>>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -57,6 +57,10 @@
>>>>>>>>>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>>>>>>>>>        </dependency>
>>>>>>>>>>>        <dependency>
>>>>>>>>>>> +          <groupId>org.apache.aries</groupId>
>>>>>>>>>>> +          <artifactId>org.apache.aries.util</artifactId>
>>>>>>>>>>> +      </dependency>
>>>>>>>>>>> +      <dependency>
>>>>>>>>>>>            <groupId>org.osgi</groupId>
>>>>>>>>>>>            <artifactId>org.osgi.core</artifactId>
>>>>>>>>>>>            <scope>provided</scope>
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>>>>>>>>>  import java.util.Dictionary;
>>>>>>>>>>>  import java.util.Hashtable;
>>>>>>>>>>>
>>>>>>>>>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>>>>
>>>>>>>>>>>  public class Activator implements BundleActivator {
>>>>>>>>>>>
>>>>>>>>>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>>>>>>>>>      }
>>>>>>>>>>>
>>>>>>>>>>>      public void stop(BundleContext context) {
>>>>>>>>>>> -        if (sr != null) {
>>>>>>>>>>> -            sr.unregister();
>>>>>>>>>>> -        }
>>>>>>>>>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>>>>>>>>>      }
>>>>>>>>>>>
>>>>>>>>>>>  }
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>>>>>>>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>>  import org.osgi.framework.ServiceReference;
>>>>>>>>>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>>>      }
>>>>>>>>>>>
>>>>>>>>>>>      public void destroy() {
>>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>>> -            registration.unregister();
>>>>>>>>>>> -        }
>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>>>>>>>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>>>>>>>>>          }
>>>>>>>>>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>>>              }
>>>>>>>>>>>          }
>>>>>>>>>>>          destroyComponent(component, code);
>>>>>>>>>>> -        registration.unregister();
>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>>      }
>>>>>>>>>>>
>>>>>>>>>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>>>>>>>>>  import java.util.List;
>>>>>>>>>>>  import java.util.Properties;
>>>>>>>>>>>
>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>>>>  import org.osgi.service.cm.ConfigurationException;
>>>>>>>>>>>  import org.osgi.service.cm.ManagedService;
>>>>>>>>>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>>>>>>>>>              reg.remove(cm);
>>>>>>>>>>>              if (reg.isEmpty()) {
>>>>>>>>>>>                  map.remove(key);
>>>>>>>>>>> -                reg.getRegistration().unregister();
>>>>>>>>>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>>>>>>>>>              }
>>>>>>>>>>>          }
>>>>>>>>>>>      }
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>>>          }
>>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>>> -            registration.unregister();
>>>>>>>>>>> -        }
>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>>>              handlerSet.destroy();
>>>>>>>>>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>>>          }
>>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>>> -            registration.unregister();
>>>>>>>>>>> -        }
>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>>>              handlerSet.destroy();
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>>>>  import org.apache.aries.proxy.ProxyManager;
>>>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker;
>>>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>>>>>>>>>                 bt.close();
>>>>>>>>>>>          }
>>>>>>>>>>>
>>>>>>>>>>> -        parserServiceReg.unregister();
>>>>>>>>>>> -
>>>>>>>>>>> -        if (quiesceParticipantReg != null)
>>>>>>>>>>> -               quiesceParticipantReg.unregister();
>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>>>>>>>>>> +
>>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>>>>>>>>>
>>>>>>>>>>>          // Orderly shutdown of containers
>>>>>>>>>>>          while (!containers.isEmpty()) {
>>>>>>>>>>>
>>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>>> ==============================================================================
>>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>>>>>>>>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>>>>>>>>>  import org.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> 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
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Alasdair Nottingham
>>>>>>>> not@apache.org
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Cheers,
>>>>>>> Guillaume Nodet
>>>>>>> ------------------------
>>>>>>> Blog: http://gnodet.blogspot.com/
>>>>>>> ------------------------
>>>>>>> Open Source SOA
>>>>>>> http://fusesource.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Alasdair Nottingham
>>>>>> not@apache.org
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Cheers,
>>>>> Guillaume Nodet
>>>>> ------------------------
>>>>> Blog: http://gnodet.blogspot.com/
>>>>> ------------------------
>>>>> Open Source SOA
>>>>> http://fusesource.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Alasdair Nottingham
>>>> not@apache.org
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>> ------------------------
>>> Open Source SOA
>>> http://fusesource.com
>>>
>>
>>
>>
>> --
>> Alasdair Nottingham
>> not@apache.org
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>



-- 
Alasdair Nottingham
not@apache.org

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Guillaume Nodet <gn...@gmail.com>.
On Mon, Feb 21, 2011 at 13:51, Alasdair Nottingham <no...@apache.org> wrote:
> On 21 February 2011 12:46, Guillaume Nodet <gn...@gmail.com> wrote:
>> On Mon, Feb 21, 2011 at 13:42, Alasdair Nottingham <no...@apache.org> wrote:
>>> On 21 February 2011 12:19, Guillaume Nodet <gn...@gmail.com> wrote:
>>>> On Mon, Feb 21, 2011 at 12:28, Alasdair Nottingham <no...@apache.org> wrote:
>>>>> So assume we released util as a 1.0 bundle, why would that prevent
>>>>> blueprint 0.4
>>>>> using it? I don't think I've seen anything that says you have to bump your major
>>>>> version based on the dependency doing so. That seems like a crazy idea. You
>>>>> should only bump your major version if you have to.
>>>>
>>>> Ok, so let's think about that a bit more.  I think the case is a bit
>>>> different if the package is exported or not.
>>>> If the package is exported, the dependent package will be imported and
>>>> end up in uses constraints, so if you change the import range to be
>>>> incompatible, you actually have a major incompatibility I think.  If I
>>>> have a bundle that depend on both packages, my bundle would clearly
>>>> become unusable with the new version, which means it's a major change
>>>> on the package actually.
>>>> If the package isn't exported, the change would at least require other
>>>> updates in bundles, so while the packages would still be fully
>>>> compatible, the bundle version should be incremented from at least a
>>>> minor version imho.
>>>> Here, I'm not sure that any package depending on aries-util is
>>>> actually exported, but we'd have to check.
>>>>
>>>
>>> I do not think this is how uses should be interpreted. uses is designed to solve
>>> the problem whereby a package A returns, or receives types from package B and
>>> you want to ensure the bundle and its clients have a consistent view
>>> of A and B. It
>>> is not there to ensure that bundle A and bundle B share the same copy
>>> of a package
>>> A when package A is strictly part of the internals. As a result the
>>> scenario you describe
>>> would never happen.
>>
>> That's what I said about
>
> I'm sorry I don't understand this sentence fragment.
>
>>
>>>
>>>>> I would also say that until we have had a vote about exactly what we are doing
>>>>> regarding releasing and versioning this kind of activity is a little premature.
>>>>
>>>> Well, I'm raising things that we need to keep in mind when we vote for
>>>> the policy we'll use.   We were supposed to use a release cycle at the
>>>> component level, so I'm actually trying to release blueprint without
>>>> having to release everything, that's all.  If/when we move that at the
>>>> bundle level, things will be even more complicated.
>>>>
>>>
>>> I am not saying that raising the issue is premature, I am saying that creating a
>>> branch is premature.
>>
>> So are you suggesting I release aries-util 0.4 with such a major
>> incompatiblity (meaning I may break all other aries components) in
>> order to be able to release blueprint 0.4 ?
>>
>
> Please see the comment I made in the other thread where you first brought up
> a release of blueprint 0.4.

I suppose you're referring to the discussion about the "next" version ?
So I I follow you what you said, I want to release blueprint, but
given there is an incompatibility, I should call it 1.0 ?
That's certainly not my goal to release a new major version, so isn't
my only choice here  to create a branch for 0.4 ?


>
>>>
>>>>> Alasdair
>>>>>
>>>>> On 21 February 2011 11:21, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>> Sorry for not being more clear, I was referring to the following change:
>>>>>>
>>>>>>> Removed:
>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>
>>>>>> One class has been deleted from a package, so that's a major
>>>>>> incompabible change which needs aries-util version to be bumped to 1.0
>>>>>> according to semantic versioning rules.  What I'm not sure is how it
>>>>>> affect other projects, for example blueprint trunk would need to
>>>>>> change the aries-util dependency from [0.3,1) to [1,2) and I'm not
>>>>>> sure how the blueprint version should reflect that change.
>>>>>>
>>>>>> I don't really want to include an update to a new major version of a
>>>>>> dependency in a minor release of blueprint, so I think we should bump
>>>>>> blueprint to 1.0, hence my point of creating a 0.4 branch for
>>>>>> blueprint.
>>>>>>
>>>>>> Hope it's a bit more clear now.
>>>>>>
>>>>>> On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham <no...@apache.org> wrote:
>>>>>>> Can you clarify what in this commit you are objecting to? There were
>>>>>>> rather a large number of
>>>>>>> changes not all of which are included in your email.
>>>>>>>
>>>>>>> Why would you create a branch for blueprint 0.4? What is the point?
>>>>>>>
>>>>>>> Alasdair
>>>>>>>
>>>>>>> On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>> I come back to this commit as this is a *major* incompatibility change.
>>>>>>>> The util package major version need be bumped up.  I'm not quite sure
>>>>>>>> what kind of changes that impact on downstream bundles (blueprint,
>>>>>>>> jndi, jpa, etc...) but I think the cascading effect is that their
>>>>>>>> major version need to be bumped too.  Can someone please have a look
>>>>>>>> at that and fix the problems ?
>>>>>>>>
>>>>>>>> I'll create a branch for blueprint 0.4.x which can work with other
>>>>>>>> components in 0.3 as that's what is implied the version range is
>>>>>>>> afaik.
>>>>>>>>
>>>>>>>> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>>> While I do not question the validity of such changes, it tends to
>>>>>>>>> confirm my impression that we have components that are quite tied
>>>>>>>>> together and that we'll never be able to release them independantly
>>>>>>>>> (apart from bug fix release which do not matter here).
>>>>>>>>> How easy would such things be if we had several trunks, one jira per
>>>>>>>>> component, each jira associated to a different version in jira...
>>>>>>>>> This also changes the constraints on the packages imported by a
>>>>>>>>> component, so you'd have to change some package versions.  That's
>>>>>>>>> kinda bad as if a user want to update one bundle, he has to actually
>>>>>>>>> update a bunch of bundles.  if we're going to use a different version
>>>>>>>>> for each component, we'd have to keep track of the compatibility
>>>>>>>>> somewhere so that this can appear in the release notes.
>>>>>>>>>
>>>>>>>>> i'll stop to lobby on the release cycle versioning, but I just want to
>>>>>>>>> make everyone knows where we're going.
>>>>>>>>>
>>>>>>>>> I wonder if we'll have to change to a more manual management of the
>>>>>>>>> imported packages in the pom, disabling * packages expansions by bnd
>>>>>>>>> and also disabling auto computation of version ranges to make sure
>>>>>>>>> we're aware of changes
>>>>>>>>>
>>>>>>>>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>>>>>>>>> Author: timothyjward
>>>>>>>>>> Date: Fri Feb  4 16:13:32 2011
>>>>>>>>>> New Revision: 1067207
>>>>>>>>>>
>>>>>>>>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>>>>>>>>> Log:
>>>>>>>>>> ARIES-567 - Add a common utility for safe unregistration
>>>>>>>>>>
>>>>>>>>>> Added:
>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>>>>>>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>>> Removed:
>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>>> Modified:
>>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>>>>>>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>>>>>>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>>>>>>>>     aries/trunk/transaction/pom.xml
>>>>>>>>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>>>>>>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -57,6 +57,10 @@
>>>>>>>>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>>>>>>>>        </dependency>
>>>>>>>>>>        <dependency>
>>>>>>>>>> +          <groupId>org.apache.aries</groupId>
>>>>>>>>>> +          <artifactId>org.apache.aries.util</artifactId>
>>>>>>>>>> +      </dependency>
>>>>>>>>>> +      <dependency>
>>>>>>>>>>            <groupId>org.osgi</groupId>
>>>>>>>>>>            <artifactId>org.osgi.core</artifactId>
>>>>>>>>>>            <scope>provided</scope>
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>>>>>>>>  import java.util.Dictionary;
>>>>>>>>>>  import java.util.Hashtable;
>>>>>>>>>>
>>>>>>>>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>>>
>>>>>>>>>>  public class Activator implements BundleActivator {
>>>>>>>>>>
>>>>>>>>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>>>>>>>>      }
>>>>>>>>>>
>>>>>>>>>>      public void stop(BundleContext context) {
>>>>>>>>>> -        if (sr != null) {
>>>>>>>>>> -            sr.unregister();
>>>>>>>>>> -        }
>>>>>>>>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>>>>>>>>      }
>>>>>>>>>>
>>>>>>>>>>  }
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>>>>>>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>>  import org.osgi.framework.ServiceReference;
>>>>>>>>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>>      }
>>>>>>>>>>
>>>>>>>>>>      public void destroy() {
>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>> -            registration.unregister();
>>>>>>>>>> -        }
>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>>>>>>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>>>>>>>>          }
>>>>>>>>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>>              }
>>>>>>>>>>          }
>>>>>>>>>>          destroyComponent(component, code);
>>>>>>>>>> -        registration.unregister();
>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>      }
>>>>>>>>>>
>>>>>>>>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>>>>>>>>  import java.util.List;
>>>>>>>>>>  import java.util.Properties;
>>>>>>>>>>
>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>>>  import org.osgi.service.cm.ConfigurationException;
>>>>>>>>>>  import org.osgi.service.cm.ManagedService;
>>>>>>>>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>>>>>>>>              reg.remove(cm);
>>>>>>>>>>              if (reg.isEmpty()) {
>>>>>>>>>>                  map.remove(key);
>>>>>>>>>> -                reg.getRegistration().unregister();
>>>>>>>>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>>>>>>>>              }
>>>>>>>>>>          }
>>>>>>>>>>      }
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>>          }
>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>> -            registration.unregister();
>>>>>>>>>> -        }
>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>>              handlerSet.destroy();
>>>>>>>>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>>          }
>>>>>>>>>> -        if (registration != null) {
>>>>>>>>>> -            registration.unregister();
>>>>>>>>>> -        }
>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>>              handlerSet.destroy();
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>>>  import org.apache.aries.proxy.ProxyManager;
>>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker;
>>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>>>>>>>>                 bt.close();
>>>>>>>>>>          }
>>>>>>>>>>
>>>>>>>>>> -        parserServiceReg.unregister();
>>>>>>>>>> -
>>>>>>>>>> -        if (quiesceParticipantReg != null)
>>>>>>>>>> -               quiesceParticipantReg.unregister();
>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>>>>>>>>> +
>>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>>>>>>>>
>>>>>>>>>>          // Orderly shutdown of containers
>>>>>>>>>>          while (!containers.isEmpty()) {
>>>>>>>>>>
>>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>>> ==============================================================================
>>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>>>>>>>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>>>>>>>>  import org.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> 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
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Alasdair Nottingham
>>>>>>> not@apache.org
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Cheers,
>>>>>> Guillaume Nodet
>>>>>> ------------------------
>>>>>> Blog: http://gnodet.blogspot.com/
>>>>>> ------------------------
>>>>>> Open Source SOA
>>>>>> http://fusesource.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Alasdair Nottingham
>>>>> not@apache.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Cheers,
>>>> Guillaume Nodet
>>>> ------------------------
>>>> Blog: http://gnodet.blogspot.com/
>>>> ------------------------
>>>> Open Source SOA
>>>> http://fusesource.com
>>>>
>>>
>>>
>>>
>>> --
>>> Alasdair Nottingham
>>> not@apache.org
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>
>
>
> --
> Alasdair Nottingham
> not@apache.org
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Alasdair Nottingham <no...@apache.org>.
On 21 February 2011 12:46, Guillaume Nodet <gn...@gmail.com> wrote:
> On Mon, Feb 21, 2011 at 13:42, Alasdair Nottingham <no...@apache.org> wrote:
>> On 21 February 2011 12:19, Guillaume Nodet <gn...@gmail.com> wrote:
>>> On Mon, Feb 21, 2011 at 12:28, Alasdair Nottingham <no...@apache.org> wrote:
>>>> So assume we released util as a 1.0 bundle, why would that prevent
>>>> blueprint 0.4
>>>> using it? I don't think I've seen anything that says you have to bump your major
>>>> version based on the dependency doing so. That seems like a crazy idea. You
>>>> should only bump your major version if you have to.
>>>
>>> Ok, so let's think about that a bit more.  I think the case is a bit
>>> different if the package is exported or not.
>>> If the package is exported, the dependent package will be imported and
>>> end up in uses constraints, so if you change the import range to be
>>> incompatible, you actually have a major incompatibility I think.  If I
>>> have a bundle that depend on both packages, my bundle would clearly
>>> become unusable with the new version, which means it's a major change
>>> on the package actually.
>>> If the package isn't exported, the change would at least require other
>>> updates in bundles, so while the packages would still be fully
>>> compatible, the bundle version should be incremented from at least a
>>> minor version imho.
>>> Here, I'm not sure that any package depending on aries-util is
>>> actually exported, but we'd have to check.
>>>
>>
>> I do not think this is how uses should be interpreted. uses is designed to solve
>> the problem whereby a package A returns, or receives types from package B and
>> you want to ensure the bundle and its clients have a consistent view
>> of A and B. It
>> is not there to ensure that bundle A and bundle B share the same copy
>> of a package
>> A when package A is strictly part of the internals. As a result the
>> scenario you describe
>> would never happen.
>
> That's what I said about

I'm sorry I don't understand this sentence fragment.

>
>>
>>>> I would also say that until we have had a vote about exactly what we are doing
>>>> regarding releasing and versioning this kind of activity is a little premature.
>>>
>>> Well, I'm raising things that we need to keep in mind when we vote for
>>> the policy we'll use.   We were supposed to use a release cycle at the
>>> component level, so I'm actually trying to release blueprint without
>>> having to release everything, that's all.  If/when we move that at the
>>> bundle level, things will be even more complicated.
>>>
>>
>> I am not saying that raising the issue is premature, I am saying that creating a
>> branch is premature.
>
> So are you suggesting I release aries-util 0.4 with such a major
> incompatiblity (meaning I may break all other aries components) in
> order to be able to release blueprint 0.4 ?
>

Please see the comment I made in the other thread where you first brought up
a release of blueprint 0.4.

>>
>>>> Alasdair
>>>>
>>>> On 21 February 2011 11:21, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>> Sorry for not being more clear, I was referring to the following change:
>>>>>
>>>>>> Removed:
>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>
>>>>> One class has been deleted from a package, so that's a major
>>>>> incompabible change which needs aries-util version to be bumped to 1.0
>>>>> according to semantic versioning rules.  What I'm not sure is how it
>>>>> affect other projects, for example blueprint trunk would need to
>>>>> change the aries-util dependency from [0.3,1) to [1,2) and I'm not
>>>>> sure how the blueprint version should reflect that change.
>>>>>
>>>>> I don't really want to include an update to a new major version of a
>>>>> dependency in a minor release of blueprint, so I think we should bump
>>>>> blueprint to 1.0, hence my point of creating a 0.4 branch for
>>>>> blueprint.
>>>>>
>>>>> Hope it's a bit more clear now.
>>>>>
>>>>> On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham <no...@apache.org> wrote:
>>>>>> Can you clarify what in this commit you are objecting to? There were
>>>>>> rather a large number of
>>>>>> changes not all of which are included in your email.
>>>>>>
>>>>>> Why would you create a branch for blueprint 0.4? What is the point?
>>>>>>
>>>>>> Alasdair
>>>>>>
>>>>>> On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>> I come back to this commit as this is a *major* incompatibility change.
>>>>>>> The util package major version need be bumped up.  I'm not quite sure
>>>>>>> what kind of changes that impact on downstream bundles (blueprint,
>>>>>>> jndi, jpa, etc...) but I think the cascading effect is that their
>>>>>>> major version need to be bumped too.  Can someone please have a look
>>>>>>> at that and fix the problems ?
>>>>>>>
>>>>>>> I'll create a branch for blueprint 0.4.x which can work with other
>>>>>>> components in 0.3 as that's what is implied the version range is
>>>>>>> afaik.
>>>>>>>
>>>>>>> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>>> While I do not question the validity of such changes, it tends to
>>>>>>>> confirm my impression that we have components that are quite tied
>>>>>>>> together and that we'll never be able to release them independantly
>>>>>>>> (apart from bug fix release which do not matter here).
>>>>>>>> How easy would such things be if we had several trunks, one jira per
>>>>>>>> component, each jira associated to a different version in jira...
>>>>>>>> This also changes the constraints on the packages imported by a
>>>>>>>> component, so you'd have to change some package versions.  That's
>>>>>>>> kinda bad as if a user want to update one bundle, he has to actually
>>>>>>>> update a bunch of bundles.  if we're going to use a different version
>>>>>>>> for each component, we'd have to keep track of the compatibility
>>>>>>>> somewhere so that this can appear in the release notes.
>>>>>>>>
>>>>>>>> i'll stop to lobby on the release cycle versioning, but I just want to
>>>>>>>> make everyone knows where we're going.
>>>>>>>>
>>>>>>>> I wonder if we'll have to change to a more manual management of the
>>>>>>>> imported packages in the pom, disabling * packages expansions by bnd
>>>>>>>> and also disabling auto computation of version ranges to make sure
>>>>>>>> we're aware of changes
>>>>>>>>
>>>>>>>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>>>>>>>> Author: timothyjward
>>>>>>>>> Date: Fri Feb  4 16:13:32 2011
>>>>>>>>> New Revision: 1067207
>>>>>>>>>
>>>>>>>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>>>>>>>> Log:
>>>>>>>>> ARIES-567 - Add a common utility for safe unregistration
>>>>>>>>>
>>>>>>>>> Added:
>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>>>>>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>> Removed:
>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>>> Modified:
>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>>>>>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>>>>>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>>>>>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>>>>>>>     aries/trunk/transaction/pom.xml
>>>>>>>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>>>>>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>>>>>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -57,6 +57,10 @@
>>>>>>>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>>>>>>>        </dependency>
>>>>>>>>>        <dependency>
>>>>>>>>> +          <groupId>org.apache.aries</groupId>
>>>>>>>>> +          <artifactId>org.apache.aries.util</artifactId>
>>>>>>>>> +      </dependency>
>>>>>>>>> +      <dependency>
>>>>>>>>>            <groupId>org.osgi</groupId>
>>>>>>>>>            <artifactId>org.osgi.core</artifactId>
>>>>>>>>>            <scope>provided</scope>
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>>>>>>>  import java.util.Dictionary;
>>>>>>>>>  import java.util.Hashtable;
>>>>>>>>>
>>>>>>>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>>
>>>>>>>>>  public class Activator implements BundleActivator {
>>>>>>>>>
>>>>>>>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>      public void stop(BundleContext context) {
>>>>>>>>> -        if (sr != null) {
>>>>>>>>> -            sr.unregister();
>>>>>>>>> -        }
>>>>>>>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>  }
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>>>>>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>>  import org.osgi.framework.ServiceReference;
>>>>>>>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>      public void destroy() {
>>>>>>>>> -        if (registration != null) {
>>>>>>>>> -            registration.unregister();
>>>>>>>>> -        }
>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>>>>>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>>>>>>>          }
>>>>>>>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>>>>>>>              }
>>>>>>>>>          }
>>>>>>>>>          destroyComponent(component, code);
>>>>>>>>> -        registration.unregister();
>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>>>>>>>  import java.util.List;
>>>>>>>>>  import java.util.Properties;
>>>>>>>>>
>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>>  import org.osgi.service.cm.ConfigurationException;
>>>>>>>>>  import org.osgi.service.cm.ManagedService;
>>>>>>>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>>>>>>>              reg.remove(cm);
>>>>>>>>>              if (reg.isEmpty()) {
>>>>>>>>>                  map.remove(key);
>>>>>>>>> -                reg.getRegistration().unregister();
>>>>>>>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>>>>>>>              }
>>>>>>>>>          }
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>          }
>>>>>>>>> -        if (registration != null) {
>>>>>>>>> -            registration.unregister();
>>>>>>>>> -        }
>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>              handlerSet.destroy();
>>>>>>>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>>          }
>>>>>>>>> -        if (registration != null) {
>>>>>>>>> -            registration.unregister();
>>>>>>>>> -        }
>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>>          if (handlerSet != null) {
>>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>>              handlerSet.destroy();
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>>  import org.apache.aries.proxy.ProxyManager;
>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker;
>>>>>>>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>>>>>>>                 bt.close();
>>>>>>>>>          }
>>>>>>>>>
>>>>>>>>> -        parserServiceReg.unregister();
>>>>>>>>> -
>>>>>>>>> -        if (quiesceParticipantReg != null)
>>>>>>>>> -               quiesceParticipantReg.unregister();
>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>>>>>>>> +
>>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>>>>>>>
>>>>>>>>>          // Orderly shutdown of containers
>>>>>>>>>          while (!containers.isEmpty()) {
>>>>>>>>>
>>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>>> ==============================================================================
>>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>>>>>>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>>>>>>>  import org.
>>>>>>>>
>>>>>>>> --
>>>>>>>> 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
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Alasdair Nottingham
>>>>>> not@apache.org
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Cheers,
>>>>> Guillaume Nodet
>>>>> ------------------------
>>>>> Blog: http://gnodet.blogspot.com/
>>>>> ------------------------
>>>>> Open Source SOA
>>>>> http://fusesource.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Alasdair Nottingham
>>>> not@apache.org
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>> ------------------------
>>> Open Source SOA
>>> http://fusesource.com
>>>
>>
>>
>>
>> --
>> Alasdair Nottingham
>> not@apache.org
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>



-- 
Alasdair Nottingham
not@apache.org

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Guillaume Nodet <gn...@gmail.com>.
On Mon, Feb 21, 2011 at 13:42, Alasdair Nottingham <no...@apache.org> wrote:
> On 21 February 2011 12:19, Guillaume Nodet <gn...@gmail.com> wrote:
>> On Mon, Feb 21, 2011 at 12:28, Alasdair Nottingham <no...@apache.org> wrote:
>>> So assume we released util as a 1.0 bundle, why would that prevent
>>> blueprint 0.4
>>> using it? I don't think I've seen anything that says you have to bump your major
>>> version based on the dependency doing so. That seems like a crazy idea. You
>>> should only bump your major version if you have to.
>>
>> Ok, so let's think about that a bit more.  I think the case is a bit
>> different if the package is exported or not.
>> If the package is exported, the dependent package will be imported and
>> end up in uses constraints, so if you change the import range to be
>> incompatible, you actually have a major incompatibility I think.  If I
>> have a bundle that depend on both packages, my bundle would clearly
>> become unusable with the new version, which means it's a major change
>> on the package actually.
>> If the package isn't exported, the change would at least require other
>> updates in bundles, so while the packages would still be fully
>> compatible, the bundle version should be incremented from at least a
>> minor version imho.
>> Here, I'm not sure that any package depending on aries-util is
>> actually exported, but we'd have to check.
>>
>
> I do not think this is how uses should be interpreted. uses is designed to solve
> the problem whereby a package A returns, or receives types from package B and
> you want to ensure the bundle and its clients have a consistent view
> of A and B. It
> is not there to ensure that bundle A and bundle B share the same copy
> of a package
> A when package A is strictly part of the internals. As a result the
> scenario you describe
> would never happen.

That's what I said about

>
>>> I would also say that until we have had a vote about exactly what we are doing
>>> regarding releasing and versioning this kind of activity is a little premature.
>>
>> Well, I'm raising things that we need to keep in mind when we vote for
>> the policy we'll use.   We were supposed to use a release cycle at the
>> component level, so I'm actually trying to release blueprint without
>> having to release everything, that's all.  If/when we move that at the
>> bundle level, things will be even more complicated.
>>
>
> I am not saying that raising the issue is premature, I am saying that creating a
> branch is premature.

So are you suggesting I release aries-util 0.4 with such a major
incompatiblity (meaning I may break all other aries components) in
order to be able to release blueprint 0.4 ?

>
>>> Alasdair
>>>
>>> On 21 February 2011 11:21, Guillaume Nodet <gn...@gmail.com> wrote:
>>>> Sorry for not being more clear, I was referring to the following change:
>>>>
>>>>> Removed:
>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>
>>>> One class has been deleted from a package, so that's a major
>>>> incompabible change which needs aries-util version to be bumped to 1.0
>>>> according to semantic versioning rules.  What I'm not sure is how it
>>>> affect other projects, for example blueprint trunk would need to
>>>> change the aries-util dependency from [0.3,1) to [1,2) and I'm not
>>>> sure how the blueprint version should reflect that change.
>>>>
>>>> I don't really want to include an update to a new major version of a
>>>> dependency in a minor release of blueprint, so I think we should bump
>>>> blueprint to 1.0, hence my point of creating a 0.4 branch for
>>>> blueprint.
>>>>
>>>> Hope it's a bit more clear now.
>>>>
>>>> On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham <no...@apache.org> wrote:
>>>>> Can you clarify what in this commit you are objecting to? There were
>>>>> rather a large number of
>>>>> changes not all of which are included in your email.
>>>>>
>>>>> Why would you create a branch for blueprint 0.4? What is the point?
>>>>>
>>>>> Alasdair
>>>>>
>>>>> On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>> I come back to this commit as this is a *major* incompatibility change.
>>>>>> The util package major version need be bumped up.  I'm not quite sure
>>>>>> what kind of changes that impact on downstream bundles (blueprint,
>>>>>> jndi, jpa, etc...) but I think the cascading effect is that their
>>>>>> major version need to be bumped too.  Can someone please have a look
>>>>>> at that and fix the problems ?
>>>>>>
>>>>>> I'll create a branch for blueprint 0.4.x which can work with other
>>>>>> components in 0.3 as that's what is implied the version range is
>>>>>> afaik.
>>>>>>
>>>>>> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>>> While I do not question the validity of such changes, it tends to
>>>>>>> confirm my impression that we have components that are quite tied
>>>>>>> together and that we'll never be able to release them independantly
>>>>>>> (apart from bug fix release which do not matter here).
>>>>>>> How easy would such things be if we had several trunks, one jira per
>>>>>>> component, each jira associated to a different version in jira...
>>>>>>> This also changes the constraints on the packages imported by a
>>>>>>> component, so you'd have to change some package versions.  That's
>>>>>>> kinda bad as if a user want to update one bundle, he has to actually
>>>>>>> update a bunch of bundles.  if we're going to use a different version
>>>>>>> for each component, we'd have to keep track of the compatibility
>>>>>>> somewhere so that this can appear in the release notes.
>>>>>>>
>>>>>>> i'll stop to lobby on the release cycle versioning, but I just want to
>>>>>>> make everyone knows where we're going.
>>>>>>>
>>>>>>> I wonder if we'll have to change to a more manual management of the
>>>>>>> imported packages in the pom, disabling * packages expansions by bnd
>>>>>>> and also disabling auto computation of version ranges to make sure
>>>>>>> we're aware of changes
>>>>>>>
>>>>>>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>>>>>>> Author: timothyjward
>>>>>>>> Date: Fri Feb  4 16:13:32 2011
>>>>>>>> New Revision: 1067207
>>>>>>>>
>>>>>>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>>>>>>> Log:
>>>>>>>> ARIES-567 - Add a common utility for safe unregistration
>>>>>>>>
>>>>>>>> Added:
>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>>>>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>> Removed:
>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>>> Modified:
>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>>>>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>>>>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>>>>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>>>>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>>>>>>     aries/trunk/transaction/pom.xml
>>>>>>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>>>>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>>>>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>>>>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>>>>>>
>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>> ==============================================================================
>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>>>>>>> @@ -57,6 +57,10 @@
>>>>>>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>>>>>>        </dependency>
>>>>>>>>        <dependency>
>>>>>>>> +          <groupId>org.apache.aries</groupId>
>>>>>>>> +          <artifactId>org.apache.aries.util</artifactId>
>>>>>>>> +      </dependency>
>>>>>>>> +      <dependency>
>>>>>>>>            <groupId>org.osgi</groupId>
>>>>>>>>            <artifactId>org.osgi.core</artifactId>
>>>>>>>>            <scope>provided</scope>
>>>>>>>>
>>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>> ==============================================================================
>>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>>>>>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>>>>>>  import java.util.Dictionary;
>>>>>>>>  import java.util.Hashtable;
>>>>>>>>
>>>>>>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>>
>>>>>>>>  public class Activator implements BundleActivator {
>>>>>>>>
>>>>>>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>>>>>>      }
>>>>>>>>
>>>>>>>>      public void stop(BundleContext context) {
>>>>>>>> -        if (sr != null) {
>>>>>>>> -            sr.unregister();
>>>>>>>> -        }
>>>>>>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>>>>>>      }
>>>>>>>>
>>>>>>>>  }
>>>>>>>>
>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>> ==============================================================================
>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>>>>>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>>>>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>>  import org.osgi.framework.ServiceReference;
>>>>>>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>>>>>>      }
>>>>>>>>
>>>>>>>>      public void destroy() {
>>>>>>>> -        if (registration != null) {
>>>>>>>> -            registration.unregister();
>>>>>>>> -        }
>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>>>>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>>>>>>          }
>>>>>>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>>>>>>              }
>>>>>>>>          }
>>>>>>>>          destroyComponent(component, code);
>>>>>>>> -        registration.unregister();
>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>      }
>>>>>>>>
>>>>>>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>>>>>>
>>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>> ==============================================================================
>>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>>>>>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>>>>>>  import java.util.List;
>>>>>>>>  import java.util.Properties;
>>>>>>>>
>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>>  import org.osgi.service.cm.ConfigurationException;
>>>>>>>>  import org.osgi.service.cm.ManagedService;
>>>>>>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>>>>>>              reg.remove(cm);
>>>>>>>>              if (reg.isEmpty()) {
>>>>>>>>                  map.remove(key);
>>>>>>>> -                reg.getRegistration().unregister();
>>>>>>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>>>>>>              }
>>>>>>>>          }
>>>>>>>>      }
>>>>>>>>
>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>> ==============================================================================
>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>>>>>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>          }
>>>>>>>> -        if (registration != null) {
>>>>>>>> -            registration.unregister();
>>>>>>>> -        }
>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>          if (handlerSet != null) {
>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>              handlerSet.destroy();
>>>>>>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>>>>>>          if (timeoutFuture != null) {
>>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>>          }
>>>>>>>> -        if (registration != null) {
>>>>>>>> -            registration.unregister();
>>>>>>>> -        }
>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>>          if (handlerSet != null) {
>>>>>>>>              handlerSet.removeListener(this);
>>>>>>>>              handlerSet.destroy();
>>>>>>>>
>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>> ==============================================================================
>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>>>>>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>>  import org.apache.aries.proxy.ProxyManager;
>>>>>>>> -import org.apache.aries.util.SingleServiceTracker;
>>>>>>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>>>>>>                 bt.close();
>>>>>>>>          }
>>>>>>>>
>>>>>>>> -        parserServiceReg.unregister();
>>>>>>>> -
>>>>>>>> -        if (quiesceParticipantReg != null)
>>>>>>>> -               quiesceParticipantReg.unregister();
>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>>>>>>> +
>>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>>>>>>
>>>>>>>>          // Orderly shutdown of containers
>>>>>>>>          while (!containers.isEmpty()) {
>>>>>>>>
>>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>>> ==============================================================================
>>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>>>>>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>>>>>>  import org.
>>>>>>>
>>>>>>> --
>>>>>>> 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
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Alasdair Nottingham
>>>>> not@apache.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Cheers,
>>>> Guillaume Nodet
>>>> ------------------------
>>>> Blog: http://gnodet.blogspot.com/
>>>> ------------------------
>>>> Open Source SOA
>>>> http://fusesource.com
>>>>
>>>
>>>
>>>
>>> --
>>> Alasdair Nottingham
>>> not@apache.org
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>
>
>
> --
> Alasdair Nottingham
> not@apache.org
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Alasdair Nottingham <no...@apache.org>.
On 21 February 2011 12:19, Guillaume Nodet <gn...@gmail.com> wrote:
> On Mon, Feb 21, 2011 at 12:28, Alasdair Nottingham <no...@apache.org> wrote:
>> So assume we released util as a 1.0 bundle, why would that prevent
>> blueprint 0.4
>> using it? I don't think I've seen anything that says you have to bump your major
>> version based on the dependency doing so. That seems like a crazy idea. You
>> should only bump your major version if you have to.
>
> Ok, so let's think about that a bit more.  I think the case is a bit
> different if the package is exported or not.
> If the package is exported, the dependent package will be imported and
> end up in uses constraints, so if you change the import range to be
> incompatible, you actually have a major incompatibility I think.  If I
> have a bundle that depend on both packages, my bundle would clearly
> become unusable with the new version, which means it's a major change
> on the package actually.
> If the package isn't exported, the change would at least require other
> updates in bundles, so while the packages would still be fully
> compatible, the bundle version should be incremented from at least a
> minor version imho.
> Here, I'm not sure that any package depending on aries-util is
> actually exported, but we'd have to check.
>

I do not think this is how uses should be interpreted. uses is designed to solve
the problem whereby a package A returns, or receives types from package B and
you want to ensure the bundle and its clients have a consistent view
of A and B. It
is not there to ensure that bundle A and bundle B share the same copy
of a package
A when package A is strictly part of the internals. As a result the
scenario you describe
would never happen.

>> I would also say that until we have had a vote about exactly what we are doing
>> regarding releasing and versioning this kind of activity is a little premature.
>
> Well, I'm raising things that we need to keep in mind when we vote for
> the policy we'll use.   We were supposed to use a release cycle at the
> component level, so I'm actually trying to release blueprint without
> having to release everything, that's all.  If/when we move that at the
> bundle level, things will be even more complicated.
>

I am not saying that raising the issue is premature, I am saying that creating a
branch is premature.

>> Alasdair
>>
>> On 21 February 2011 11:21, Guillaume Nodet <gn...@gmail.com> wrote:
>>> Sorry for not being more clear, I was referring to the following change:
>>>
>>>> Removed:
>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>
>>> One class has been deleted from a package, so that's a major
>>> incompabible change which needs aries-util version to be bumped to 1.0
>>> according to semantic versioning rules.  What I'm not sure is how it
>>> affect other projects, for example blueprint trunk would need to
>>> change the aries-util dependency from [0.3,1) to [1,2) and I'm not
>>> sure how the blueprint version should reflect that change.
>>>
>>> I don't really want to include an update to a new major version of a
>>> dependency in a minor release of blueprint, so I think we should bump
>>> blueprint to 1.0, hence my point of creating a 0.4 branch for
>>> blueprint.
>>>
>>> Hope it's a bit more clear now.
>>>
>>> On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham <no...@apache.org> wrote:
>>>> Can you clarify what in this commit you are objecting to? There were
>>>> rather a large number of
>>>> changes not all of which are included in your email.
>>>>
>>>> Why would you create a branch for blueprint 0.4? What is the point?
>>>>
>>>> Alasdair
>>>>
>>>> On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>> I come back to this commit as this is a *major* incompatibility change.
>>>>> The util package major version need be bumped up.  I'm not quite sure
>>>>> what kind of changes that impact on downstream bundles (blueprint,
>>>>> jndi, jpa, etc...) but I think the cascading effect is that their
>>>>> major version need to be bumped too.  Can someone please have a look
>>>>> at that and fix the problems ?
>>>>>
>>>>> I'll create a branch for blueprint 0.4.x which can work with other
>>>>> components in 0.3 as that's what is implied the version range is
>>>>> afaik.
>>>>>
>>>>> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>>> While I do not question the validity of such changes, it tends to
>>>>>> confirm my impression that we have components that are quite tied
>>>>>> together and that we'll never be able to release them independantly
>>>>>> (apart from bug fix release which do not matter here).
>>>>>> How easy would such things be if we had several trunks, one jira per
>>>>>> component, each jira associated to a different version in jira...
>>>>>> This also changes the constraints on the packages imported by a
>>>>>> component, so you'd have to change some package versions.  That's
>>>>>> kinda bad as if a user want to update one bundle, he has to actually
>>>>>> update a bunch of bundles.  if we're going to use a different version
>>>>>> for each component, we'd have to keep track of the compatibility
>>>>>> somewhere so that this can appear in the release notes.
>>>>>>
>>>>>> i'll stop to lobby on the release cycle versioning, but I just want to
>>>>>> make everyone knows where we're going.
>>>>>>
>>>>>> I wonder if we'll have to change to a more manual management of the
>>>>>> imported packages in the pom, disabling * packages expansions by bnd
>>>>>> and also disabling auto computation of version ranges to make sure
>>>>>> we're aware of changes
>>>>>>
>>>>>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>>>>>> Author: timothyjward
>>>>>>> Date: Fri Feb  4 16:13:32 2011
>>>>>>> New Revision: 1067207
>>>>>>>
>>>>>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>>>>>> Log:
>>>>>>> ARIES-567 - Add a common utility for safe unregistration
>>>>>>>
>>>>>>> Added:
>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>>>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>> Removed:
>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>>> Modified:
>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>>>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>>>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>>>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>>>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>>>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>>>>>     aries/trunk/transaction/pom.xml
>>>>>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>>>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>>>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>>>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>>>>>
>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>> ==============================================================================
>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>>>>>> @@ -57,6 +57,10 @@
>>>>>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>>>>>        </dependency>
>>>>>>>        <dependency>
>>>>>>> +          <groupId>org.apache.aries</groupId>
>>>>>>> +          <artifactId>org.apache.aries.util</artifactId>
>>>>>>> +      </dependency>
>>>>>>> +      <dependency>
>>>>>>>            <groupId>org.osgi</groupId>
>>>>>>>            <artifactId>org.osgi.core</artifactId>
>>>>>>>            <scope>provided</scope>
>>>>>>>
>>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>> ==============================================================================
>>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>>>>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>>>>>  import java.util.Dictionary;
>>>>>>>  import java.util.Hashtable;
>>>>>>>
>>>>>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>>
>>>>>>>  public class Activator implements BundleActivator {
>>>>>>>
>>>>>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>>>>>      }
>>>>>>>
>>>>>>>      public void stop(BundleContext context) {
>>>>>>> -        if (sr != null) {
>>>>>>> -            sr.unregister();
>>>>>>> -        }
>>>>>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>>>>>      }
>>>>>>>
>>>>>>>  }
>>>>>>>
>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>> ==============================================================================
>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>>>>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>>>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>  import org.osgi.framework.Constants;
>>>>>>>  import org.osgi.framework.ServiceReference;
>>>>>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>>>>>      }
>>>>>>>
>>>>>>>      public void destroy() {
>>>>>>> -        if (registration != null) {
>>>>>>> -            registration.unregister();
>>>>>>> -        }
>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>>>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>>>>>          }
>>>>>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>>>>>              }
>>>>>>>          }
>>>>>>>          destroyComponent(component, code);
>>>>>>> -        registration.unregister();
>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>      }
>>>>>>>
>>>>>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>>>>>
>>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>> ==============================================================================
>>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>>>>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>>>>>  import java.util.List;
>>>>>>>  import java.util.Properties;
>>>>>>>
>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>>  import org.osgi.service.cm.ConfigurationException;
>>>>>>>  import org.osgi.service.cm.ManagedService;
>>>>>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>>>>>              reg.remove(cm);
>>>>>>>              if (reg.isEmpty()) {
>>>>>>>                  map.remove(key);
>>>>>>> -                reg.getRegistration().unregister();
>>>>>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>>>>>              }
>>>>>>>          }
>>>>>>>      }
>>>>>>>
>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>> ==============================================================================
>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>>>>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>>  import org.osgi.framework.Constants;
>>>>>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>>>>>          if (timeoutFuture != null) {
>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>          }
>>>>>>> -        if (registration != null) {
>>>>>>> -            registration.unregister();
>>>>>>> -        }
>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>          if (handlerSet != null) {
>>>>>>>              handlerSet.removeListener(this);
>>>>>>>              handlerSet.destroy();
>>>>>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>>>>>          if (timeoutFuture != null) {
>>>>>>>              timeoutFuture.cancel(false);
>>>>>>>          }
>>>>>>> -        if (registration != null) {
>>>>>>> -            registration.unregister();
>>>>>>> -        }
>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>>          if (handlerSet != null) {
>>>>>>>              handlerSet.removeListener(this);
>>>>>>>              handlerSet.destroy();
>>>>>>>
>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>> ==============================================================================
>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>>>>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>>  import org.apache.aries.proxy.ProxyManager;
>>>>>>> -import org.apache.aries.util.SingleServiceTracker;
>>>>>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>>>>>  import org.osgi.framework.Bundle;
>>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>>>>>                 bt.close();
>>>>>>>          }
>>>>>>>
>>>>>>> -        parserServiceReg.unregister();
>>>>>>> -
>>>>>>> -        if (quiesceParticipantReg != null)
>>>>>>> -               quiesceParticipantReg.unregister();
>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>>>>>> +
>>>>>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>>>>>
>>>>>>>          // Orderly shutdown of containers
>>>>>>>          while (!containers.isEmpty()) {
>>>>>>>
>>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>>> ==============================================================================
>>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>>>>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>>>>>  import org.
>>>>>>
>>>>>> --
>>>>>> 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
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Alasdair Nottingham
>>>> not@apache.org
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>> ------------------------
>>> Open Source SOA
>>> http://fusesource.com
>>>
>>
>>
>>
>> --
>> Alasdair Nottingham
>> not@apache.org
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>



-- 
Alasdair Nottingham
not@apache.org

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Guillaume Nodet <gn...@gmail.com>.
On Mon, Feb 21, 2011 at 12:28, Alasdair Nottingham <no...@apache.org> wrote:
> So assume we released util as a 1.0 bundle, why would that prevent
> blueprint 0.4
> using it? I don't think I've seen anything that says you have to bump your major
> version based on the dependency doing so. That seems like a crazy idea. You
> should only bump your major version if you have to.

Ok, so let's think about that a bit more.  I think the case is a bit
different if the package is exported or not.
If the package is exported, the dependent package will be imported and
end up in uses constraints, so if you change the import range to be
incompatible, you actually have a major incompatibility I think.  If I
have a bundle that depend on both packages, my bundle would clearly
become unusable with the new version, which means it's a major change
on the package actually.
If the package isn't exported, the change would at least require other
updates in bundles, so while the packages would still be fully
compatible, the bundle version should be incremented from at least a
minor version imho.
Here, I'm not sure that any package depending on aries-util is
actually exported, but we'd have to check.

> I would also say that until we have had a vote about exactly what we are doing
> regarding releasing and versioning this kind of activity is a little premature.

Well, I'm raising things that we need to keep in mind when we vote for
the policy we'll use.   We were supposed to use a release cycle at the
component level, so I'm actually trying to release blueprint without
having to release everything, that's all.  If/when we move that at the
bundle level, things will be even more complicated.

> Alasdair
>
> On 21 February 2011 11:21, Guillaume Nodet <gn...@gmail.com> wrote:
>> Sorry for not being more clear, I was referring to the following change:
>>
>>> Removed:
>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>
>> One class has been deleted from a package, so that's a major
>> incompabible change which needs aries-util version to be bumped to 1.0
>> according to semantic versioning rules.  What I'm not sure is how it
>> affect other projects, for example blueprint trunk would need to
>> change the aries-util dependency from [0.3,1) to [1,2) and I'm not
>> sure how the blueprint version should reflect that change.
>>
>> I don't really want to include an update to a new major version of a
>> dependency in a minor release of blueprint, so I think we should bump
>> blueprint to 1.0, hence my point of creating a 0.4 branch for
>> blueprint.
>>
>> Hope it's a bit more clear now.
>>
>> On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham <no...@apache.org> wrote:
>>> Can you clarify what in this commit you are objecting to? There were
>>> rather a large number of
>>> changes not all of which are included in your email.
>>>
>>> Why would you create a branch for blueprint 0.4? What is the point?
>>>
>>> Alasdair
>>>
>>> On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
>>>> I come back to this commit as this is a *major* incompatibility change.
>>>> The util package major version need be bumped up.  I'm not quite sure
>>>> what kind of changes that impact on downstream bundles (blueprint,
>>>> jndi, jpa, etc...) but I think the cascading effect is that their
>>>> major version need to be bumped too.  Can someone please have a look
>>>> at that and fix the problems ?
>>>>
>>>> I'll create a branch for blueprint 0.4.x which can work with other
>>>> components in 0.3 as that's what is implied the version range is
>>>> afaik.
>>>>
>>>> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>>>>> While I do not question the validity of such changes, it tends to
>>>>> confirm my impression that we have components that are quite tied
>>>>> together and that we'll never be able to release them independantly
>>>>> (apart from bug fix release which do not matter here).
>>>>> How easy would such things be if we had several trunks, one jira per
>>>>> component, each jira associated to a different version in jira...
>>>>> This also changes the constraints on the packages imported by a
>>>>> component, so you'd have to change some package versions.  That's
>>>>> kinda bad as if a user want to update one bundle, he has to actually
>>>>> update a bunch of bundles.  if we're going to use a different version
>>>>> for each component, we'd have to keep track of the compatibility
>>>>> somewhere so that this can appear in the release notes.
>>>>>
>>>>> i'll stop to lobby on the release cycle versioning, but I just want to
>>>>> make everyone knows where we're going.
>>>>>
>>>>> I wonder if we'll have to change to a more manual management of the
>>>>> imported packages in the pom, disabling * packages expansions by bnd
>>>>> and also disabling auto computation of version ranges to make sure
>>>>> we're aware of changes
>>>>>
>>>>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>>>>> Author: timothyjward
>>>>>> Date: Fri Feb  4 16:13:32 2011
>>>>>> New Revision: 1067207
>>>>>>
>>>>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>>>>> Log:
>>>>>> ARIES-567 - Add a common utility for safe unregistration
>>>>>>
>>>>>> Added:
>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>> Removed:
>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>>> Modified:
>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>>>>     aries/trunk/transaction/pom.xml
>>>>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>>>>
>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>> ==============================================================================
>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>>>>> @@ -57,6 +57,10 @@
>>>>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>>>>        </dependency>
>>>>>>        <dependency>
>>>>>> +          <groupId>org.apache.aries</groupId>
>>>>>> +          <artifactId>org.apache.aries.util</artifactId>
>>>>>> +      </dependency>
>>>>>> +      <dependency>
>>>>>>            <groupId>org.osgi</groupId>
>>>>>>            <artifactId>org.osgi.core</artifactId>
>>>>>>            <scope>provided</scope>
>>>>>>
>>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>> ==============================================================================
>>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>>>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>>>>  import java.util.Dictionary;
>>>>>>  import java.util.Hashtable;
>>>>>>
>>>>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>  import org.osgi.framework.Constants;
>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>>
>>>>>>  public class Activator implements BundleActivator {
>>>>>>
>>>>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>>>>      }
>>>>>>
>>>>>>      public void stop(BundleContext context) {
>>>>>> -        if (sr != null) {
>>>>>> -            sr.unregister();
>>>>>> -        }
>>>>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>>>>      }
>>>>>>
>>>>>>  }
>>>>>>
>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>> ==============================================================================
>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>>>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>  import org.osgi.framework.Bundle;
>>>>>>  import org.osgi.framework.Constants;
>>>>>>  import org.osgi.framework.ServiceReference;
>>>>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>>>>      }
>>>>>>
>>>>>>      public void destroy() {
>>>>>> -        if (registration != null) {
>>>>>> -            registration.unregister();
>>>>>> -        }
>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>>>>          }
>>>>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>>>>              }
>>>>>>          }
>>>>>>          destroyComponent(component, code);
>>>>>> -        registration.unregister();
>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>      }
>>>>>>
>>>>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>>>>
>>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>> ==============================================================================
>>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>>>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>>>>  import java.util.List;
>>>>>>  import java.util.Properties;
>>>>>>
>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>>  import org.osgi.service.cm.ConfigurationException;
>>>>>>  import org.osgi.service.cm.ManagedService;
>>>>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>>>>              reg.remove(cm);
>>>>>>              if (reg.isEmpty()) {
>>>>>>                  map.remove(key);
>>>>>> -                reg.getRegistration().unregister();
>>>>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>>>>              }
>>>>>>          }
>>>>>>      }
>>>>>>
>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>> ==============================================================================
>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>>>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>  import org.osgi.framework.Bundle;
>>>>>>  import org.osgi.framework.BundleContext;
>>>>>>  import org.osgi.framework.Constants;
>>>>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>>>>          if (timeoutFuture != null) {
>>>>>>              timeoutFuture.cancel(false);
>>>>>>          }
>>>>>> -        if (registration != null) {
>>>>>> -            registration.unregister();
>>>>>> -        }
>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>          if (handlerSet != null) {
>>>>>>              handlerSet.removeListener(this);
>>>>>>              handlerSet.destroy();
>>>>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>>>>          if (timeoutFuture != null) {
>>>>>>              timeoutFuture.cancel(false);
>>>>>>          }
>>>>>> -        if (registration != null) {
>>>>>> -            registration.unregister();
>>>>>> -        }
>>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>>          if (handlerSet != null) {
>>>>>>              handlerSet.removeListener(this);
>>>>>>              handlerSet.destroy();
>>>>>>
>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>> ==============================================================================
>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>>>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>>  import org.apache.aries.proxy.ProxyManager;
>>>>>> -import org.apache.aries.util.SingleServiceTracker;
>>>>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>>>>  import org.osgi.framework.Bundle;
>>>>>>  import org.osgi.framework.BundleActivator;
>>>>>>  import org.osgi.framework.BundleContext;
>>>>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>>>>                 bt.close();
>>>>>>          }
>>>>>>
>>>>>> -        parserServiceReg.unregister();
>>>>>> -
>>>>>> -        if (quiesceParticipantReg != null)
>>>>>> -               quiesceParticipantReg.unregister();
>>>>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>>>>> +
>>>>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>>>>
>>>>>>          // Orderly shutdown of containers
>>>>>>          while (!containers.isEmpty()) {
>>>>>>
>>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>>> ==============================================================================
>>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>>>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>>>>  import org.
>>>>>
>>>>> --
>>>>> 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
>>>>
>>>
>>>
>>>
>>> --
>>> Alasdair Nottingham
>>> not@apache.org
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>
>
>
> --
> Alasdair Nottingham
> not@apache.org
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Alasdair Nottingham <no...@apache.org>.
So assume we released util as a 1.0 bundle, why would that prevent
blueprint 0.4
using it? I don't think I've seen anything that says you have to bump your major
version based on the dependency doing so. That seems like a crazy idea. You
should only bump your major version if you have to.

I would also say that until we have had a vote about exactly what we are doing
regarding releasing and versioning this kind of activity is a little premature.

Alasdair

On 21 February 2011 11:21, Guillaume Nodet <gn...@gmail.com> wrote:
> Sorry for not being more clear, I was referring to the following change:
>
>> Removed:
>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>
> One class has been deleted from a package, so that's a major
> incompabible change which needs aries-util version to be bumped to 1.0
> according to semantic versioning rules.  What I'm not sure is how it
> affect other projects, for example blueprint trunk would need to
> change the aries-util dependency from [0.3,1) to [1,2) and I'm not
> sure how the blueprint version should reflect that change.
>
> I don't really want to include an update to a new major version of a
> dependency in a minor release of blueprint, so I think we should bump
> blueprint to 1.0, hence my point of creating a 0.4 branch for
> blueprint.
>
> Hope it's a bit more clear now.
>
> On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham <no...@apache.org> wrote:
>> Can you clarify what in this commit you are objecting to? There were
>> rather a large number of
>> changes not all of which are included in your email.
>>
>> Why would you create a branch for blueprint 0.4? What is the point?
>>
>> Alasdair
>>
>> On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
>>> I come back to this commit as this is a *major* incompatibility change.
>>> The util package major version need be bumped up.  I'm not quite sure
>>> what kind of changes that impact on downstream bundles (blueprint,
>>> jndi, jpa, etc...) but I think the cascading effect is that their
>>> major version need to be bumped too.  Can someone please have a look
>>> at that and fix the problems ?
>>>
>>> I'll create a branch for blueprint 0.4.x which can work with other
>>> components in 0.3 as that's what is implied the version range is
>>> afaik.
>>>
>>> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>>>> While I do not question the validity of such changes, it tends to
>>>> confirm my impression that we have components that are quite tied
>>>> together and that we'll never be able to release them independantly
>>>> (apart from bug fix release which do not matter here).
>>>> How easy would such things be if we had several trunks, one jira per
>>>> component, each jira associated to a different version in jira...
>>>> This also changes the constraints on the packages imported by a
>>>> component, so you'd have to change some package versions.  That's
>>>> kinda bad as if a user want to update one bundle, he has to actually
>>>> update a bunch of bundles.  if we're going to use a different version
>>>> for each component, we'd have to keep track of the compatibility
>>>> somewhere so that this can appear in the release notes.
>>>>
>>>> i'll stop to lobby on the release cycle versioning, but I just want to
>>>> make everyone knows where we're going.
>>>>
>>>> I wonder if we'll have to change to a more manual management of the
>>>> imported packages in the pom, disabling * packages expansions by bnd
>>>> and also disabling auto computation of version ranges to make sure
>>>> we're aware of changes
>>>>
>>>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>>>> Author: timothyjward
>>>>> Date: Fri Feb  4 16:13:32 2011
>>>>> New Revision: 1067207
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>>>> Log:
>>>>> ARIES-567 - Add a common utility for safe unregistration
>>>>>
>>>>> Added:
>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>> Removed:
>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>>> Modified:
>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>>>     aries/trunk/transaction/pom.xml
>>>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>>>
>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>> ==============================================================================
>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>>>> @@ -57,6 +57,10 @@
>>>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>>>        </dependency>
>>>>>        <dependency>
>>>>> +          <groupId>org.apache.aries</groupId>
>>>>> +          <artifactId>org.apache.aries.util</artifactId>
>>>>> +      </dependency>
>>>>> +      <dependency>
>>>>>            <groupId>org.osgi</groupId>
>>>>>            <artifactId>org.osgi.core</artifactId>
>>>>>            <scope>provided</scope>
>>>>>
>>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>> ==============================================================================
>>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>>>  import java.util.Dictionary;
>>>>>  import java.util.Hashtable;
>>>>>
>>>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>  import org.osgi.framework.BundleActivator;
>>>>>  import org.osgi.framework.BundleContext;
>>>>>  import org.osgi.framework.Constants;
>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>>
>>>>>  public class Activator implements BundleActivator {
>>>>>
>>>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>>>      }
>>>>>
>>>>>      public void stop(BundleContext context) {
>>>>> -        if (sr != null) {
>>>>> -            sr.unregister();
>>>>> -        }
>>>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>>>      }
>>>>>
>>>>>  }
>>>>>
>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>> ==============================================================================
>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>  import org.osgi.framework.Bundle;
>>>>>  import org.osgi.framework.Constants;
>>>>>  import org.osgi.framework.ServiceReference;
>>>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>>>      }
>>>>>
>>>>>      public void destroy() {
>>>>> -        if (registration != null) {
>>>>> -            registration.unregister();
>>>>> -        }
>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>>>          }
>>>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>>>              }
>>>>>          }
>>>>>          destroyComponent(component, code);
>>>>> -        registration.unregister();
>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>      }
>>>>>
>>>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>>>
>>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>> ==============================================================================
>>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>>>  import java.util.List;
>>>>>  import java.util.Properties;
>>>>>
>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>  import org.osgi.framework.ServiceRegistration;
>>>>>  import org.osgi.service.cm.ConfigurationException;
>>>>>  import org.osgi.service.cm.ManagedService;
>>>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>>>              reg.remove(cm);
>>>>>              if (reg.isEmpty()) {
>>>>>                  map.remove(key);
>>>>> -                reg.getRegistration().unregister();
>>>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>>>              }
>>>>>          }
>>>>>      }
>>>>>
>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>> ==============================================================================
>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>  import org.osgi.framework.Bundle;
>>>>>  import org.osgi.framework.BundleContext;
>>>>>  import org.osgi.framework.Constants;
>>>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>>>          if (timeoutFuture != null) {
>>>>>              timeoutFuture.cancel(false);
>>>>>          }
>>>>> -        if (registration != null) {
>>>>> -            registration.unregister();
>>>>> -        }
>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>          if (handlerSet != null) {
>>>>>              handlerSet.removeListener(this);
>>>>>              handlerSet.destroy();
>>>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>>>          if (timeoutFuture != null) {
>>>>>              timeoutFuture.cancel(false);
>>>>>          }
>>>>> -        if (registration != null) {
>>>>> -            registration.unregister();
>>>>> -        }
>>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>>          if (handlerSet != null) {
>>>>>              handlerSet.removeListener(this);
>>>>>              handlerSet.destroy();
>>>>>
>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>> ==============================================================================
>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>>  import org.apache.aries.proxy.ProxyManager;
>>>>> -import org.apache.aries.util.SingleServiceTracker;
>>>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>>>  import org.osgi.framework.Bundle;
>>>>>  import org.osgi.framework.BundleActivator;
>>>>>  import org.osgi.framework.BundleContext;
>>>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>>>                 bt.close();
>>>>>          }
>>>>>
>>>>> -        parserServiceReg.unregister();
>>>>> -
>>>>> -        if (quiesceParticipantReg != null)
>>>>> -               quiesceParticipantReg.unregister();
>>>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>>>> +
>>>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>>>
>>>>>          // Orderly shutdown of containers
>>>>>          while (!containers.isEmpty()) {
>>>>>
>>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>>> ==============================================================================
>>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>>>  import org.
>>>>
>>>> --
>>>> 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
>>>
>>
>>
>>
>> --
>> Alasdair Nottingham
>> not@apache.org
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>



-- 
Alasdair Nottingham
not@apache.org

RE: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Timothy Ward <ti...@apache.org>.
Hi,

I moved that file because it was the only tracker not in the .tracker package. I'm happy to have a broader discussion about the util bundle, including moving the filesystem code from the application component and generally getting it to 1.0 standard for a proper, semantically versioned runtime.

We haven't been semantically versioning so far, so I don't think imports of [0.3,1.0) really make sense. Most parts of the runtime have been making breaking changes each release because we were incubating and we're only now approaching a stable API.


Tim

----------------------------------------
> Date: Mon, 21 Feb 2011 12:21:19 +0100
> Subject: Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/
> From: gnodet@gmail.com
> To: dev@aries.apache.org
>
> Sorry for not being more clear, I was referring to the following change:
>
> > Removed:
> > aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>
> One class has been deleted from a package, so that's a major
> incompabible change which needs aries-util version to be bumped to 1.0
> according to semantic versioning rules. What I'm not sure is how it
> affect other projects, for example blueprint trunk would need to
> change the aries-util dependency from [0.3,1) to [1,2) and I'm not
> sure how the blueprint version should reflect that change.
>
> I don't really want to include an update to a new major version of a
> dependency in a minor release of blueprint, so I think we should bump
> blueprint to 1.0, hence my point of creating a 0.4 branch for
> blueprint.
>
> Hope it's a bit more clear now.
>
> On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham  wrote:
> > Can you clarify what in this commit you are objecting to? There were
> > rather a large number of
> > changes not all of which are included in your email.
> >
> > Why would you create a branch for blueprint 0.4? What is the point?
> >
> > Alasdair
> >
> > On 21 February 2011 10:55, Guillaume Nodet  wrote:
> >> I come back to this commit as this is a *major* incompatibility change.
> >> The util package major version need be bumped up.  I'm not quite sure
> >> what kind of changes that impact on downstream bundles (blueprint,
> >> jndi, jpa, etc...) but I think the cascading effect is that their
> >> major version need to be bumped too.  Can someone please have a look
> >> at that and fix the problems ?
> >>
> >> I'll create a branch for blueprint 0.4.x which can work with other
> >> components in 0.3 as that's what is implied the version range is
> >> afaik.
> >>
> >> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet  wrote:
> >>> While I do not question the validity of such changes, it tends to
> >>> confirm my impression that we have components that are quite tied
> >>> together and that we'll never be able to release them independantly
> >>> (apart from bug fix release which do not matter here).
> >>> How easy would such things be if we had several trunks, one jira per
> >>> component, each jira associated to a different version in jira...
> >>> This also changes the constraints on the packages imported by a
> >>> component, so you'd have to change some package versions.  That's
> >>> kinda bad as if a user want to update one bundle, he has to actually
> >>> update a bunch of bundles.  if we're going to use a different version
> >>> for each component, we'd have to keep track of the compatibility
> >>> somewhere so that this can appear in the release notes.
> >>>
> >>> i'll stop to lobby on the release cycle versioning, but I just want to
> >>> make everyone knows where we're going.
> >>>
> >>> I wonder if we'll have to change to a more manual management of the
> >>> imported packages in the pom, disabling * packages expansions by bnd
> >>> and also disabling auto computation of version ranges to make sure
> >>> we're aware of changes
> >>>
> >>> On Friday, February 4, 2011,   wrote:
> >>>> Author: timothyjward
> >>>> Date: Fri Feb  4 16:13:32 2011
> >>>> New Revision: 1067207
> >>>>
> >>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
> >>>> Log:
> >>>> ARIES-567 - Add a common utility for safe unregistration
> >>>>
> >>>> Added:
> >>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
> >>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
> >>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
> >>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
> >>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
> >>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
> >>>> Removed:
> >>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
> >>>> Modified:
> >>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
> >>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
> >>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
> >>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
> >>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
> >>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
> >>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
> >>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
> >>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
> >>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
> >>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
> >>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
> >>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
> >>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
> >>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
> >>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
> >>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
> >>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
> >>>>     aries/trunk/transaction/pom.xml
> >>>>     aries/trunk/transaction/transaction-manager/pom.xml
> >>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
> >>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
> >>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
> >>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
> >>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
> >>>>
> >>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
> >>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
> >>>> ==============================================================================
> >>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
> >>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
> >>>> @@ -57,6 +57,10 @@
> >>>>            org.apache.aries.blueprint.annotation.api
> >>>>        
> >>>>        
> >>>> +          org.apache.aries
> >>>> +          org.apache.aries.util
> >>>> +      
> >>>> +      
> >>>>            org.osgi
> >>>>            org.osgi.core
> >>>>            provided
> >>>>
> >>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
> >>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
> >>>> ==============================================================================
> >>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
> >>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
> >>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
> >>>>  import java.util.Dictionary;
> >>>>  import java.util.Hashtable;
> >>>>
> >>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
> >>>> +import org.apache.aries.util.AriesFrameworkUtil;
> >>>>  import org.osgi.framework.BundleActivator;
> >>>>  import org.osgi.framework.BundleContext;
> >>>>  import org.osgi.framework.Constants;
> >>>>  import org.osgi.framework.ServiceRegistration;
> >>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
> >>>>
> >>>>  public class Activator implements BundleActivator {
> >>>>
> >>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
> >>>>      }
> >>>>
> >>>>      public void stop(BundleContext context) {
> >>>> -        if (sr != null) {
> >>>> -            sr.unregister();
> >>>> -        }
> >>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
> >>>>      }
> >>>>
> >>>>  }
> >>>>
> >>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
> >>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
> >>>> ==============================================================================
> >>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
> >>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
> >>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
> >>>>  import org.apache.aries.blueprint.container.ServiceListener;
> >>>>  import org.apache.aries.blueprint.utils.JavaUtils;
> >>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
> >>>> +import org.apache.aries.util.AriesFrameworkUtil;
> >>>>  import org.osgi.framework.Bundle;
> >>>>  import org.osgi.framework.Constants;
> >>>>  import org.osgi.framework.ServiceReference;
> >>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
> >>>>      }
> >>>>
> >>>>      public void destroy() {
> >>>> -        if (registration != null) {
> >>>> -            registration.unregister();
> >>>> -        }
> >>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
> >>>>          for (Map.Entry entry : services.entrySet()) {
> >>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
> >>>>          }
> >>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
> >>>>              }
> >>>>          }
> >>>>          destroyComponent(component, code);
> >>>> -        registration.unregister();
> >>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
> >>>>      }
> >>>>
> >>>>      public Map getServiceMap() {
> >>>>
> >>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
> >>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
> >>>> ==============================================================================
> >>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
> >>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
> >>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
> >>>>  import java.util.List;
> >>>>  import java.util.Properties;
> >>>>
> >>>> +import org.apache.aries.util.AriesFrameworkUtil;
> >>>>  import org.osgi.framework.ServiceRegistration;
> >>>>  import org.osgi.service.cm.ConfigurationException;
> >>>>  import org.osgi.service.cm.ManagedService;
> >>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
> >>>>              reg.remove(cm);
> >>>>              if (reg.isEmpty()) {
> >>>>                  map.remove(key);
> >>>> -                reg.getRegistration().unregister();
> >>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
> >>>>              }
> >>>>          }
> >>>>      }
> >>>>
> >>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
> >>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
> >>>> ==============================================================================
> >>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
> >>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
> >>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
> >>>>  import org.apache.aries.blueprint.utils.HeaderParser;
> >>>>  import org.apache.aries.blueprint.utils.JavaUtils;
> >>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
> >>>> +import org.apache.aries.util.AriesFrameworkUtil;
> >>>>  import org.osgi.framework.Bundle;
> >>>>  import org.osgi.framework.BundleContext;
> >>>>  import org.osgi.framework.Constants;
> >>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
> >>>>          if (timeoutFuture != null) {
> >>>>              timeoutFuture.cancel(false);
> >>>>          }
> >>>> -        if (registration != null) {
> >>>> -            registration.unregister();
> >>>> -        }
> >>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
> >>>>          if (handlerSet != null) {
> >>>>              handlerSet.removeListener(this);
> >>>>              handlerSet.destroy();
> >>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
> >>>>          if (timeoutFuture != null) {
> >>>>              timeoutFuture.cancel(false);
> >>>>          }
> >>>> -        if (registration != null) {
> >>>> -            registration.unregister();
> >>>> -        }
> >>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
> >>>>          if (handlerSet != null) {
> >>>>              handlerSet.removeListener(this);
> >>>>              handlerSet.destroy();
> >>>>
> >>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
> >>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
> >>>> ==============================================================================
> >>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
> >>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
> >>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
> >>>>  import org.apache.aries.blueprint.utils.HeaderParser;
> >>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
> >>>>  import org.apache.aries.proxy.ProxyManager;
> >>>> -import org.apache.aries.util.SingleServiceTracker;
> >>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
> >>>> +import org.apache.aries.util.AriesFrameworkUtil;
> >>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
> >>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
> >>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
> >>>>  import org.osgi.framework.Bundle;
> >>>>  import org.osgi.framework.BundleActivator;
> >>>>  import org.osgi.framework.BundleContext;
> >>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
> >>>>                 bt.close();
> >>>>          }
> >>>>
> >>>> -        parserServiceReg.unregister();
> >>>> -
> >>>> -        if (quiesceParticipantReg != null)
> >>>> -               quiesceParticipantReg.unregister();
> >>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
> >>>> +
> >>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
> >>>>
> >>>>          // Orderly shutdown of containers
> >>>>          while (!containers.isEmpty()) {
> >>>>
> >>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
> >>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
> >>>> ==============================================================================
> >>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
> >>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
> >>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
> >>>>  import org.
> >>>
> >>> --
> >>> 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
> >>
> >
> >
> >
> > --
> > Alasdair Nottingham
> > not@apache.org
> >
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
 		 	   		  

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Guillaume Nodet <gn...@gmail.com>.
Sorry for not being more clear, I was referring to the following change:

> Removed:
>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java

One class has been deleted from a package, so that's a major
incompabible change which needs aries-util version to be bumped to 1.0
according to semantic versioning rules.  What I'm not sure is how it
affect other projects, for example blueprint trunk would need to
change the aries-util dependency from [0.3,1) to [1,2) and I'm not
sure how the blueprint version should reflect that change.

I don't really want to include an update to a new major version of a
dependency in a minor release of blueprint, so I think we should bump
blueprint to 1.0, hence my point of creating a 0.4 branch for
blueprint.

Hope it's a bit more clear now.

On Mon, Feb 21, 2011 at 12:12, Alasdair Nottingham <no...@apache.org> wrote:
> Can you clarify what in this commit you are objecting to? There were
> rather a large number of
> changes not all of which are included in your email.
>
> Why would you create a branch for blueprint 0.4? What is the point?
>
> Alasdair
>
> On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
>> I come back to this commit as this is a *major* incompatibility change.
>> The util package major version need be bumped up.  I'm not quite sure
>> what kind of changes that impact on downstream bundles (blueprint,
>> jndi, jpa, etc...) but I think the cascading effect is that their
>> major version need to be bumped too.  Can someone please have a look
>> at that and fix the problems ?
>>
>> I'll create a branch for blueprint 0.4.x which can work with other
>> components in 0.3 as that's what is implied the version range is
>> afaik.
>>
>> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>>> While I do not question the validity of such changes, it tends to
>>> confirm my impression that we have components that are quite tied
>>> together and that we'll never be able to release them independantly
>>> (apart from bug fix release which do not matter here).
>>> How easy would such things be if we had several trunks, one jira per
>>> component, each jira associated to a different version in jira...
>>> This also changes the constraints on the packages imported by a
>>> component, so you'd have to change some package versions.  That's
>>> kinda bad as if a user want to update one bundle, he has to actually
>>> update a bunch of bundles.  if we're going to use a different version
>>> for each component, we'd have to keep track of the compatibility
>>> somewhere so that this can appear in the release notes.
>>>
>>> i'll stop to lobby on the release cycle versioning, but I just want to
>>> make everyone knows where we're going.
>>>
>>> I wonder if we'll have to change to a more manual management of the
>>> imported packages in the pom, disabling * packages expansions by bnd
>>> and also disabling auto computation of version ranges to make sure
>>> we're aware of changes
>>>
>>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>>> Author: timothyjward
>>>> Date: Fri Feb  4 16:13:32 2011
>>>> New Revision: 1067207
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>>> Log:
>>>> ARIES-567 - Add a common utility for safe unregistration
>>>>
>>>> Added:
>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>> Removed:
>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>>> Modified:
>>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>>     aries/trunk/transaction/pom.xml
>>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>>
>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>> ==============================================================================
>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>>> @@ -57,6 +57,10 @@
>>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>>        </dependency>
>>>>        <dependency>
>>>> +          <groupId>org.apache.aries</groupId>
>>>> +          <artifactId>org.apache.aries.util</artifactId>
>>>> +      </dependency>
>>>> +      <dependency>
>>>>            <groupId>org.osgi</groupId>
>>>>            <artifactId>org.osgi.core</artifactId>
>>>>            <scope>provided</scope>
>>>>
>>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>> ==============================================================================
>>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>>  import java.util.Dictionary;
>>>>  import java.util.Hashtable;
>>>>
>>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>  import org.osgi.framework.BundleActivator;
>>>>  import org.osgi.framework.BundleContext;
>>>>  import org.osgi.framework.Constants;
>>>>  import org.osgi.framework.ServiceRegistration;
>>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>>
>>>>  public class Activator implements BundleActivator {
>>>>
>>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>>      }
>>>>
>>>>      public void stop(BundleContext context) {
>>>> -        if (sr != null) {
>>>> -            sr.unregister();
>>>> -        }
>>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>>      }
>>>>
>>>>  }
>>>>
>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>> ==============================================================================
>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>  import org.osgi.framework.Bundle;
>>>>  import org.osgi.framework.Constants;
>>>>  import org.osgi.framework.ServiceReference;
>>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>>      }
>>>>
>>>>      public void destroy() {
>>>> -        if (registration != null) {
>>>> -            registration.unregister();
>>>> -        }
>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>>          }
>>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>>              }
>>>>          }
>>>>          destroyComponent(component, code);
>>>> -        registration.unregister();
>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>      }
>>>>
>>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>>
>>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>> ==============================================================================
>>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>>  import java.util.List;
>>>>  import java.util.Properties;
>>>>
>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>  import org.osgi.framework.ServiceRegistration;
>>>>  import org.osgi.service.cm.ConfigurationException;
>>>>  import org.osgi.service.cm.ManagedService;
>>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>>              reg.remove(cm);
>>>>              if (reg.isEmpty()) {
>>>>                  map.remove(key);
>>>> -                reg.getRegistration().unregister();
>>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>>              }
>>>>          }
>>>>      }
>>>>
>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>> ==============================================================================
>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>  import org.osgi.framework.Bundle;
>>>>  import org.osgi.framework.BundleContext;
>>>>  import org.osgi.framework.Constants;
>>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>>          if (timeoutFuture != null) {
>>>>              timeoutFuture.cancel(false);
>>>>          }
>>>> -        if (registration != null) {
>>>> -            registration.unregister();
>>>> -        }
>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>          if (handlerSet != null) {
>>>>              handlerSet.removeListener(this);
>>>>              handlerSet.destroy();
>>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>>          if (timeoutFuture != null) {
>>>>              timeoutFuture.cancel(false);
>>>>          }
>>>> -        if (registration != null) {
>>>> -            registration.unregister();
>>>> -        }
>>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>>          if (handlerSet != null) {
>>>>              handlerSet.removeListener(this);
>>>>              handlerSet.destroy();
>>>>
>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>> ==============================================================================
>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>>  import org.apache.aries.proxy.ProxyManager;
>>>> -import org.apache.aries.util.SingleServiceTracker;
>>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>>  import org.osgi.framework.Bundle;
>>>>  import org.osgi.framework.BundleActivator;
>>>>  import org.osgi.framework.BundleContext;
>>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>>                 bt.close();
>>>>          }
>>>>
>>>> -        parserServiceReg.unregister();
>>>> -
>>>> -        if (quiesceParticipantReg != null)
>>>> -               quiesceParticipantReg.unregister();
>>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>>> +
>>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>>
>>>>          // Orderly shutdown of containers
>>>>          while (!containers.isEmpty()) {
>>>>
>>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>>> ==============================================================================
>>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>>  import org.
>>>
>>> --
>>> 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
>>
>
>
>
> --
> Alasdair Nottingham
> not@apache.org
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Alasdair Nottingham <no...@apache.org>.
Can you clarify what in this commit you are objecting to? There were
rather a large number of
changes not all of which are included in your email.

Why would you create a branch for blueprint 0.4? What is the point?

Alasdair

On 21 February 2011 10:55, Guillaume Nodet <gn...@gmail.com> wrote:
> I come back to this commit as this is a *major* incompatibility change.
> The util package major version need be bumped up.  I'm not quite sure
> what kind of changes that impact on downstream bundles (blueprint,
> jndi, jpa, etc...) but I think the cascading effect is that their
> major version need to be bumped too.  Can someone please have a look
> at that and fix the problems ?
>
> I'll create a branch for blueprint 0.4.x which can work with other
> components in 0.3 as that's what is implied the version range is
> afaik.
>
> On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
>> While I do not question the validity of such changes, it tends to
>> confirm my impression that we have components that are quite tied
>> together and that we'll never be able to release them independantly
>> (apart from bug fix release which do not matter here).
>> How easy would such things be if we had several trunks, one jira per
>> component, each jira associated to a different version in jira...
>> This also changes the constraints on the packages imported by a
>> component, so you'd have to change some package versions.  That's
>> kinda bad as if a user want to update one bundle, he has to actually
>> update a bunch of bundles.  if we're going to use a different version
>> for each component, we'd have to keep track of the compatibility
>> somewhere so that this can appear in the release notes.
>>
>> i'll stop to lobby on the release cycle versioning, but I just want to
>> make everyone knows where we're going.
>>
>> I wonder if we'll have to change to a more manual management of the
>> imported packages in the pom, disabling * packages expansions by bnd
>> and also disabling auto computation of version ranges to make sure
>> we're aware of changes
>>
>> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>>> Author: timothyjward
>>> Date: Fri Feb  4 16:13:32 2011
>>> New Revision: 1067207
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>>> Log:
>>> ARIES-567 - Add a common utility for safe unregistration
>>>
>>> Added:
>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>> Removed:
>>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>>> Modified:
>>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>>     aries/trunk/transaction/pom.xml
>>>     aries/trunk/transaction/transaction-manager/pom.xml
>>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>>
>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>>> ==============================================================================
>>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>>> @@ -57,6 +57,10 @@
>>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>>        </dependency>
>>>        <dependency>
>>> +          <groupId>org.apache.aries</groupId>
>>> +          <artifactId>org.apache.aries.util</artifactId>
>>> +      </dependency>
>>> +      <dependency>
>>>            <groupId>org.osgi</groupId>
>>>            <artifactId>org.osgi.core</artifactId>
>>>            <scope>provided</scope>
>>>
>>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>> ==============================================================================
>>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>>  import java.util.Dictionary;
>>>  import java.util.Hashtable;
>>>
>>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>  import org.osgi.framework.BundleActivator;
>>>  import org.osgi.framework.BundleContext;
>>>  import org.osgi.framework.Constants;
>>>  import org.osgi.framework.ServiceRegistration;
>>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>>
>>>  public class Activator implements BundleActivator {
>>>
>>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>>      }
>>>
>>>      public void stop(BundleContext context) {
>>> -        if (sr != null) {
>>> -            sr.unregister();
>>> -        }
>>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>>      }
>>>
>>>  }
>>>
>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>> ==============================================================================
>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>>  import org.apache.aries.blueprint.container.ServiceListener;
>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>  import org.osgi.framework.Bundle;
>>>  import org.osgi.framework.Constants;
>>>  import org.osgi.framework.ServiceReference;
>>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>>      }
>>>
>>>      public void destroy() {
>>> -        if (registration != null) {
>>> -            registration.unregister();
>>> -        }
>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>>          }
>>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>>              }
>>>          }
>>>          destroyComponent(component, code);
>>> -        registration.unregister();
>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>      }
>>>
>>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>>
>>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>> ==============================================================================
>>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>>  import java.util.List;
>>>  import java.util.Properties;
>>>
>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>  import org.osgi.framework.ServiceRegistration;
>>>  import org.osgi.service.cm.ConfigurationException;
>>>  import org.osgi.service.cm.ManagedService;
>>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>>              reg.remove(cm);
>>>              if (reg.isEmpty()) {
>>>                  map.remove(key);
>>> -                reg.getRegistration().unregister();
>>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>>              }
>>>          }
>>>      }
>>>
>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>> ==============================================================================
>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>  import org.osgi.framework.Bundle;
>>>  import org.osgi.framework.BundleContext;
>>>  import org.osgi.framework.Constants;
>>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>>          if (timeoutFuture != null) {
>>>              timeoutFuture.cancel(false);
>>>          }
>>> -        if (registration != null) {
>>> -            registration.unregister();
>>> -        }
>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>          if (handlerSet != null) {
>>>              handlerSet.removeListener(this);
>>>              handlerSet.destroy();
>>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>>          if (timeoutFuture != null) {
>>>              timeoutFuture.cancel(false);
>>>          }
>>> -        if (registration != null) {
>>> -            registration.unregister();
>>> -        }
>>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>>          if (handlerSet != null) {
>>>              handlerSet.removeListener(this);
>>>              handlerSet.destroy();
>>>
>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>> ==============================================================================
>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>>  import org.apache.aries.proxy.ProxyManager;
>>> -import org.apache.aries.util.SingleServiceTracker;
>>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>>> +import org.apache.aries.util.AriesFrameworkUtil;
>>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>>  import org.osgi.framework.Bundle;
>>>  import org.osgi.framework.BundleActivator;
>>>  import org.osgi.framework.BundleContext;
>>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>>                 bt.close();
>>>          }
>>>
>>> -        parserServiceReg.unregister();
>>> -
>>> -        if (quiesceParticipantReg != null)
>>> -               quiesceParticipantReg.unregister();
>>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>>> +
>>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>>
>>>          // Orderly shutdown of containers
>>>          while (!containers.isEmpty()) {
>>>
>>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>>> ==============================================================================
>>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>>  import org.
>>
>> --
>> 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
>



-- 
Alasdair Nottingham
not@apache.org

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Guillaume Nodet <gn...@gmail.com>.
I come back to this commit as this is a *major* incompatibility change.
The util package major version need be bumped up.  I'm not quite sure
what kind of changes that impact on downstream bundles (blueprint,
jndi, jpa, etc...) but I think the cascading effect is that their
major version need to be bumped too.  Can someone please have a look
at that and fix the problems ?

I'll create a branch for blueprint 0.4.x which can work with other
components in 0.3 as that's what is implied the version range is
afaik.

On Fri, Feb 4, 2011 at 19:22, Guillaume Nodet <gn...@gmail.com> wrote:
> While I do not question the validity of such changes, it tends to
> confirm my impression that we have components that are quite tied
> together and that we'll never be able to release them independantly
> (apart from bug fix release which do not matter here).
> How easy would such things be if we had several trunks, one jira per
> component, each jira associated to a different version in jira...
> This also changes the constraints on the packages imported by a
> component, so you'd have to change some package versions.  That's
> kinda bad as if a user want to update one bundle, he has to actually
> update a bunch of bundles.  if we're going to use a different version
> for each component, we'd have to keep track of the compatibility
> somewhere so that this can appear in the release notes.
>
> i'll stop to lobby on the release cycle versioning, but I just want to
> make everyone knows where we're going.
>
> I wonder if we'll have to change to a more manual management of the
> imported packages in the pom, disabling * packages expansions by bnd
> and also disabling auto computation of version ranges to make sure
> we're aware of changes
>
> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>> Author: timothyjward
>> Date: Fri Feb  4 16:13:32 2011
>> New Revision: 1067207
>>
>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>> Log:
>> ARIES-567 - Add a common utility for safe unregistration
>>
>> Added:
>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>> Removed:
>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>> Modified:
>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>     aries/trunk/transaction/pom.xml
>>     aries/trunk/transaction/transaction-manager/pom.xml
>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>
>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>> @@ -57,6 +57,10 @@
>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>        </dependency>
>>        <dependency>
>> +          <groupId>org.apache.aries</groupId>
>> +          <artifactId>org.apache.aries.util</artifactId>
>> +      </dependency>
>> +      <dependency>
>>            <groupId>org.osgi</groupId>
>>            <artifactId>org.osgi.core</artifactId>
>>            <scope>provided</scope>
>>
>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>  import java.util.Dictionary;
>>  import java.util.Hashtable;
>>
>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>> +import org.apache.aries.util.AriesFrameworkUtil;
>>  import org.osgi.framework.BundleActivator;
>>  import org.osgi.framework.BundleContext;
>>  import org.osgi.framework.Constants;
>>  import org.osgi.framework.ServiceRegistration;
>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>
>>  public class Activator implements BundleActivator {
>>
>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>      }
>>
>>      public void stop(BundleContext context) {
>> -        if (sr != null) {
>> -            sr.unregister();
>> -        }
>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>      }
>>
>>  }
>>
>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>  import org.apache.aries.blueprint.container.ServiceListener;
>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>> +import org.apache.aries.util.AriesFrameworkUtil;
>>  import org.osgi.framework.Bundle;
>>  import org.osgi.framework.Constants;
>>  import org.osgi.framework.ServiceReference;
>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>      }
>>
>>      public void destroy() {
>> -        if (registration != null) {
>> -            registration.unregister();
>> -        }
>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>          }
>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>              }
>>          }
>>          destroyComponent(component, code);
>> -        registration.unregister();
>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>      }
>>
>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>
>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>  import java.util.List;
>>  import java.util.Properties;
>>
>> +import org.apache.aries.util.AriesFrameworkUtil;
>>  import org.osgi.framework.ServiceRegistration;
>>  import org.osgi.service.cm.ConfigurationException;
>>  import org.osgi.service.cm.ManagedService;
>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>              reg.remove(cm);
>>              if (reg.isEmpty()) {
>>                  map.remove(key);
>> -                reg.getRegistration().unregister();
>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>              }
>>          }
>>      }
>>
>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>> +import org.apache.aries.util.AriesFrameworkUtil;
>>  import org.osgi.framework.Bundle;
>>  import org.osgi.framework.BundleContext;
>>  import org.osgi.framework.Constants;
>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>          if (timeoutFuture != null) {
>>              timeoutFuture.cancel(false);
>>          }
>> -        if (registration != null) {
>> -            registration.unregister();
>> -        }
>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>          if (handlerSet != null) {
>>              handlerSet.removeListener(this);
>>              handlerSet.destroy();
>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>          if (timeoutFuture != null) {
>>              timeoutFuture.cancel(false);
>>          }
>> -        if (registration != null) {
>> -            registration.unregister();
>> -        }
>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>          if (handlerSet != null) {
>>              handlerSet.removeListener(this);
>>              handlerSet.destroy();
>>
>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>  import org.apache.aries.proxy.ProxyManager;
>> -import org.apache.aries.util.SingleServiceTracker;
>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>> +import org.apache.aries.util.AriesFrameworkUtil;
>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>  import org.osgi.framework.Bundle;
>>  import org.osgi.framework.BundleActivator;
>>  import org.osgi.framework.BundleContext;
>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>                 bt.close();
>>          }
>>
>> -        parserServiceReg.unregister();
>> -
>> -        if (quiesceParticipantReg != null)
>> -               quiesceParticipantReg.unregister();
>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>> +
>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>
>>          // Orderly shutdown of containers
>>          while (!containers.isEmpty()) {
>>
>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>  import org.
>
> --
> 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

Re: svn commit: r1067207 - in /aries/trunk: blueprint/blueprint-annotation-impl/ blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/ blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/

Posted by Alasdair Nottingham <no...@apache.org>.
On 4 February 2011 18:22, Guillaume Nodet <gn...@gmail.com> wrote:
> While I do not question the validity of such changes, it tends to
> confirm my impression that we have components that are quite tied
> together and that we'll never be able to release them independantly
> (apart from bug fix release which do not matter here).
> How easy would such things be if we had several trunks, one jira per
> component, each jira associated to a different version in jira...
> This also changes the constraints on the packages imported by a
> component, so you'd have to change some package versions.  That's
> kinda bad as if a user want to update one bundle, he has to actually
> update a bunch of bundles.  if we're going to use a different version
> for each component, we'd have to keep track of the compatibility
> somewhere so that this can appear in the release notes.
>

This doesn't really worry me. The whole point of the util bundle, in
my view, is that it holds
utilities we use from a lot of places. It is true that if we add
something to util that is used from
multiple we have to release util when we release the downstream
module, but we don't end up tying
transaction, blueprint, jpa together. Just transaction and util, or
blueprint and util. Also once util is
others are not affected. As long as we do semantic versioning adding
something to util wont break
other already released modules either.

> i'll stop to lobby on the release cycle versioning, but I just want to
> make everyone knows where we're going.

I guess I may have missed something, but what is release cycle versioning?

>
> I wonder if we'll have to change to a more manual management of the
> imported packages in the pom, disabling * packages expansions by bnd
> and also disabling auto computation of version ranges to make sure
> we're aware of changes

I hope not. I would much rather we didn't put export versions in the
pom either. I'd prefer to use the
packageinfo files bnd supports. This of course depends on a fix to
FELIX-2819 although I see a work
around I might play around with now.

>
> On Friday, February 4, 2011,  <ti...@apache.org> wrote:
>> Author: timothyjward
>> Date: Fri Feb  4 16:13:32 2011
>> New Revision: 1067207
>>
>> URL: http://svn.apache.org/viewvc?rev=1067207&view=rev
>> Log:
>> ARIES-567 - Add a common utility for safe unregistration
>>
>> Added:
>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/
>>     aries/trunk/jpa/jpa-container-context/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/
>>     aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/util/AriesFrameworkUtil.java
>>     aries/trunk/util/src/main/java/org/apache/aries/util/tracker/SingleServiceTracker.java
>>       - copied, changed from r1067146, aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>> Removed:
>>     aries/trunk/util/src/main/java/org/apache/aries/util/SingleServiceTracker.java
>> Modified:
>>     aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>>     aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>>     aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>>     aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>>     aries/trunk/jmx/jmx-blueprint-core/pom.xml
>>     aries/trunk/jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/BlueprintState.java
>>     aries/trunk/jndi/jndi-rmi/src/main/java/org/apache/aries/jndi/rmi/Activator.java
>>     aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/GlobalPersistenceManager.java
>>     aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/impl/PersistenceContextManager.java
>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
>>     aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
>>     aries/trunk/quiesce/quiesce-manager/pom.xml
>>     aries/trunk/quiesce/quiesce-manager/src/main/java/org/apache/aries/quiesce/manager/impl/Activator.java
>>     aries/trunk/transaction/pom.xml
>>     aries/trunk/transaction/transaction-manager/pom.xml
>>     aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
>>     aries/trunk/transaction/transaction-wrappers/pom.xml
>>     aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
>>     aries/trunk/util/src/main/java/org/apache/aries/util/AriesFrameworkUtil.java
>>     aries/trunk/util/src/test/java/org/apache/aries/util/SingleServiceTrackerTest.java
>>
>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/pom.xml
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/pom.xml?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-annotation-impl/pom.xml (original)
>> +++ aries/trunk/blueprint/blueprint-annotation-impl/pom.xml Fri Feb  4 16:13:32 2011
>> @@ -57,6 +57,10 @@
>>            <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
>>        </dependency>
>>        <dependency>
>> +          <groupId>org.apache.aries</groupId>
>> +          <artifactId>org.apache.aries.util</artifactId>
>> +      </dependency>
>> +      <dependency>
>>            <groupId>org.osgi</groupId>
>>            <artifactId>org.osgi.core</artifactId>
>>            <scope>provided</scope>
>>
>> Modified: aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java (original)
>> +++ aries/trunk/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/Activator.java Fri Feb  4 16:13:32 2011
>> @@ -19,11 +19,12 @@ package org.apache.aries.blueprint.annot
>>  import java.util.Dictionary;
>>  import java.util.Hashtable;
>>
>> +import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>> +import org.apache.aries.util.AriesFrameworkUtil;
>>  import org.osgi.framework.BundleActivator;
>>  import org.osgi.framework.BundleContext;
>>  import org.osgi.framework.Constants;
>>  import org.osgi.framework.ServiceRegistration;
>> -import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
>>
>>  public class Activator implements BundleActivator {
>>
>> @@ -36,9 +37,7 @@ public class Activator implements Bundle
>>      }
>>
>>      public void stop(BundleContext context) {
>> -        if (sr != null) {
>> -            sr.unregister();
>> -        }
>> +      AriesFrameworkUtil.safeUnregisterService(sr);
>>      }
>>
>>  }
>>
>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Fri Feb  4 16:13:32 2011
>> @@ -35,6 +35,7 @@ import org.apache.aries.blueprint.Servic
>>  import org.apache.aries.blueprint.container.ServiceListener;
>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>  import org.apache.aries.blueprint.utils.ReflectionUtils;
>> +import org.apache.aries.util.AriesFrameworkUtil;
>>  import org.osgi.framework.Bundle;
>>  import org.osgi.framework.Constants;
>>  import org.osgi.framework.ServiceReference;
>> @@ -100,9 +101,7 @@ public class CmManagedServiceFactory {
>>      }
>>
>>      public void destroy() {
>> -        if (registration != null) {
>> -            registration.unregister();
>> -        }
>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>          for (Map.Entry<ServiceRegistration, Object> entry : services.entrySet()) {
>>              destroy(entry.getValue(), entry.getKey(), BUNDLE_STOPPING);
>>          }
>> @@ -119,7 +118,7 @@ public class CmManagedServiceFactory {
>>              }
>>          }
>>          destroyComponent(component, code);
>> -        registration.unregister();
>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>      }
>>
>>      public Map<ServiceRegistration, Object> getServiceMap() {
>>
>> Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java (original)
>> +++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ManagedObjectManager.java Fri Feb  4 16:13:32 2011
>> @@ -25,6 +25,7 @@ import java.util.HashMap;
>>  import java.util.List;
>>  import java.util.Properties;
>>
>> +import org.apache.aries.util.AriesFrameworkUtil;
>>  import org.osgi.framework.ServiceRegistration;
>>  import org.osgi.service.cm.ConfigurationException;
>>  import org.osgi.service.cm.ManagedService;
>> @@ -60,7 +61,7 @@ public class ManagedObjectManager {
>>              reg.remove(cm);
>>              if (reg.isEmpty()) {
>>                  map.remove(key);
>> -                reg.getRegistration().unregister();
>> +                AriesFrameworkUtil.safeUnregisterService(reg.getRegistration());
>>              }
>>          }
>>      }
>>
>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Feb  4 16:13:32 2011
>> @@ -62,6 +62,7 @@ import org.apache.aries.blueprint.reflec
>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>  import org.apache.aries.blueprint.utils.JavaUtils;
>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>> +import org.apache.aries.util.AriesFrameworkUtil;
>>  import org.osgi.framework.Bundle;
>>  import org.osgi.framework.BundleContext;
>>  import org.osgi.framework.Constants;
>> @@ -812,9 +813,7 @@ public class BlueprintContainerImpl impl
>>          if (timeoutFuture != null) {
>>              timeoutFuture.cancel(false);
>>          }
>> -        if (registration != null) {
>> -            registration.unregister();
>> -        }
>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>          if (handlerSet != null) {
>>              handlerSet.removeListener(this);
>>              handlerSet.destroy();
>> @@ -845,9 +844,7 @@ public class BlueprintContainerImpl impl
>>          if (timeoutFuture != null) {
>>              timeoutFuture.cancel(false);
>>          }
>> -        if (registration != null) {
>> -            registration.unregister();
>> -        }
>> +        AriesFrameworkUtil.safeUnregisterService(registration);
>>          if (handlerSet != null) {
>>              handlerSet.removeListener(this);
>>              handlerSet.destroy();
>>
>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Feb  4 16:13:32 2011
>> @@ -39,9 +39,10 @@ import org.apache.aries.blueprint.namesp
>>  import org.apache.aries.blueprint.utils.HeaderParser;
>>  import org.apache.aries.blueprint.utils.HeaderParser.PathElement;
>>  import org.apache.aries.proxy.ProxyManager;
>> -import org.apache.aries.util.SingleServiceTracker;
>> -import org.apache.aries.util.SingleServiceTracker.SingleServiceListener;
>> +import org.apache.aries.util.AriesFrameworkUtil;
>>  import org.apache.aries.util.tracker.RecursiveBundleTracker;
>> +import org.apache.aries.util.tracker.SingleServiceTracker;
>> +import org.apache.aries.util.tracker.SingleServiceTracker.SingleServiceListener;
>>  import org.osgi.framework.Bundle;
>>  import org.osgi.framework.BundleActivator;
>>  import org.osgi.framework.BundleContext;
>> @@ -154,10 +155,9 @@ public class BlueprintExtender implement
>>                 bt.close();
>>          }
>>
>> -        parserServiceReg.unregister();
>> -
>> -        if (quiesceParticipantReg != null)
>> -               quiesceParticipantReg.unregister();
>> +        AriesFrameworkUtil.safeUnregisterService(parserServiceReg);
>> +
>> +        AriesFrameworkUtil.safeUnregisterService(quiesceParticipantReg);
>>
>>          // Orderly shutdown of containers
>>          while (!containers.isEmpty()) {
>>
>> Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
>> URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1067207&r1=1067206&r2=1067207&view=diff
>> ==============================================================================
>> --- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java (original)
>> +++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java Fri Feb  4 16:13:32 2011
>> @@ -44,6 +44,7 @@ import org.apache.aries.blueprint.proxy.
>>  import org.
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>



-- 
Alasdair Nottingham
not@apache.org