]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - eclipse/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/spring/SpringExtensionFactory.java
Update Jackrabbit container package name
[lgpl/argeo-commons.git] / eclipse / runtime / org.argeo.eclipse.ui / src / main / java / org / argeo / eclipse / spring / SpringExtensionFactory.java
index f20e1d1249f70c8e3a73fddaee6226ac9ee0e95d..aa0295d56a80fd3e18a8fb1ea0d9af8f244c4f27 100644 (file)
@@ -63,9 +63,9 @@ public class SpringExtensionFactory implements IExecutableExtensionFactory,
        public void setInitializationData(IConfigurationElement config,\r
                        String propertyName, Object data) throws CoreException {\r
                String bundleSymbolicName = config.getContributor().getName();\r
-               ApplicationContext appContext = ApplicationContextTracker\r
+               ApplicationContext applicationContext = ApplicationContextTracker\r
                                .getApplicationContext(bundleSymbolicName);\r
-               if (appContext == null)\r
+               if (applicationContext == null)\r
                        throw new ArgeoException(\r
                                        "Cannot find application context for bundle "\r
                                                        + bundleSymbolicName);\r
@@ -75,7 +75,15 @@ public class SpringExtensionFactory implements IExecutableExtensionFactory,
                        throw new ArgeoException("Cannot find bean name for extension "\r
                                        + config);\r
 \r
-               this.bean = appContext.getBean(beanName);\r
+               if (!applicationContext.containsBean(beanName)) {\r
+                       if (beanName.startsWith(bundleSymbolicName))\r
+                               beanName = beanName.substring(bundleSymbolicName.length() + 1);\r
+               }\r
+\r
+               if (!applicationContext.containsBean(beanName))\r
+                       throw new ArgeoException("No bean with name '" + beanName + "'");\r
+\r
+               this.bean = applicationContext.getBean(beanName);\r
                if (this.bean instanceof IExecutableExtension) {\r
                        ((IExecutableExtension) this.bean).setInitializationData(config,\r
                                        propertyName, data);\r