[aries] branch trunk updated: ARIES-1998 IllegalStateException on service unregistration in ProviderBundleTrackerCustomizer.removedBundle

2020-09-29 Thread rotty3000
This is an automated email from the ASF dual-hosted git repository.

rotty3000 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/aries.git


The following commit(s) were added to refs/heads/trunk by this push:
 new a19c140  ARIES-1998 IllegalStateException on service unregistration in 
ProviderBundleTrackerCustomizer.removedBundle
a19c140 is described below

commit a19c140d145b57eeeaf7e9c9e8ae55341b992108
Author: Raymond Augé 
AuthorDate: Tue Sep 29 15:51:05 2020 -0400

ARIES-1998 IllegalStateException on service unregistration in 
ProviderBundleTrackerCustomizer.removedBundle

Signed-off-by: Raymond Augé 
---
 .../aries/spifly/ProviderBundleTrackerCustomizer.java | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git 
a/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java
 
b/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java
index 5de77f3..e9bf68a 100644
--- 
a/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java
+++ 
b/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java
@@ -441,8 +441,7 @@ public class ProviderBundleTrackerCustomizer implements 
BundleTrackerCustomizer
 
 @Override
 public void modifiedBundle(Bundle bundle, BundleEvent event, Object 
registrations) {
-removedBundle(bundle, event, registrations);
-addingBundle(bundle, event);
+// implementation is unnecessary for this use case
 }
 
 @Override
@@ -454,8 +453,16 @@ public class ProviderBundleTrackerCustomizer implements 
BundleTrackerCustomizer
 return;
 
 for (ServiceRegistration reg : (List) 
registrations) {
-reg.unregister();
-log(Level.INFO, "Unregistered: " + reg);
+try {
+reg.unregister();
+log(Level.INFO, "Unregistered: " + reg);
+} catch (IllegalStateException ise) {
+// Ignore the exception but do not remove the try/catch.
+// There are some bundle context races on cleanup which
+// are safe to ignore but unsafe not to perform our own
+// cleanup. In an ideal world ServiceRegistration.unregister()
+// would have been idempotent and never throw an exception.
+}
 }
 }
 



[aries] branch trunk updated: ARIES-2008 Update to ASM 9.0 (and other minor build cleanup

2020-09-29 Thread rotty3000
This is an automated email from the ASF dual-hosted git repository.

rotty3000 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/aries.git


The following commit(s) were added to refs/heads/trunk by this push:
 new d110436  ARIES-2008 Update to ASM 9.0 (and other minor build cleanup
d110436 is described below

commit d11043689b13d3c07b585b8018d91174e9c6f77a
Author: Raymond Augé 
AuthorDate: Tue Sep 29 14:59:13 2020 -0400

ARIES-2008 Update to ASM 9.0 (and other minor build cleanup

Signed-off-by: Raymond Augé 
---
 spi-fly/spi-fly-core/pom.xml   |  4 ++--
 spi-fly/spi-fly-dynamic-bundle/pom.xml | 10 +++---
 spi-fly/spi-fly-dynamic-bundle/resolve.bndrun  | 11 ---
 spi-fly/spi-fly-dynamic-framework-extension/pom.xml| 10 +++---
 spi-fly/spi-fly-dynamic-framework-extension/resolve.bndrun |  5 -
 spi-fly/spi-fly-static-bundle/pom.xml  |  8 ++--
 spi-fly/spi-fly-static-bundle/resolve.bndrun   |  5 -
 spi-fly/spi-fly-static-tool/pom.xml|  4 ++--
 spi-fly/spi-fly-weaver/pom.xml |  6 +++---
 9 files changed, 27 insertions(+), 36 deletions(-)

diff --git a/spi-fly/spi-fly-core/pom.xml b/spi-fly/spi-fly-core/pom.xml
index 156fbd3..becfe1b 100644
--- a/spi-fly/spi-fly-core/pom.xml
+++ b/spi-fly/spi-fly-core/pom.xml
@@ -47,8 +47,8 @@
 
 
 
-4.2.0
-5.0.1
+5.1.1
+5.1.2
 
 
 
diff --git a/spi-fly/spi-fly-dynamic-bundle/pom.xml 
b/spi-fly/spi-fly-dynamic-bundle/pom.xml
index c78cda8..18179e9 100644
--- a/spi-fly/spi-fly-dynamic-bundle/pom.xml
+++ b/spi-fly/spi-fly-dynamic-bundle/pom.xml
@@ -47,9 +47,9 @@
 
 
 
-8.0.1
-4.2.0
-5.0.1
+9.0
+5.1.1
+5.1.2
 
 
 
@@ -211,6 +211,10 @@
 
 resolve.bndrun
 
+
+target/${project.build.finalName}.jar
+
+false
 
 
 
diff --git a/spi-fly/spi-fly-dynamic-bundle/resolve.bndrun 
b/spi-fly/spi-fly-dynamic-bundle/resolve.bndrun
index 154e97f..938bb24 100644
--- a/spi-fly/spi-fly-dynamic-bundle/resolve.bndrun
+++ b/spi-fly/spi-fly-dynamic-bundle/resolve.bndrun
@@ -10,15 +10,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
--standalone: true
--resolve.effective: resolve, active
--runee: JavaSE-1.8
 -runfw: org.apache.felix.framework
--runrequires: osgi.identity;filter:='(osgi.identity=${project.artifactId})'
--runbundles: \
-   org.apache.aries.spifly.dynamic.bundle;version='[1.3.0,1.3.1)',\
-   org.objectweb.asm;version='[8.0.1,8.0.2)',\
-   org.objectweb.asm.commons;version='[8.0.1,8.0.2)',\
-   org.objectweb.asm.tree;version='[8.0.1,8.0.2)',\
-   org.objectweb.asm.tree.analysis;version='[8.0.1,8.0.2)',\
-   org.objectweb.asm.util;version='[8.0.1,8.0.2)'
diff --git a/spi-fly/spi-fly-dynamic-framework-extension/pom.xml 
b/spi-fly/spi-fly-dynamic-framework-extension/pom.xml
index 6bbca6a..3c9b7ab 100644
--- a/spi-fly/spi-fly-dynamic-framework-extension/pom.xml
+++ b/spi-fly/spi-fly-dynamic-framework-extension/pom.xml
@@ -47,9 +47,9 @@
 
 
 
-8.0.1
-4.2.0
-5.0.1
+9.0
+5.1.1
+5.1.2
 
 
 
@@ -210,6 +210,10 @@
 
 resolve.bndrun
 
+
+target/${project.build.finalName}.jar
+
+false
 
 
 
diff --git a/spi-fly/spi-fly-dynamic-framework-extension/resolve.bndrun 
b/spi-fly/spi-fly-dynamic-framework-extension/resolve.bndrun
index 4a7b3c0..938bb24 100644
--- a/spi-fly/spi-fly-dynamic-framework-extension/resolve.bndrun
+++ b/spi-fly/spi-fly-dynamic-framework-extension/resolve.bndrun
@@ -10,9 +10,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
--standalone: true
--resolve.effective: resolve, active
--runee: JavaSE-1.8
 -runfw: org.apache.felix.framework
--runrequires: osgi.identity;filter:='(osgi.identity=${project.artifactId})'
--runbundles: 
org.apache.aries.spifly.dynamic.framework.extension;version='[1.3.0,1.3.1)'
diff --git a/spi-fly/spi-fly-static-bundle/pom.xml 
b/spi-fly/spi-fly-static-bundle/pom.xml
index 0954bc0..4889d7d 100644
--- a/spi-fly/spi-fly-static-bundle/pom.xml
+++ b/spi-fly/spi-fly-static-bundle/pom.xml
@@ -47,8 +47,8 @@
 
 
 
-4.2.0
-5.0.1
+5.1.1
+5.1.2
 
 
 
@@ -170,6 +170,10 @@
 
 resolve.bndrun
 
+
+ 

[aries-cdi] branch master updated: minor build updates

2020-09-29 Thread rotty3000
This is an automated email from the ASF dual-hosted git repository.

rotty3000 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-cdi.git


The following commit(s) were added to refs/heads/master by this push:
 new b64f578  minor build updates
b64f578 is described below

commit b64f578ee1abadef793cab3d1ecadeb2a377970b
Author: Raymond Augé 
AuthorDate: Tue Sep 29 11:47:26 2020 -0400

minor build updates

Signed-off-by: Raymond Augé 
---
 .github/workflows/maven.yml  | 4 ++--
 cdi-itests/owb-itest.bndrun  | 1 -
 cdi-itests/weld-itest.bndrun | 1 -
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index f754326..cc26070 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -21,7 +21,7 @@ jobs:
   JDKxx_Matrix:
 strategy:
   matrix:
-java: [ 8, 11, 14, 15-ea ]
+java: [ 8, 11, 15 ]
 os: [ ubuntu-latest ]
 include:
 - os: windows-latest
@@ -42,7 +42,7 @@ jobs:
   JDKxx_Matrix-Experimental:
 strategy:
   matrix:
-java: [ 8, 11, 14, 15-ea ]
+java: [ 8, 11, 15 ]
 os: [ ubuntu-latest ]
 include:
 - os: windows-latest
diff --git a/cdi-itests/owb-itest.bndrun b/cdi-itests/owb-itest.bndrun
index 7db7d6f..af2d5ca 100644
--- a/cdi-itests/owb-itest.bndrun
+++ b/cdi-itests/owb-itest.bndrun
@@ -19,7 +19,6 @@
 -runblacklist: \
osgi.identity;filter:='(osgi.identity=*weld*)'
 -runbundles: \
-   assertj-core;version='[3.16.1,3.16.2)',\
biz.aQute.junit;version='[5.1.0,5.1.1)',\
javax.servlet.jsp-api;version='[2.3.3,2.3.4)',\
openwebbeans-impl;version='[2.0.13,2.0.14)',\
diff --git a/cdi-itests/weld-itest.bndrun b/cdi-itests/weld-itest.bndrun
index 8804803..23a1cb4 100644
--- a/cdi-itests/weld-itest.bndrun
+++ b/cdi-itests/weld-itest.bndrun
@@ -20,7 +20,6 @@
 -runblacklist: \
osgi.identity;filter:='(osgi.identity=*owb*)'
 -runbundles: \
-   assertj-core;version='[3.16.1,3.16.2)',\
biz.aQute.junit;version='[5.1.0,5.1.1)',\
jboss-classfilewriter;version='[1.2.4,1.2.5)',\
org.apache.aries.cdi.extender;version='[1.1.2,1.1.3)',\



[aries-cdi] branch master updated: [ARIES-2007] ensure duplicated extensions between serviceloader usage and requirements are properly solved by ignoring ServiceLoader one

2020-09-29 Thread rmannibucau
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-cdi.git


The following commit(s) were added to refs/heads/master by this push:
 new 7571fd1  [ARIES-2007] ensure duplicated extensions between 
serviceloader usage and requirements are properly solved by ignoring 
ServiceLoader one
7571fd1 is described below

commit 7571fd15de349fb4b3ff0c752691552a17b2aab3
Author: Romain Manni-Bucau 
AuthorDate: Tue Sep 29 15:56:38 2020 +0200

[ARIES-2007] ensure duplicated extensions between serviceloader usage and 
requirements are properly solved by ignoring ServiceLoader one
---
 .../internal/container/ContainerBootstrap.java | 25 +++---
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git 
a/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ContainerBootstrap.java
 
b/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ContainerBootstrap.java
index 4771a27..63e42e3 100644
--- 
a/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ContainerBootstrap.java
+++ 
b/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ContainerBootstrap.java
@@ -20,8 +20,10 @@ import static java.util.Optional.ofNullable;
 import static org.osgi.service.cdi.CDIConstants.CDI_EXTENSION_PROPERTY;
 
 import java.net.URL;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Dictionary;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.ServiceLoader;
@@ -191,12 +193,7 @@ public class ContainerBootstrap extends Phase {
Constants.SERVICE_DESCRIPTION, "Aries 
CDI ServiceAdapterExtension"));
 
// Add extensions found from the bundle's class loader, such as 
those in the Bundle-ClassPath
-   ServiceLoader.load(Extension.class, 
containerState.classLoader()).forEach(extension ->
-   initializer.addExtension(
-   extension,
-   Maps.of(Constants.SERVICE_ID, 
counter.decrementAndGet(),
-   Constants.SERVICE_DESCRIPTION, 
"ClassLoader Extension from " + containerState.bundle()))
-   );
+   final Collection> serviceExtensions = new HashSet<>();
 
// Add external extensions
for (ExtensionDTO extensionDTO : 
containerState.containerDTO().extensions) {
@@ -204,8 +201,9 @@ public class ContainerBootstrap extends Phase {
 
Dictionary properties = 
extendedExtensionDTO.extension.getServiceReference().getProperties();
 
-   initializer.addExtension(
-   extendedExtensionDTO.extension.getService(), 
Maps.of(properties));
+   final Extension service = 
extendedExtensionDTO.extension.getService();
+   initializer.addExtension(service, Maps.of(properties));
+   serviceExtensions.add(service.getClass());
 
Bundle extensionBundle = 
extendedExtensionDTO.extension.getServiceReference().getBundle();
 
@@ -215,6 +213,17 @@ public class ContainerBootstrap extends Phase {
loader.getBundles().add(extensionBundle);
}
}
+
+   ServiceLoader.load(Extension.class, 
containerState.classLoader()).forEach(extension -> {
+   // let ServiceLoader.load have duplicatesd fail (cdi 
spec)
+   // we just want to solve conflicts between 
ServiceLoader and OSGi extensions
+   if (!serviceExtensions.contains(extension.getClass())) {
+   initializer.addExtension(
+   extension,
+   Maps.of(Constants.SERVICE_ID, 
counter.decrementAndGet(),
+   
Constants.SERVICE_DESCRIPTION, "ClassLoader Extension from " + 
containerState.bundle()));
+   }
+   });
}
 
private void 
getClassesFromExtensionCapability(Dictionary properties, Bundle 
extensionBundle, CDIContainerInitializer initializer) {



[aries-cdi] branch master updated: [ARIES-2007] ensure duplicated extensions between serviceloader usage and requirements are properly solved by ignoring ServiceLoader one

2020-09-29 Thread rmannibucau
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-cdi.git


The following commit(s) were added to refs/heads/master by this push:
 new 7571fd1  [ARIES-2007] ensure duplicated extensions between 
serviceloader usage and requirements are properly solved by ignoring 
ServiceLoader one
7571fd1 is described below

commit 7571fd15de349fb4b3ff0c752691552a17b2aab3
Author: Romain Manni-Bucau 
AuthorDate: Tue Sep 29 15:56:38 2020 +0200

[ARIES-2007] ensure duplicated extensions between serviceloader usage and 
requirements are properly solved by ignoring ServiceLoader one
---
 .../internal/container/ContainerBootstrap.java | 25 +++---
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git 
a/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ContainerBootstrap.java
 
b/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ContainerBootstrap.java
index 4771a27..63e42e3 100644
--- 
a/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ContainerBootstrap.java
+++ 
b/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ContainerBootstrap.java
@@ -20,8 +20,10 @@ import static java.util.Optional.ofNullable;
 import static org.osgi.service.cdi.CDIConstants.CDI_EXTENSION_PROPERTY;
 
 import java.net.URL;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Dictionary;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.ServiceLoader;
@@ -191,12 +193,7 @@ public class ContainerBootstrap extends Phase {
Constants.SERVICE_DESCRIPTION, "Aries 
CDI ServiceAdapterExtension"));
 
// Add extensions found from the bundle's class loader, such as 
those in the Bundle-ClassPath
-   ServiceLoader.load(Extension.class, 
containerState.classLoader()).forEach(extension ->
-   initializer.addExtension(
-   extension,
-   Maps.of(Constants.SERVICE_ID, 
counter.decrementAndGet(),
-   Constants.SERVICE_DESCRIPTION, 
"ClassLoader Extension from " + containerState.bundle()))
-   );
+   final Collection> serviceExtensions = new HashSet<>();
 
// Add external extensions
for (ExtensionDTO extensionDTO : 
containerState.containerDTO().extensions) {
@@ -204,8 +201,9 @@ public class ContainerBootstrap extends Phase {
 
Dictionary properties = 
extendedExtensionDTO.extension.getServiceReference().getProperties();
 
-   initializer.addExtension(
-   extendedExtensionDTO.extension.getService(), 
Maps.of(properties));
+   final Extension service = 
extendedExtensionDTO.extension.getService();
+   initializer.addExtension(service, Maps.of(properties));
+   serviceExtensions.add(service.getClass());
 
Bundle extensionBundle = 
extendedExtensionDTO.extension.getServiceReference().getBundle();
 
@@ -215,6 +213,17 @@ public class ContainerBootstrap extends Phase {
loader.getBundles().add(extensionBundle);
}
}
+
+   ServiceLoader.load(Extension.class, 
containerState.classLoader()).forEach(extension -> {
+   // let ServiceLoader.load have duplicatesd fail (cdi 
spec)
+   // we just want to solve conflicts between 
ServiceLoader and OSGi extensions
+   if (!serviceExtensions.contains(extension.getClass())) {
+   initializer.addExtension(
+   extension,
+   Maps.of(Constants.SERVICE_ID, 
counter.decrementAndGet(),
+   
Constants.SERVICE_DESCRIPTION, "ClassLoader Extension from " + 
containerState.bundle()));
+   }
+   });
}
 
private void 
getClassesFromExtensionCapability(Dictionary properties, Bundle 
extensionBundle, CDIContainerInitializer initializer) {



[aries-cdi] branch master updated: [ARIES-2007] ensure owb extensionloader loads only once extensions

2020-09-29 Thread rmannibucau
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-cdi.git


The following commit(s) were added to refs/heads/master by this push:
 new 1d45e08  [ARIES-2007] ensure owb extensionloader loads only once 
extensions
1d45e08 is described below

commit 1d45e0898d588c0c42a6b3ad010c56d203a0c7f1
Author: Romain Manni-Bucau 
AuthorDate: Tue Sep 29 15:40:13 2020 +0200

[ARIES-2007] ensure owb extensionloader loads only once extensions
---
 .../org/apache/aries/cdi/owb/core/OWBCDIContainerInitializer.java   | 6 ++
 1 file changed, 6 insertions(+)

diff --git 
a/cdi-owb/src/main/java/org/apache/aries/cdi/owb/core/OWBCDIContainerInitializer.java
 
b/cdi-owb/src/main/java/org/apache/aries/cdi/owb/core/OWBCDIContainerInitializer.java
index e8a9dd7..7249246 100644
--- 
a/cdi-owb/src/main/java/org/apache/aries/cdi/owb/core/OWBCDIContainerInitializer.java
+++ 
b/cdi-owb/src/main/java/org/apache/aries/cdi/owb/core/OWBCDIContainerInitializer.java
@@ -169,9 +169,15 @@ public class OWBCDIContainerInitializer extends 
CDIContainerInitializer {
 
bootstrap = new WebBeansContext(services, properties) {
private final ExtensionLoader 
overridenExtensionLoader = new ExtensionLoader(this) {
+   private boolean added;
+
@Override
public void loadExtensionServices() {
+   if (added) {
+   return;
+   }
extensions.forEach((k, v) -> 
addExtension(k));
+   added = true;
}
};
 



[aries-cdi] branch master updated: [ARIES-2007] ensure owb extensionloader loads only once extensions

2020-09-29 Thread rmannibucau
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-cdi.git


The following commit(s) were added to refs/heads/master by this push:
 new 1d45e08  [ARIES-2007] ensure owb extensionloader loads only once 
extensions
1d45e08 is described below

commit 1d45e0898d588c0c42a6b3ad010c56d203a0c7f1
Author: Romain Manni-Bucau 
AuthorDate: Tue Sep 29 15:40:13 2020 +0200

[ARIES-2007] ensure owb extensionloader loads only once extensions
---
 .../org/apache/aries/cdi/owb/core/OWBCDIContainerInitializer.java   | 6 ++
 1 file changed, 6 insertions(+)

diff --git 
a/cdi-owb/src/main/java/org/apache/aries/cdi/owb/core/OWBCDIContainerInitializer.java
 
b/cdi-owb/src/main/java/org/apache/aries/cdi/owb/core/OWBCDIContainerInitializer.java
index e8a9dd7..7249246 100644
--- 
a/cdi-owb/src/main/java/org/apache/aries/cdi/owb/core/OWBCDIContainerInitializer.java
+++ 
b/cdi-owb/src/main/java/org/apache/aries/cdi/owb/core/OWBCDIContainerInitializer.java
@@ -169,9 +169,15 @@ public class OWBCDIContainerInitializer extends 
CDIContainerInitializer {
 
bootstrap = new WebBeansContext(services, properties) {
private final ExtensionLoader 
overridenExtensionLoader = new ExtensionLoader(this) {
+   private boolean added;
+
@Override
public void loadExtensionServices() {
+   if (added) {
+   return;
+   }
extensions.forEach((k, v) -> 
addExtension(k));
+   added = true;
}
};