Commits

Bryan Turner committed c8d96d4

Removed explicit dependency on Spring DM or Gemini Blueprint by removing all usages of BundleContextAware
- The BundleContext is available on the context for constructor injection, so the interface doesn't have to be used
- BundleContext is now provided on the constructor for Activator
- Using Spring version 2.5.6 to ensure compatibility with the Spring DM plugin framework
- All tests pass

  • Participants
  • Parent commits 7845e69
  • Branches bturner-rest-2.7-spring31-blueprint

Comments (0)

Files changed (2)

File atlassian-rest-module/pom.xml

             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.springframework.osgi</groupId>
-            <artifactId>spring-osgi-core</artifactId>
-            <version>1.1.2</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
             <groupId>com.atlassian.plugins</groupId>
             <artifactId>atlassian-plugins-servlet</artifactId>
             <version>${plug.version}</version>

File atlassian-rest-module/src/main/java/com/atlassian/plugins/rest/module/Activator.java

 import org.osgi.framework.BundleContext;
 import org.springframework.beans.factory.DisposableBean;
 import org.springframework.beans.factory.InitializingBean;
-import org.springframework.osgi.context.BundleContextAware;
 
-public class Activator implements BundleContextAware, InitializingBean, DisposableBean
+public class Activator implements InitializingBean, DisposableBean
 {
     private final BundleActivator coreActivator = new com.sun.jersey.core.osgi.Activator();
     private final BundleActivator serverActivator = new com.sun.jersey.server.osgi.Activator(); 
-    private BundleContext bundleContext;
+    private final BundleContext bundleContext;
+
+    public Activator(BundleContext bundleContext)
+    {
+        this.bundleContext = bundleContext;
+    }
 
     public void afterPropertiesSet() throws Exception
     {
         serverActivator.stop(bundleContext);
         coreActivator.stop(bundleContext);
     }
-
-    public void setBundleContext(BundleContext bundleContext)
-    {
-        this.bundleContext = bundleContext;
-    }
 }