diff options
author | Tim Ward <timothyjward@apache.org> | 2017-07-19 07:17:46 +0100 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-07-19 09:17:46 +0300 |
commit | a108a7e8da24d5f38e5e3f34e4a0e95c1cb6b56e (patch) | |
tree | 711c1b32898c3395eaf9174869886c7c71343292 /osgi-integration/pom.xml | |
parent | c81f853fd949d0e515459733b5f5a867b9e2ee0f (diff) | |
download | vaadin-framework-a108a7e8da24d5f38e5e3f34e4a0e95c1cb6b56e.tar.gz vaadin-framework-a108a7e8da24d5f38e5e3f34e4a0e95c1cb6b56e.zip |
Tidy up the Vaadin OSGi whiteboard component (#9648)
The Vaadin OSGi integration component uses Declarative Services, but it does some odd things:
* It uses the whiteboard service's own bundle context to get hold of the service instance
* It has an asymmetric get/release for the whiteboard service, which could leak instances over time
* It releases service instances that it is still actively using
This change tidies up the service lifecycle by delegating the get/release to the Service Component Runtime managing the container (specifically by injecting the service instance). Using this injection also ensures that the Vaadin whiteboard service is obtained using this component's bundle context.
This change also simplifies the code a little by using the reference as the key to track the registrations. Different references for the same service are required to be equal so there is no issue with doing this.
This change does not alter the fact that the whiteboard service's bundle context is used to register the Http Whiteboard servlet, as this may be the intended behaviour. As a result the component should be prepared for an IllegalStateException when unregistering the service whiteboard service, which may already have been unregistered by the OSGi framework if the target bundle is stopping.
Diffstat (limited to 'osgi-integration/pom.xml')
-rw-r--r-- | osgi-integration/pom.xml | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/osgi-integration/pom.xml b/osgi-integration/pom.xml index cebdf2f640..e1ef1363ac 100644 --- a/osgi-integration/pom.xml +++ b/osgi-integration/pom.xml @@ -56,7 +56,6 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <version>3.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> |