JBoss-OSGI SVN: r99780 - projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-21 16:28:58 -0500 (Thu, 21 Jan 2010)
New Revision: 99780
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleClassLoader.java
Log:
Make BundleClassLoader final
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleClassLoader.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleClassLoader.java 2010-01-21 21:18:31 UTC (rev 99779)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleClassLoader.java 2010-01-21 21:28:58 UTC (rev 99780)
@@ -38,7 +38,7 @@
* @author thomas.Diesler(a)jboss.org
* @since 03-Feb-2009
*/
-public class BundleClassLoader extends ClassLoader
+public final class BundleClassLoader extends ClassLoader
{
private final Bundle bundle;
16 years, 6 months
JBoss-OSGI SVN: r99760 - projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers.
by jboss-osgi-commits@lists.jboss.org
Author: adrian(a)jboss.org
Date: 2010-01-21 13:11:21 -0500 (Thu, 21 Jan 2010)
New Revision: 99760
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java
Log:
Fix the import, but this deployer shouldn't be playing with the CLP directly
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java 2010-01-21 16:59:54 UTC (rev 99759)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java 2010-01-21 18:11:21 UTC (rev 99760)
@@ -29,7 +29,7 @@
import java.net.URL;
import org.jboss.classloader.spi.ClassLoaderPolicy;
-import org.jboss.classloader.spi.ClassLoaderPolicy.NativeLibraryProvider;
+import org.jboss.classloader.spi.NativeLibraryProvider;
import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
import org.jboss.classloading.spi.metadata.NativeLibrary;
import org.jboss.classloading.spi.metadata.NativeLibraryMetaData;
@@ -78,7 +78,7 @@
final OSGiBundleManager bundleManager = bundleState.getBundleManager();
// Add the native library mappings to the OSGiClassLoaderPolicy
- ClassLoaderPolicy policy = (ClassLoaderPolicy)unit.getAttachment(ClassLoaderPolicy.class);
+ ClassLoaderPolicy policy = unit.getAttachment(ClassLoaderPolicy.class);
for (NativeLibrary library : libMetaData.getNativeLibraries())
{
final String libpath = library.getLibraryPath();
16 years, 6 months
JBoss-OSGI SVN: r99735 - in projects/jboss-osgi: projects/runtime/framework/trunk/src/etc/osgitck and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-21 07:47:05 -0500 (Thu, 21 Jan 2010)
New Revision: 99735
Modified:
projects/jboss-osgi/projects/bundles/blueprint/trunk/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/projects/runtime/framework/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
Log:
Update deployer config
Modified: projects/jboss-osgi/projects/bundles/blueprint/trunk/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/blueprint/trunk/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-01-21 12:43:05 UTC (rev 99734)
+++ projects/jboss-osgi/projects/bundles/blueprint/trunk/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-01-21 12:47:05 UTC (rev 99735)
@@ -170,15 +170,17 @@
</bean>
<!-- OSGI Deployment -->
- <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiBundleStateAddDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateAddDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
<bean name="OSGiBundleStateRemoveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateRemoveDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
- <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
+ <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiNativeCodeMetaDataDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodeMetaDataDeployer" />
+ <bean name="OSGiNativeCodePolicyDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodePolicyDeployer" />
<!--
********************************
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml 2010-01-21 12:43:05 UTC (rev 99734)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml 2010-01-21 12:47:05 UTC (rev 99735)
@@ -144,16 +144,17 @@
</bean>
<!-- OSGI Deployment -->
- <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiBundleStateAddDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateAddDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
<bean name="OSGiBundleStateRemoveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateRemoveDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
- <bean name="OSGiBundleNativeCodeDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleNativeCodeDeployer" />
- <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
+ <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiNativeCodeMetaDataDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodeMetaDataDeployer" />
+ <bean name="OSGiNativeCodePolicyDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodePolicyDeployer" />
<!--
********************************
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2010-01-21 12:43:05 UTC (rev 99734)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2010-01-21 12:47:05 UTC (rev 99735)
@@ -178,12 +178,18 @@
</constructor>
</bean>
- <bean name="OSGiBundleStructure" class="org.jboss.osgi.deployer.BundleStructureDeployer" />
- <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
- <bean name="OSGiBundleStateDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateDeployer">
+ <!-- OSGI Deployment -->
+ <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
+ <bean name="OSGiBundleStateAddDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateAddDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
- <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
+ <bean name="OSGiBundleStateRemoveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateRemoveDeployer">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
+ <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiNativeCodeMetaDataDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodeMetaDataDeployer" />
+ <bean name="OSGiNativeCodePolicyDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodePolicyDeployer" />
<!--
********************************
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2010-01-21 12:43:05 UTC (rev 99734)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2010-01-21 12:47:05 UTC (rev 99735)
@@ -199,15 +199,17 @@
</bean>
<!-- OSGI Deployment -->
- <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiBundleStateAddDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateAddDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
<bean name="OSGiBundleStateRemoveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateRemoveDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
- <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
+ <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiNativeCodeMetaDataDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodeMetaDataDeployer" />
+ <bean name="OSGiNativeCodePolicyDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodePolicyDeployer" />
<!--
********************************
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-01-21 12:43:05 UTC (rev 99734)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-01-21 12:47:05 UTC (rev 99735)
@@ -182,15 +182,17 @@
</bean>
<!-- OSGI Deployment -->
- <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiBundleStateAddDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateAddDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
<bean name="OSGiBundleStateRemoveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateRemoveDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
- <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
+ <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiNativeCodeMetaDataDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodeMetaDataDeployer" />
+ <bean name="OSGiNativeCodePolicyDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodePolicyDeployer" />
<!--
********************************
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-01-21 12:43:05 UTC (rev 99734)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-01-21 12:47:05 UTC (rev 99735)
@@ -169,15 +169,17 @@
</bean>
<!-- OSGI Deployment -->
- <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiBundleStateAddDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateAddDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
<bean name="OSGiBundleStateRemoveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateRemoveDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
- <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
+ <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiNativeCodeMetaDataDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodeMetaDataDeployer" />
+ <bean name="OSGiNativeCodePolicyDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodePolicyDeployer" />
<!--
********************************
16 years, 6 months
JBoss-OSGI SVN: r99732 - in projects: jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/base and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-21 07:39:50 -0500 (Thu, 21 Jan 2010)
New Revision: 99732
Added:
projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibrary.java
projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibraryMetaData.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodeMetaDataDeployer.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java
Removed:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleNativeCodeDeployer.java
Modified:
projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/ClassLoaderPolicy.java
projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/base/BaseClassLoader.java
projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/ClassLoadingMetaData.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleClassLoader.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiClassLoadingDeployer.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentAttachmentDeployer.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml
Log:
[JBCL-136] Add a notion of native library mapping
Modified: projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/ClassLoaderPolicy.java
===================================================================
--- projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/ClassLoaderPolicy.java 2010-01-21 12:32:09 UTC (rev 99731)
+++ projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/ClassLoaderPolicy.java 2010-01-21 12:39:50 UTC (rev 99732)
@@ -21,6 +21,7 @@
*/
package org.jboss.classloader.spi;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@@ -30,7 +31,9 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.management.MalformedObjectNameException;
@@ -59,8 +62,106 @@
/** The class found handlers */
private List<ClassFoundHandler> classFoundHandlers;
+
+ /** Maps native library to its provider */
+ private Map<String, NativeLibraryProvider> libraryMap;
/**
+ * Provides the actual local file location for a native library
+ */
+ public interface NativeLibraryProvider
+ {
+ /** Get the library path */
+ String getLibraryPath();
+
+ /** Get the local library file location. This may be proved lazily. */
+ File getLibraryLocation() throws IOException;
+ }
+
+ /**
+ * Get the set of registered native library names.
+ *
+ * @return Null if there are no native libraries registered.
+ */
+ public Set<String> getNativeLibraryNames()
+ {
+ if (libraryMap == null)
+ return Collections.emptySet();
+
+ return libraryMap.keySet();
+ }
+
+ /**
+ * Get the native library provider for the given name.
+ *
+ * @param libname The library name
+ * @return Null if there is no library with that name.
+ */
+ public NativeLibraryProvider getNativeLibrary(String libname)
+ {
+ return (libraryMap != null ? libraryMap.get(libname) : null);
+ }
+
+ /**
+ * Add a native library provider.
+ * @param libname The library name
+ * @param provider The library file provider
+ */
+ public void addNativeLibrary(String libname, NativeLibraryProvider provider)
+ {
+ if (libraryMap == null)
+ libraryMap = new ConcurrentHashMap<String, NativeLibraryProvider>();
+
+ libraryMap.put(libname, provider);
+ }
+
+ /**
+ * Remove the native library provider for the given name.
+ *
+ * @param libname The library name
+ * @return Null if there is no library with that name.
+ */
+ public NativeLibraryProvider removeNativeLibrary(String libname)
+ {
+ return (libraryMap != null ? libraryMap.remove(libname) : null);
+ }
+
+ /**
+ * Returns the absolute path name of a native library.
+ *
+ * @see ClassLoader.findLibrary(String libname)
+ * @param libname The library name
+ * @return The absolute path of the native library, or null
+ */
+ public String findLibrary(String libname)
+ {
+ if (libraryMap == null)
+ return null;
+
+ NativeLibraryProvider libProvider = libraryMap.get(libname);
+
+ // [TODO] why does the TCK use 'Native' to mean 'libNative' ?
+ if (libProvider == null)
+ libProvider = libraryMap.get("lib" + libname);
+
+ if (libProvider == null)
+ return null;
+
+ File libfile;
+ try
+ {
+ libfile = libProvider.getLibraryLocation();
+ }
+ catch (IOException ex)
+ {
+ log.error("Cannot privide native library location for: " + libname, ex);
+ return null;
+ }
+
+ return libfile.getAbsolutePath();
+ }
+
+ /**
* Get the delegate loader for exported stuff<p>
*
* By default this uses {@link #getPackageNames()} to create a {@link FilteredDelegateLoader}
Modified: projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/base/BaseClassLoader.java
===================================================================
--- projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/base/BaseClassLoader.java 2010-01-21 12:32:09 UTC (rev 99731)
+++ projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/base/BaseClassLoader.java 2010-01-21 12:39:50 UTC (rev 99732)
@@ -374,6 +374,20 @@
return domain.checkClassCacheAndBlackList(this, name, null, basePolicy.isImportAll(), false);
}
+ @Override
+ protected String findLibrary(String libname)
+ {
+ String libraryPath = null;
+
+ if (policy != null)
+ libraryPath = policy.findLibrary(libname);
+
+ if (libraryPath == null)
+ libraryPath = super.findLibrary(libname);
+
+ return libraryPath;
+ }
+
/**
* Find the classloader for a class but don't load the class
*
Modified: projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/ClassLoadingMetaData.java
===================================================================
--- projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/ClassLoadingMetaData.java 2010-01-21 12:32:09 UTC (rev 99731)
+++ projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/ClassLoadingMetaData.java 2010-01-21 12:39:50 UTC (rev 99732)
@@ -22,6 +22,7 @@
package org.jboss.classloading.spi.metadata;
import java.util.List;
+
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;
@@ -45,7 +46,7 @@
public class ClassLoadingMetaData extends NameAndVersionSupport
{
/** The serialVersionUID */
- private static final long serialVersionUID = -2782951093046585620L;
+ private static final long serialVersionUID = 8525659521747922713L;
/** The classloading domain */
private String domain;
@@ -95,6 +96,9 @@
/** The capabilities */
private CapabilitiesMetaData capabilities = new CapabilitiesMetaData();
+ /** The native code libraries */
+ private NativeLibraryMetaData libraries = new NativeLibraryMetaData();
+
/**
* Get the domain.
*
@@ -485,6 +489,29 @@
}
/**
+ * Get the native libraries.
+ *
+ * @return the native libraries.
+ */
+ public NativeLibraryMetaData getNativeLibraries()
+ {
+ return libraries;
+ }
+
+ /**
+ * Set the native libraries.
+ *
+ * @param native libraries the native libraries.
+ * @throws IllegalArgumentException for null native libraries
+ */
+ public void setNativeLibraries(NativeLibraryMetaData nativeLibraries)
+ {
+ if (nativeLibraries == null)
+ throw new IllegalArgumentException("Null libraries");
+ this.libraries = nativeLibraries;
+ }
+
+ /**
* Set the requirements.
*
* @param requirements the requirements.
@@ -540,6 +567,9 @@
List<Requirement> requirements = getRequirements().getRequirements();
if (requirements != null)
builder.append(" requirements=").append(requirements);
+ List<NativeLibrary> libraries = getNativeLibraries().getNativeLibraries();
+ if (libraries != null)
+ builder.append(" libraries=").append(libraries);
}
@Override
@@ -570,6 +600,8 @@
return false;
if (equals(this.getRequirements().getRequirements(), other.getRequirements().getRequirements()) == false)
return false;
+ if (equals(this.getNativeLibraries().getNativeLibraries(), other.getNativeLibraries().getNativeLibraries()) == false)
+ return false;
return true;
}
@@ -593,6 +625,7 @@
ClassLoadingMetaData clone = (ClassLoadingMetaData) super.clone();
requirements = clone.requirements.clone();
capabilities = clone.capabilities.clone();
+ libraries = clone.libraries.clone();
return clone;
}
}
Added: projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibrary.java
===================================================================
--- projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibrary.java (rev 0)
+++ projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibrary.java 2010-01-21 12:39:50 UTC (rev 99732)
@@ -0,0 +1,141 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.classloading.spi.metadata;
+
+// $Id$
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.classloading.spi.version.VersionRange;
+
+/**
+ * Meta data for native code libraries as defined by OSGi R4V42.
+ *
+ * 3.9 Loading Native Code Libraries
+ * http://www.osgi.org/Download/File?url=/download/r4v42/r4.core.pdf
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @version $Revision$
+ * @since 21-Jan-2010
+ */
+public class NativeLibrary implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 5059911178465658041L;
+
+ private List<String> osNames = new ArrayList<String>();
+ private String librarySource;
+ private String libraryPath;
+ private List<String> processors = new ArrayList<String>();
+ private List<VersionRange> osVersions = new ArrayList<VersionRange>();
+ private List<String> languages = new ArrayList<String>();
+ private String selectionFilter;
+ private boolean optional;
+
+ /**
+ * Create a NativeCode instance with mandatory properties.
+ * @param osNames The set of OS names
+ * @param libraryPath The library path
+ * @param fileProvider An interface from which to retrieve the actual library location
+ */
+ public NativeLibrary(List<String> osNames, String libraryPath, String librarySource)
+ {
+ if (libraryPath == null)
+ throw new IllegalArgumentException("Null library path: " + libraryPath);
+ if (osNames == null || osNames.isEmpty())
+ throw new IllegalArgumentException("Illegal OS names: " + osNames);
+ if (librarySource == null)
+ throw new IllegalArgumentException("Null file privider: " + librarySource);
+
+ this.osNames = osNames;
+ this.libraryPath = libraryPath;
+ this.librarySource = librarySource;
+ }
+
+ public String getLibrarySource()
+ {
+ return librarySource;
+ }
+
+ public String getLibraryPath()
+ {
+ return libraryPath;
+ }
+
+ public List<String> getOsNames()
+ {
+ return Collections.unmodifiableList(osNames);
+ }
+
+ public List<VersionRange> getOsVersions()
+ {
+ return Collections.unmodifiableList(osVersions);
+ }
+
+ public void setOsVersions(List<VersionRange> osVersions)
+ {
+ this.osVersions = osVersions;
+ }
+
+ public List<String> getProcessors()
+ {
+ return Collections.unmodifiableList(processors);
+ }
+
+ public void setProcessors(List<String> processors)
+ {
+ this.processors = processors;
+ }
+
+ public void setLanguages(List<String> languages)
+ {
+ this.languages = languages;
+ }
+
+ public List<String> getLanguages()
+ {
+ return Collections.unmodifiableList(languages);
+ }
+
+ public String getSelectionFilter()
+ {
+ return selectionFilter;
+ }
+
+ public void setSelectionFilter(String selectionFilter)
+ {
+ this.selectionFilter = selectionFilter;
+ }
+
+ public boolean isOptional()
+ {
+ return optional;
+ }
+
+ public void setOptional(boolean optional)
+ {
+ this.optional = optional;
+ }
+}
Property changes on: projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibrary.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibraryMetaData.java
===================================================================
--- projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibraryMetaData.java (rev 0)
+++ projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibraryMetaData.java 2010-01-21 12:39:50 UTC (rev 99732)
@@ -0,0 +1,100 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.classloading.spi.metadata;
+
+// $Id$
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+
+/**
+ * Meta data for native code libraries as defined by OSGi R4V42.
+ *
+ * 3.9 Loading Native Code Libraries
+ * http://www.osgi.org/Download/File?url=/download/r4v42/r4.core.pdf
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @version $Revision$
+ * @since 21-Jan-2010
+ */
+// [TODO] @XmlType(name="nativeLibraries", propOrder={"nativeLibraries"})
+public class NativeLibraryMetaData implements Serializable, Cloneable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 8341019167903636599L;
+
+ /** The nativeLibraries */
+ private List<NativeLibrary> nativeLibraries;
+
+ public List<NativeLibrary> getNativeLibraries()
+ {
+ return nativeLibraries;
+ }
+
+ public void setNativeLibraries(List<NativeLibrary> nativeLibraries)
+ {
+ this.nativeLibraries = nativeLibraries;
+ }
+
+ public void addNativeLibrary(NativeLibrary nativeLibrary)
+ {
+ if (nativeLibrary == null)
+ throw new IllegalArgumentException("Null library");
+
+ if (nativeLibraries == null)
+ nativeLibraries = new CopyOnWriteArrayList<NativeLibrary>();
+
+ nativeLibraries.add(nativeLibrary);
+ }
+
+ public void removeNativeLibrary(NativeLibrary nativeLibrary)
+ {
+ if (nativeLibrary == null)
+ throw new IllegalArgumentException("Null library");
+
+ if (nativeLibraries == null)
+ return;
+
+ nativeLibraries.remove(nativeLibrary);
+ }
+
+ @Override
+ public NativeLibraryMetaData clone()
+ {
+ try
+ {
+ NativeLibraryMetaData clone = (NativeLibraryMetaData) super.clone();
+ if (nativeLibraries != null)
+ {
+ List<NativeLibrary> clonedNativeCodes = new CopyOnWriteArrayList<NativeLibrary>(nativeLibraries);
+ clone.setNativeLibraries(clonedNativeCodes);
+ }
+ return clone;
+ }
+ catch (CloneNotSupportedException e)
+ {
+ throw new RuntimeException("Unexpected", e);
+ }
+ }
+}
Property changes on: projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibraryMetaData.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleClassLoader.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleClassLoader.java 2010-01-21 12:32:09 UTC (rev 99731)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleClassLoader.java 2010-01-21 12:39:50 UTC (rev 99732)
@@ -29,13 +29,12 @@
/**
* An OSGi bundle class loader.
*
- * This implementation supports the notion of OSGi Native Code Libraries.
- *
* @author Thomas.Diesler(a)jboss.com
* @since 19-Dec-2009
*/
public class OSGiBundleClassLoader extends BaseClassLoader
{
+ @SuppressWarnings("unused")
private OSGiClassLoaderPolicy osgiPolicy;
public OSGiBundleClassLoader(ClassLoaderPolicy policy)
@@ -45,18 +44,4 @@
if (policy instanceof OSGiClassLoaderPolicy)
osgiPolicy = (OSGiClassLoaderPolicy)policy;
}
-
- @Override
- protected String findLibrary(String libname)
- {
- String libraryPath = null;
-
- if (osgiPolicy != null)
- libraryPath = osgiPolicy.findLibrary(libname);
-
- if (libraryPath == null)
- libraryPath = super.findLibrary(libname);
-
- return libraryPath;
- }
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java 2010-01-21 12:32:09 UTC (rev 99731)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java 2010-01-21 12:39:50 UTC (rev 99732)
@@ -23,10 +23,6 @@
// $Id$
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
import org.jboss.classloading.spi.dependency.Module;
import org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy;
import org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule;
@@ -37,17 +33,11 @@
/**
* The ClassLoaderPolicy for OSGi bundles.
*
- * This implementation supports the notion of OSGi Native Code Libraries.
- *
* @author Thomas.Diesler(a)jboss.com
* @since 11-Sep-2209
*/
public class OSGiClassLoaderPolicy extends VFSClassLoaderPolicy
{
- // Maps the lib name to native code archive
- // https://jira.jboss.org/jira/browse/JBCL-136
- private Map<String, File> libraryMap;
-
public OSGiClassLoaderPolicy(AbstractBundleState bundleState, VirtualFile[] roots)
{
super(roots);
@@ -75,26 +65,4 @@
setDelegates(vfsModule.getDelegates());
}
}
-
- public void addLibraryMapping(String libname, File libfile)
- {
- if (libraryMap == null)
- libraryMap = new HashMap<String, File>();
-
- libraryMap.put(libname, libfile);
- }
-
- public String findLibrary(String libname)
- {
- if (libraryMap == null)
- return null;
-
- File libfile = libraryMap.get(libname);
-
- // [TODO] why does the TCK use 'Native' to mean 'libNative' ?
- if (libfile == null)
- libfile = libraryMap.get("lib" + libname);
-
- return (libfile != null ? libfile.getAbsolutePath() : null);
- }
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiClassLoadingDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiClassLoadingDeployer.java 2010-01-21 12:32:09 UTC (rev 99731)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiClassLoadingDeployer.java 2010-01-21 12:39:50 UTC (rev 99732)
@@ -99,6 +99,7 @@
OSGiBundleCapability bundleCapability = OSGiBundleCapability.create(bundleState);
capabilities.addCapability(bundleCapability);
+ // Required Bundles
List<ParameterizedAttribute> requireBundles = osgiMetaData.getRequireBundles();
if (requireBundles != null && requireBundles.isEmpty() == false)
{
@@ -109,6 +110,7 @@
}
}
+ // Export Packages
List<PackageAttribute> exported = osgiMetaData.getExportPackages();
if (exported != null && exported.isEmpty() == false)
{
@@ -119,6 +121,7 @@
}
}
+ // Import Packages
List<PackageAttribute> imported = osgiMetaData.getImportPackages();
if (imported != null && imported.isEmpty() == false)
{
Deleted: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleNativeCodeDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleNativeCodeDeployer.java 2010-01-21 12:32:09 UTC (rev 99731)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleNativeCodeDeployer.java 2010-01-21 12:39:50 UTC (rev 99732)
@@ -1,238 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.framework.deployers;
-
-// $Id: $
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.classloader.spi.ClassLoaderPolicy;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
-import org.jboss.deployers.structure.spi.ClassLoaderFactory;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.osgi.framework.bundle.AbstractBundleState;
-import org.jboss.osgi.framework.bundle.AbstractDeployedBundleState;
-import org.jboss.osgi.framework.bundle.OSGiBundleManager;
-import org.jboss.osgi.framework.bundle.OSGiBundleState;
-import org.jboss.osgi.framework.classloading.OSGiClassLoaderPolicy;
-import org.jboss.osgi.framework.metadata.OSGiMetaData;
-import org.jboss.osgi.framework.metadata.Parameter;
-import org.jboss.osgi.framework.metadata.ParameterizedAttribute;
-import org.jboss.osgi.framework.plugins.BundleStoragePlugin;
-import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.VirtualFile;
-import org.osgi.framework.Constants;
-
-/**
- * A deployer that takes care of loading native code libraries.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 19-Dec-2009
- */
-public class OSGiBundleNativeCodeDeployer extends AbstractRealDeployer
-{
- // Provide logging
- private static final Logger log = Logger.getLogger(OSGiBundleNativeCodeDeployer.class);
-
- /** Maps an alias to an OSGi processor name */
- private static Map<String, String> processorAlias = new HashMap<String, String>();
- static
- {
- processorAlias.put("pentium", "x86");
- processorAlias.put("i386", "x86");
- processorAlias.put("i486", "x86");
- processorAlias.put("i586", "x86");
- processorAlias.put("i686", "x86");
- processorAlias.put("amd64", "x86-64");
- processorAlias.put("em64t", "x86-64");
- processorAlias.put("x86_64", "x86-64");
- }
-
- /** Maps an alias to an OSGi osname */
- private static Map<String, String> osAlias = new HashMap<String, String>();
- static
- {
- osAlias.put("SymbianOS", "Epoc32");
- osAlias.put("hp-ux", "HPUX");
- osAlias.put("Mac OS", "MacOS");
- osAlias.put("Mac OS X", "MacOSX");
- osAlias.put("OS/2", "OS2");
- osAlias.put("procnto", "QNX");
- osAlias.put("Win95", "Windows95");
- osAlias.put("Windows 95", "Windows95");
- osAlias.put("Win32", "Windows95");
- osAlias.put("Win98", "Windows98");
- osAlias.put("Windows 98", "Windows98");
- osAlias.put("Win32", "Windows98");
- osAlias.put("WinNT", "WindowsNT");
- osAlias.put("Windows NT", "WindowsNT");
- osAlias.put("Win32", "WindowsNT");
- osAlias.put("WinCE", "WindowsCE");
- osAlias.put("Windows CE", "WindowsCE");
- osAlias.put("Win2000", "Windows2000");
- osAlias.put("Windows 2000", "Windows2000");
- osAlias.put("Win32", "Windows2000");
- osAlias.put("Win2003", "Windows2003");
- osAlias.put("Windows 2003", "Windows2003");
- osAlias.put("Win32", "Windows2003");
- osAlias.put("Windows Server 2003", "Windows2003");
- osAlias.put("WinXP", "WindowsXP");
- osAlias.put("Windows XP", "WindowsXP");
- osAlias.put("Win32", "WindowsXP");
- osAlias.put("WinVista", "WindowsVista");
- osAlias.put("Windows Vista", "WindowsVista");
- osAlias.put("Win32", "WindowsVista");
- }
-
- public OSGiBundleNativeCodeDeployer()
- {
- setInput(ClassLoaderFactory.class);
- addInput(ClassLoaderPolicy.class);
- addInput(OSGiBundleState.class);
- setStage(DeploymentStages.CLASSLOADER);
- setTopLevelOnly(true);
- }
-
- @Override
- protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
- {
- AbstractBundleState absBundleState = unit.getAttachment(AbstractBundleState.class);
- if (absBundleState == null)
- throw new IllegalStateException("No bundle state");
-
- if ((absBundleState instanceof OSGiBundleState) == false)
- return;
-
- AbstractDeployedBundleState bundleState = (AbstractDeployedBundleState)absBundleState;
- OSGiMetaData osgiMetaData = bundleState.getOSGiMetaData();
- List<ParameterizedAttribute> nativeCodeParams = osgiMetaData.getBundleNativeCode();
- if (nativeCodeParams == null)
- return;
-
- OSGiBundleManager bundleManager = bundleState.getBundleManager();
- String fwOSName = bundleManager.getProperty(Constants.FRAMEWORK_OS_NAME);
- String fwProcessor = bundleManager.getProperty(Constants.FRAMEWORK_PROCESSOR);
- //String fwOSVersion = bundleManager.getProperty(Constants.FRAMEWORK_OS_VERSION);
-
- List<ParameterizedAttribute> matchedParams = new ArrayList<ParameterizedAttribute>();
- for (ParameterizedAttribute param : nativeCodeParams)
- {
- // Only select the native code clauses for which the following expressions all evaluate to true
- // * osname ~= [org.osgi.framework.os.name]
- // * processor ~= [org.osgi.framework.processor]
- // * osversion range includes [org.osgi.framework.os.version] or osversion is not specified
- // * language ~= [org.osgi.framework.language] or language is not specified
- // * selection-filter evaluates to true when using the values of the system properties or selection-filter is not specified
-
- Parameter osnameParam = param.getAttribute(Constants.BUNDLE_NATIVECODE_OSNAME);
- Parameter procParam = param.getAttribute(Constants.BUNDLE_NATIVECODE_PROCESSOR);
- //Parameter osversionParam = param.getAttribute(Constants.BUNDLE_NATIVECODE_OSVERSION);
-
- boolean match = (osnameParam != null);
-
- // osname ~= [org.osgi.framework.os.name]
- if (match && osnameParam != null)
- {
- String osname = (String)osnameParam.getValue();
- match = (osname.equals(fwOSName) || osname.equals(osAlias.get(fwOSName)));
- }
-
- // processor ~= [org.osgi.framework.processor]
- match &= (procParam != null);
- if (match && procParam != null)
- {
- String processor = (String)procParam.getValue();
- match = (processor.equals(fwProcessor) || processor.equals(processorAlias.get(fwProcessor)));
- }
-
- // [TODO] osversion range includes [org.osgi.framework.os.version] or osversion is not specified
- // [TODO] language ~= [org.osgi.framework.language] or language is not specified
- // [TODO] selection-filter evaluates to true when using the values of the system properties or selection-filter is not specified
-
- if (match == true)
- matchedParams.add(param);
- }
-
- // If no native clauses were selected in step 1, this algorithm is terminated
- // and a BundleException is thrown if the optional clause is not present
- if (matchedParams.size() == 0)
- {
- // [TODO] optional
- throw new DeploymentException("No native clauses selected from: " + nativeCodeParams);
- }
-
- // The selected clauses are now sorted in the following priority order:
- // * osversion: floor of the osversion range in descending order, osversion not specified
- // * language: language specified, language not specified
- // * Position in the Bundle-NativeCode manifest header: lexical left to right
- if (matchedParams.size() > 1)
- {
- // [TODO] selected clauses are now sorted
- }
-
- // The first clause of the sorted clauses from step 3 must be used as the selected native code clause
- ParameterizedAttribute selectedParams = matchedParams.get(0);
- log.debug("Selected native code clause: " + selectedParams);
-
- String nativeLib = selectedParams.getAttribute();
- URL entryURL = bundleState.getEntry(nativeLib);
-
- // If a native code library in a selected native code clause cannot be found
- // within the bundle then the bundle must fail to resolve
- if (entryURL == null)
- throw new DeploymentException("Cannot find native library: " + nativeLib);
-
- // Copy the native library to the bundle storage area
- File nativeFileCopy;
- try
- {
- VirtualFile nativeVirtualFile = bundleState.getRoot().getChild(nativeLib);
- BundleStoragePlugin plugin = bundleManager.getPlugin(BundleStoragePlugin.class);
- nativeFileCopy = plugin.getDataFile(bundleState, nativeLib);
- FileOutputStream fos = new FileOutputStream(nativeFileCopy);
- VFSUtils.copyStream(nativeVirtualFile.openStream(), fos);
- fos.close();
- }
- catch (IOException ex)
- {
- throw new DeploymentException("Cannot copy native library: " + nativeLib, ex);
- }
-
- // Generate the key for the library mapping
- String libfile = new File(nativeLib).getName();
- String libname = libfile.substring(0, libfile.lastIndexOf('.'));
-
- // Add the native library mapping to the OSGiClassLoaderPolicy
- OSGiClassLoaderPolicy policy = (OSGiClassLoaderPolicy)unit.getAttachment(ClassLoaderPolicy.class);
- policy.addLibraryMapping(libname, nativeFileCopy);
- }
-}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentAttachmentDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentAttachmentDeployer.java 2010-01-21 12:32:09 UTC (rev 99731)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentAttachmentDeployer.java 2010-01-21 12:39:50 UTC (rev 99732)
@@ -25,6 +25,7 @@
import org.jboss.classloader.spi.ClassLoaderPolicy;
import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentStages;
import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
@@ -33,7 +34,6 @@
import org.jboss.osgi.framework.bundle.OSGiBundleManager;
import org.jboss.osgi.framework.bundle.OSGiBundleState;
import org.jboss.osgi.framework.bundle.OSGiFragmentState;
-import org.jboss.osgi.framework.classloading.OSGiClassLoaderPolicy;
import org.osgi.framework.Bundle;
/**
@@ -89,7 +89,7 @@
OSGiFragmentState fragState = (OSGiFragmentState)absBundleState;
OSGiBundleState hostState = fragState.getFragmentHost();
DeploymentUnit hostUnit = hostState.getDeploymentUnit();
- OSGiClassLoaderPolicy hostPolicy = (OSGiClassLoaderPolicy)hostUnit.getAttachment(ClassLoaderPolicy.class);
+ VFSClassLoaderPolicy hostPolicy = (VFSClassLoaderPolicy)hostUnit.getAttachment(ClassLoaderPolicy.class);
hostPolicy.attachFragment(fragState.getRoot());
}
}
Added: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodeMetaDataDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodeMetaDataDeployer.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodeMetaDataDeployer.java 2010-01-21 12:39:50 UTC (rev 99732)
@@ -0,0 +1,265 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.framework.deployers;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.classloading.spi.metadata.NativeLibrary;
+import org.jboss.classloading.spi.metadata.NativeLibraryMetaData;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.framework.bundle.AbstractBundleState;
+import org.jboss.osgi.framework.bundle.OSGiBundleManager;
+import org.jboss.osgi.framework.bundle.OSGiBundleState;
+import org.jboss.osgi.framework.metadata.OSGiMetaData;
+import org.jboss.osgi.framework.metadata.Parameter;
+import org.jboss.osgi.framework.metadata.ParameterizedAttribute;
+import org.osgi.framework.Constants;
+
+/**
+ * A deployer that takes care of loading native code libraries.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 19-Dec-2009
+ */
+public class OSGiNativeCodeMetaDataDeployer extends AbstractRealDeployer
+{
+ /** Maps an alias to an OSGi processor name */
+ private static Map<String, String> processorAlias = new HashMap<String, String>();
+ static
+ {
+ processorAlias.put("pentium", "x86");
+ processorAlias.put("i386", "x86");
+ processorAlias.put("i486", "x86");
+ processorAlias.put("i586", "x86");
+ processorAlias.put("i686", "x86");
+ processorAlias.put("amd64", "x86-64");
+ processorAlias.put("em64t", "x86-64");
+ processorAlias.put("x86_64", "x86-64");
+ }
+
+ /** Maps an alias to an OSGi osname */
+ private static Map<String, String> osAlias = new HashMap<String, String>();
+ static
+ {
+ osAlias.put("SymbianOS", "Epoc32");
+ osAlias.put("hp-ux", "HPUX");
+ osAlias.put("Mac OS", "MacOS");
+ osAlias.put("Mac OS X", "MacOSX");
+ osAlias.put("OS/2", "OS2");
+ osAlias.put("procnto", "QNX");
+ osAlias.put("Win95", "Windows95");
+ osAlias.put("Windows 95", "Windows95");
+ osAlias.put("Win32", "Windows95");
+ osAlias.put("Win98", "Windows98");
+ osAlias.put("Windows 98", "Windows98");
+ osAlias.put("Win32", "Windows98");
+ osAlias.put("WinNT", "WindowsNT");
+ osAlias.put("Windows NT", "WindowsNT");
+ osAlias.put("Win32", "WindowsNT");
+ osAlias.put("WinCE", "WindowsCE");
+ osAlias.put("Windows CE", "WindowsCE");
+ osAlias.put("Win2000", "Windows2000");
+ osAlias.put("Windows 2000", "Windows2000");
+ osAlias.put("Win32", "Windows2000");
+ osAlias.put("Win2003", "Windows2003");
+ osAlias.put("Windows 2003", "Windows2003");
+ osAlias.put("Win32", "Windows2003");
+ osAlias.put("Windows Server 2003", "Windows2003");
+ osAlias.put("WinXP", "WindowsXP");
+ osAlias.put("Windows XP", "WindowsXP");
+ osAlias.put("Win32", "WindowsXP");
+ osAlias.put("WinVista", "WindowsVista");
+ osAlias.put("Windows Vista", "WindowsVista");
+ osAlias.put("Win32", "WindowsVista");
+ }
+
+ public OSGiNativeCodeMetaDataDeployer()
+ {
+ setInput(ClassLoadingMetaData.class);
+ setStage(DeploymentStages.POST_PARSE);
+ setTopLevelOnly(true);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
+ {
+ ClassLoadingMetaData classLoadingMetaData = unit.getAttachment(ClassLoadingMetaData.class);
+ if (classLoadingMetaData == null)
+ throw new IllegalStateException("No ClassLoadingMetaData");
+
+ AbstractBundleState absBundleState = unit.getAttachment(AbstractBundleState.class);
+ if (absBundleState == null)
+ throw new IllegalStateException("No AbstractBundleState");
+
+ if ((absBundleState instanceof OSGiBundleState) == false)
+ return;
+
+ OSGiBundleState bundleState = (OSGiBundleState)absBundleState;
+ OSGiBundleManager bundleManager = bundleState.getBundleManager();
+ OSGiMetaData osgiMetaData = bundleState.getOSGiMetaData();
+ List<ParameterizedAttribute> nativeCodeParams = osgiMetaData.getBundleNativeCode();
+ if (nativeCodeParams == null)
+ return;
+
+ // Find the matching parameters
+ List<ParameterizedAttribute> matchedParams = new ArrayList<ParameterizedAttribute>();
+ for (ParameterizedAttribute param : nativeCodeParams)
+ {
+ if (matchParameter(bundleManager, param))
+ matchedParams.add(param);
+ }
+
+ // If no native clauses were selected in step 1, this algorithm is terminated
+ // and a BundleException is thrown if the optional clause is not present
+ if (matchedParams.size() == 0)
+ {
+ // [TODO] optional
+ throw new DeploymentException("No native clauses selected from: " + nativeCodeParams);
+ }
+
+ // The selected clauses are now sorted in the following priority order:
+ // * osversion: floor of the osversion range in descending order, osversion not specified
+ // * language: language specified, language not specified
+ // * Position in the Bundle-NativeCode manifest header: lexical left to right
+ if (matchedParams.size() > 1)
+ {
+ // [TODO] selected clauses are now sorted
+ }
+
+ NativeLibraryMetaData nativeLibraries = classLoadingMetaData.getNativeLibraries();
+ for (ParameterizedAttribute param : matchedParams)
+ {
+ Parameter osnameParam = param.getAttribute(Constants.BUNDLE_NATIVECODE_OSNAME);
+ Parameter procParam = param.getAttribute(Constants.BUNDLE_NATIVECODE_PROCESSOR);
+ //Parameter osversionParam = param.getAttribute(Constants.BUNDLE_NATIVECODE_OSVERSION);
+
+ List<String> osNames;
+ if (osnameParam.isCollection())
+ osNames = (List<String>)osnameParam.getValue();
+ else
+ osNames = Collections.singletonList((String)osnameParam.getValue());
+
+ String libpath = param.getAttribute();
+ String libsource = bundleState.getCanonicalName();
+
+ NativeLibrary library = new NativeLibrary(osNames, libpath, libsource);
+
+ // Processors
+ if (procParam != null)
+ {
+ List<String> processors;
+ if (procParam.isCollection())
+ processors = (List<String>)procParam.getValue();
+ else
+ processors = Collections.singletonList((String)procParam.getValue());
+
+ library.setProcessors(processors);
+ }
+
+ // [TODO] osVersions, languages, selectionFilter, optional
+ // library.setOsVersions(osVersions);
+ // library.setLanguages(languages);
+ // library.setSelectionFilter(selectionFilter);
+ // library.setOptional(optional);
+
+ nativeLibraries.addNativeLibrary(library);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private boolean matchParameter(OSGiBundleManager bundleManager, ParameterizedAttribute param)
+ {
+ String fwOSName = bundleManager.getProperty(Constants.FRAMEWORK_OS_NAME);
+ String fwProcessor = bundleManager.getProperty(Constants.FRAMEWORK_PROCESSOR);
+ //String fwOSVersion = bundleManager.getProperty(Constants.FRAMEWORK_OS_VERSION);
+
+ // Only select the native code clauses for which the following expressions all evaluate to true
+ // * osname ~= [org.osgi.framework.os.name]
+ // * processor ~= [org.osgi.framework.processor]
+ // * osversion range includes [org.osgi.framework.os.version] or osversion is not specified
+ // * language ~= [org.osgi.framework.language] or language is not specified
+ // * selection-filter evaluates to true when using the values of the system properties or selection-filter is not specified
+
+ Parameter osnameParam = param.getAttribute(Constants.BUNDLE_NATIVECODE_OSNAME);
+ Parameter procParam = param.getAttribute(Constants.BUNDLE_NATIVECODE_PROCESSOR);
+ //Parameter osversionParam = param.getAttribute(Constants.BUNDLE_NATIVECODE_OSVERSION);
+
+ boolean match = (osnameParam != null);
+
+ // osname ~= [org.osgi.framework.os.name]
+ if (match == true && osnameParam != null)
+ {
+ List<String> osNames;
+ if (osnameParam.isCollection())
+ osNames = (List<String>)osnameParam.getValue();
+ else
+ osNames = Collections.singletonList((String)osnameParam.getValue());
+
+ boolean osmatch = false;
+ for (String osname : osNames)
+ {
+ osmatch = (osname.equals(fwOSName) || osname.equals(osAlias.get(fwOSName)));
+ if (osmatch == true)
+ break;
+ }
+
+ match &= osmatch;
+ }
+
+ // processor ~= [org.osgi.framework.processor]
+ match &= (procParam != null);
+ if (match && procParam != null)
+ {
+ List<String> processors;
+ if (procParam.isCollection())
+ processors = (List<String>)procParam.getValue();
+ else
+ processors = Collections.singletonList((String)procParam.getValue());
+
+ boolean procmatch = false;
+ for (String proc : processors)
+ {
+ procmatch = (proc.equals(fwProcessor) || proc.equals(processorAlias.get(fwProcessor)));
+ if (procmatch == true)
+ break;
+ }
+
+ match &= procmatch;
+ }
+
+ // [TODO] osversion range includes [org.osgi.framework.os.version] or osversion is not specified
+ // [TODO] language ~= [org.osgi.framework.language] or language is not specified
+ // [TODO] selection-filter evaluates to true when using the values of the system properties or selection-filter is not specified
+ return match;
+ }
+}
Property changes on: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodeMetaDataDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java (from rev 99715, projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleNativeCodeDeployer.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java 2010-01-21 12:39:50 UTC (rev 99732)
@@ -0,0 +1,124 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.framework.deployers;
+
+// $Id: $
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.classloader.spi.ClassLoaderPolicy;
+import org.jboss.classloader.spi.ClassLoaderPolicy.NativeLibraryProvider;
+import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.classloading.spi.metadata.NativeLibrary;
+import org.jboss.classloading.spi.metadata.NativeLibraryMetaData;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
+import org.jboss.deployers.structure.spi.ClassLoaderFactory;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.framework.bundle.AbstractBundleState;
+import org.jboss.osgi.framework.bundle.OSGiBundleManager;
+import org.jboss.osgi.framework.bundle.OSGiBundleState;
+import org.jboss.osgi.framework.plugins.BundleStoragePlugin;
+import org.jboss.virtual.VFSUtils;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * A deployer that takes care of loading native code libraries.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 19-Dec-2009
+ */
+public class OSGiNativeCodePolicyDeployer extends AbstractRealDeployer
+{
+ public OSGiNativeCodePolicyDeployer()
+ {
+ setInput(ClassLoaderFactory.class);
+ addInput(ClassLoaderPolicy.class);
+ addInput(OSGiBundleState.class);
+ setStage(DeploymentStages.CLASSLOADER);
+ setTopLevelOnly(true);
+ }
+
+ @Override
+ protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
+ {
+ AbstractBundleState absBundleState = unit.getAttachment(AbstractBundleState.class);
+ if (absBundleState == null)
+ throw new IllegalStateException("No bundle state");
+
+ ClassLoadingMetaData classLoadingMetaData = unit.getAttachment(ClassLoadingMetaData.class);
+ NativeLibraryMetaData libMetaData = classLoadingMetaData.getNativeLibraries();
+ if (libMetaData == null || libMetaData.getNativeLibraries() == null)
+ return;
+
+ final OSGiBundleState bundleState = (OSGiBundleState)absBundleState;
+ final OSGiBundleManager bundleManager = bundleState.getBundleManager();
+
+ // Add the native library mappings to the OSGiClassLoaderPolicy
+ ClassLoaderPolicy policy = (ClassLoaderPolicy)unit.getAttachment(ClassLoaderPolicy.class);
+ for (NativeLibrary library : libMetaData.getNativeLibraries())
+ {
+ final String libpath = library.getLibraryPath();
+
+ NativeLibraryProvider provider = new NativeLibraryProvider()
+ {
+ private File libraryFile;
+
+ public String getLibraryPath()
+ {
+ return libpath;
+ }
+
+ public File getLibraryLocation() throws IOException
+ {
+ if (libraryFile == null)
+ {
+ URL entryURL = bundleState.getEntry(libpath);
+
+ // If a native code library in a selected native code clause cannot be found
+ // within the bundle then the bundle must fail to resolve
+ if (entryURL == null)
+ throw new IOException("Cannot find native library: " + libpath);
+
+ // Copy the native library to the bundle storage area
+ VirtualFile nativeVirtualFile = bundleState.getRoot().getChild(libpath);
+ BundleStoragePlugin plugin = bundleManager.getPlugin(BundleStoragePlugin.class);
+ libraryFile = plugin.getDataFile(bundleState, libpath);
+ FileOutputStream fos = new FileOutputStream(libraryFile);
+ VFSUtils.copyStream(nativeVirtualFile.openStream(), fos);
+ fos.close();
+ }
+ return libraryFile;
+ }
+ };
+
+ // Add the library provider to the policy
+ String libfile = new File(libpath).getName();
+ String libname = libfile.substring(0, libfile.lastIndexOf('.'));
+ policy.addNativeLibrary(libname, provider);
+ }
+ }
+}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml 2010-01-21 12:32:09 UTC (rev 99731)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml 2010-01-21 12:39:50 UTC (rev 99732)
@@ -143,16 +143,17 @@
</bean>
<!-- OSGI Deployment -->
- <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiBundleStateAddDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateAddDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
<bean name="OSGiBundleStateRemoveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateRemoveDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
- <bean name="OSGiBundleNativeCodeDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleNativeCodeDeployer" />
- <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
+ <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiNativeCodeMetaDataDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodeMetaDataDeployer" />
+ <bean name="OSGiNativeCodePolicyDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodePolicyDeployer" />
<!--
********************************
16 years, 6 months
JBoss-OSGI SVN: r99718 - in projects/jboss-osgi: trunk/distribution and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-21 03:58:39 -0500 (Thu, 21 Jan 2010)
New Revision: 99718
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java
projects/jboss-osgi/trunk/distribution/pom.xml
projects/jboss-osgi/trunk/testsuite/example/pom.xml
Log:
Enable blueprint examples in remote runtime
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java 2010-01-21 07:10:11 UTC (rev 99717)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java 2010-01-21 08:58:39 UTC (rev 99718)
@@ -153,7 +153,7 @@
}
public abstract boolean isFragment();
-
+
public Map<X509Certificate, List<X509Certificate>> getSignerCertificates(int signersType)
{
throw new NotImplementedException();
@@ -268,7 +268,7 @@
// Get the resource bundle URL for the given base and locale
URL entryURL = getLocalizationEntryPath(baseName, locale);
-
+
// If the specified locale entry could not be found fall back to the default locale entry
if (entryURL == null)
{
@@ -289,7 +289,7 @@
throw new IllegalStateException("Cannot read resouce bundle: " + entryURL, ex);
}
}
-
+
Dictionary<String, String> locHeaders = new Hashtable<String, String>();
Enumeration<String> e = rawHeaders.keys();
while (e.hasMoreElements())
@@ -298,7 +298,7 @@
String value = rawHeaders.get(key);
if (value.startsWith("%"))
value = value.substring(1);
-
+
if (resBundle != null)
{
try
@@ -310,7 +310,7 @@
// ignore
}
}
-
+
locHeaders.put(key, value);
}
@@ -324,14 +324,14 @@
// appending the .properties suffix. If a translation is not found, the locale
// must be made more generic by first removing the variant, then the country
// and finally the language until an entry is found that contains a valid translation.
-
+
String entryPath = baseName + "_" + locale + ".properties";
URL entryURL = getEntryInternal(entryPath);
while (entryURL == null)
{
if (entryPath.equals(baseName + ".properties"))
break;
-
+
int lastIndex = locale.lastIndexOf('_');
if (lastIndex > 0)
{
@@ -342,7 +342,7 @@
{
entryPath = baseName + ".properties";
}
-
+
// The bundle's class loader is not used to search for localization entries. Only
// the contents of the bundle and its attached fragments are searched.
entryURL = getEntryInternal(entryPath);
@@ -537,7 +537,7 @@
protected void beforeServiceUnregistration(OSGiServiceState service)
{
}
-
+
boolean ungetContext(ControllerContext context)
{
return removeContextInUse(context);
@@ -656,14 +656,7 @@
public Object getSource(String className)
{
// [TODO] some more efficient way than using the class?
- try
- {
- return loadClass(className);
- }
- catch (ClassNotFoundException e)
- {
- return null;
- }
+ return getBundleManager().loadClassFailsafe(this, className);
}
/**
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2010-01-21 07:10:11 UTC (rev 99717)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2010-01-21 08:58:39 UTC (rev 99718)
@@ -328,6 +328,16 @@
</dependency>
<!-- jboss-osgi-runtime-jbossas: no javadoc -->
+ <!-- Aries Dependencies -->
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries</groupId>
+ <artifactId>org.apache.aries.util</artifactId>
+ </dependency>
+
<!-- Equinox Dependencies -->
<dependency>
<groupId>org.jboss.osgi.runtime</groupId>
Modified: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml 2010-01-21 07:10:11 UTC (rev 99717)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml 2010-01-21 08:58:39 UTC (rev 99718)
@@ -185,7 +185,6 @@
<!-- [JBOSGI-236] XML Binding example fails in JBossAS -->
<exclude>org/jboss/test/osgi/example/xml/jbossxb/**</exclude>
<!-- Functionality not supported in Equinox -->
- <exclude>org/jboss/test/osgi/example/blueprint/**</exclude>
<exclude>org/jboss/test/osgi/example/interceptor/**</exclude>
<exclude>org/jboss/test/osgi/example/microcontainer/**</exclude>
<exclude>org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.class</exclude>
@@ -237,11 +236,10 @@
<excludes>
<exclude>${target.container.excludes}</exclude>
<!-- https://issues.apache.org/jira/browse/FELIX-1804 -->
- <exclude>org/jboss/test/osgi/example/interceptor/**</exclude>
<exclude>org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.class</exclude>
<exclude>org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.class</exclude>
<!-- Functionality not supported in Felix -->
- <exclude>org/jboss/test/osgi/example/blueprint/**</exclude>
+ <exclude>org/jboss/test/osgi/example/interceptor/**</exclude>
<exclude>org/jboss/test/osgi/example/microcontainer/**</exclude>
</excludes>
</configuration>
16 years, 6 months
JBoss-OSGI SVN: r99664 - in projects/jboss-osgi: trunk/reactor and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-20 10:36:47 -0500 (Wed, 20 Jan 2010)
New Revision: 99664
Added:
projects/jboss-osgi/projects/bundles/blueprint/trunk/
Removed:
projects/jboss-osgi/trunk/reactor/blueprint/
Log:
Externalize blueprint
Copied: projects/jboss-osgi/projects/bundles/blueprint/trunk (from rev 99663, projects/jboss-osgi/trunk/reactor/blueprint)
16 years, 6 months
JBoss-OSGI SVN: r99662 - in projects/jboss-osgi/trunk: reactor and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-20 10:34:30 -0500 (Wed, 20 Jan 2010)
New Revision: 99662
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
projects/jboss-osgi/trunk/reactor/pom.xml
Log:
Externalize blueprint
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2010-01-20 15:10:45 UTC (rev 99661)
+++ projects/jboss-osgi/trunk/pom.xml 2010-01-20 15:34:30 UTC (rev 99662)
@@ -53,7 +53,7 @@
<version.apache.felix.metatype>1.0.2</version.apache.felix.metatype>
<version.izpack>4.3.1</version.izpack>
<version.jboss.osgi.apache.xerces>2.9.1.SP3</version.jboss.osgi.apache.xerces>
- <version.jboss.osgi.blueprint>1.0.0.Beta1</version.jboss.osgi.blueprint>
+ <version.jboss.osgi.blueprint>1.0.0.Beta1-SNAPSHOT</version.jboss.osgi.blueprint>
<version.jboss.osgi.common>1.0.3</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
<version.jboss.osgi.deployment>1.0.1-SNAPSHOT</version.jboss.osgi.deployment>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2010-01-20 15:10:45 UTC (rev 99661)
+++ projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2010-01-20 15:34:30 UTC (rev 99662)
@@ -20,18 +20,27 @@
<artifactId>jboss-osgi-blueprint</artifactId>
<packaging>bundle</packaging>
- <version>1.0.0.Beta1</version>
+ <version>1.0.0.Beta1-SNAPSHOT</version>
<!-- Parent -->
<parent>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi</artifactId>
- <version>1.0.0.Beta6</version>
- <relativePath>../../pom.xml</relativePath>
+ <artifactId>jboss-osgi-parent</artifactId>
+ <version>1.0.4</version>
</parent>
<!-- Properties -->
<properties>
+ <version.apache.aries.blueprint>1.0.0.20100120</version.apache.aries.blueprint>
+ <version.apache.aries.util>1.0.0.20100120</version.apache.aries.util>
+ <version.jboss.osgi.common>1.0.3</version.jboss.osgi.common>
+ <version.jboss.osgi.framework>1.0.0-SNAPSHOT</version.jboss.osgi.framework>
+ <version.jboss.osgi.husky>1.0.3-SNAPSHOT</version.jboss.osgi.husky>
+ <version.jboss.osgi.jmx>1.0.3-SNAPSHOT</version.jboss.osgi.jmx>
+ <version.jboss.osgi.spi>1.0.4-SNAPSHOT</version.jboss.osgi.spi>
+ <version.osgi>4.2.0</version.osgi>
+
+ <surefire.jpda.args></surefire.jpda.args>
</properties>
<!-- Dependencies -->
@@ -41,35 +50,48 @@
<artifactId>bnd</artifactId>
</dependency>
+ <!-- Compile Dependencies -->
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ <version>${version.jboss.osgi.spi}</version>
+ </dependency>
+
<!-- Provided Dependencies -->
<dependency>
<groupId>org.apache.aries.blueprint</groupId>
<artifactId>org.apache.aries.blueprint</artifactId>
+ <version>${version.apache.aries.blueprint}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.aries</groupId>
<artifactId>org.apache.aries.util</artifactId>
+ <version>${version.apache.aries.util}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-common</artifactId>
+ <version>${version.jboss.osgi.common}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-husky</artifactId>
+ <version>${version.jboss.osgi.husky}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-jmx</artifactId>
+ <version>${version.jboss.osgi.jmx}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.osgi.runtime</groupId>
<artifactId>jboss-osgi-framework</artifactId>
+ <version>${version.jboss.osgi.framework}</version>
<scope>provided</scope>
</dependency>
@@ -77,11 +99,13 @@
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
+ <version>${version.osgi}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
+ <version>${version.osgi}</version>
<scope>provided</scope>
</dependency>
@@ -288,6 +312,22 @@
</build>
</profile>
+ <!--
+ Name: jpda
+ Descr: Enable JPDA remote debuging
+ -->
+ <profile>
+ <id>jpda</id>
+ <activation>
+ <property>
+ <name>jpda</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jpda.args>-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</surefire.jpda.args>
+ </properties>
+ </profile>
+
</profiles>
</project>
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2010-01-20 15:10:45 UTC (rev 99661)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2010-01-20 15:34:30 UTC (rev 99662)
@@ -40,10 +40,6 @@
<version>1.0.0.Beta6</version>
</parent>
- <modules>
- <module>blueprint</module>
- </modules>
-
<!-- Profiles -->
<profiles>
16 years, 6 months
JBoss-OSGI SVN: r99660 - in projects/jboss-osgi/trunk: reactor/blueprint and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-20 09:49:31 -0500 (Wed, 20 Jan 2010)
New Revision: 99660
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml
Log:
[JBOSGI-263] Integrate Aries Blueprint implementation
org.apache.aries.blueprint-1.0.0.20100120
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2010-01-20 14:43:05 UTC (rev 99659)
+++ projects/jboss-osgi/trunk/pom.xml 2010-01-20 14:49:31 UTC (rev 99660)
@@ -44,8 +44,8 @@
<!-- Properties -->
<properties>
<version.apache.ant>1.7.0</version.apache.ant>
- <version.apache.aries.blueprint>1.0.0-incubating-SNAPSHOT</version.apache.aries.blueprint>
- <version.apache.aries.util>1.0.0-incubating-SNAPSHOT</version.apache.aries.util>
+ <version.apache.aries.blueprint>1.0.0.20100120</version.apache.aries.blueprint>
+ <version.apache.aries.util>1.0.0.20100120</version.apache.aries.util>
<version.apache.felix.configadmin>1.2.4</version.apache.felix.configadmin>
<version.apache.felix.core>1.4.0</version.apache.felix.core>
<version.apache.felix.eventadmin>1.0.0</version.apache.felix.eventadmin>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2010-01-20 14:43:05 UTC (rev 99659)
+++ projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2010-01-20 14:49:31 UTC (rev 99660)
@@ -41,17 +41,17 @@
<artifactId>bnd</artifactId>
</dependency>
- <!-- Compile Dependencies -->
+ <!-- Provided Dependencies -->
<dependency>
<groupId>org.apache.aries.blueprint</groupId>
<artifactId>org.apache.aries.blueprint</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.aries</groupId>
<artifactId>org.apache.aries.util</artifactId>
+ <scope>provided</scope>
</dependency>
-
- <!-- Provided Dependencies -->
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-common</artifactId>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml 2010-01-20 14:43:05 UTC (rev 99659)
+++ projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml 2010-01-20 14:49:31 UTC (rev 99660)
@@ -14,22 +14,13 @@
<outputDirectory>bundles</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
- <include>*:org.apache.aries.blueprint:jar</include>
- <include>*:org.apache.aries.util:jar</include>
- </includes>
- <useStrictFiltering>true</useStrictFiltering>
- <scope>compile</scope>
- <unpack>false</unpack>
- </dependencySet>
- <dependencySet>
- <outputDirectory>bundles</outputDirectory>
- <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
- <includes>
<include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-common-core:jar</include>
<include>*:jboss-osgi-husky:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
+ <include>*:org.apache.aries.blueprint:jar</include>
+ <include>*:org.apache.aries.util:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
<scope>provided</scope>
16 years, 6 months
JBoss-OSGI SVN: r99658 - in projects/jboss-osgi/trunk: distribution/installer/src/main/resources/installer and 13 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-20 09:27:59 -0500 (Wed, 20 Jan 2010)
New Revision: 99658
Removed:
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/BlueprintContext.java
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/BlueprintException.java
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/container/
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintContextImpl.java
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintInterceptor.java
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintProcessor.java
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintException.java
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/JBossXBParser.java
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/SchemaResolverParser.java
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/xb/
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/reflect/
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/osgi/framework/
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/osgi/service/blueprint/container/
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/osgi/service/blueprint/reflect/
projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/AbstractParserTestCase.java
projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/BlueprintContainerParserTestCase.java
projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/RootElementParserTestCase.java
projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/common/
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/BlueprintCapability.java
projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintActivator.java
projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
[JBOSGI-263] Integrate Aries Blueprint implementation
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2010-01-20 14:27:59 UTC (rev 99658)
@@ -235,9 +235,9 @@
<include name="jboss-osgi-jndi.jar" />
<include name="org.apache.felix.eventadmin.jar" />
<!-- web -->
+ <include name="jboss-osgi-webconsole.jar" />
<include name="org.apache.felix.configadmin.jar" />
<include name="org.apache.felix.metatype.jar" />
- <include name="jboss-osgi-webconsole.jar" />
<include name="pax-web-jetty-bundle.jar" />
<!-- all -->
<include name="jboss-osgi-apache-xerces.jar" />
@@ -247,6 +247,8 @@
<include name="jboss-osgi-jta.jar" />
<include name="jboss-osgi-reflect.jar" />
<include name="jboss-osgi-xml-binding.jar" />
+ <include name="org.apache.aries.blueprint.jar" />
+ <include name="org.apache.aries.util.jar" />
</fileset>
<!-- Felix Integration -->
@@ -392,8 +394,10 @@
<include name="jboss-osgi-webconsole.jar" />
<include name="jboss-osgi-reflect.jar" />
<include name="jboss-osgi-xml-binding.jar" />
+ <include name="org.apache.aries.blueprint.jar" />
+ <include name="org.apache.aries.util.jar" />
+ <include name="org.apache.felix.log.jar" />
<include name="pax-web-jetty-bundle.jar" />
- <include name="org.apache.felix.log.jar" />
</fileset>
<fileset dir="@{deploy.artifacts.dir}/resources/jbossas" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi" override="true">
<include name="jta-service-jboss-beans.xml" />
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/pom.xml 2010-01-20 14:27:59 UTC (rev 99658)
@@ -34,7 +34,7 @@
<developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk</developerConnection>
<url>http://fisheye.jboss.com/qsearch/JBossOSGi</url>
</scm>
-
+
<!-- Modules -->
<modules>
<module>reactor</module>
@@ -44,6 +44,8 @@
<!-- Properties -->
<properties>
<version.apache.ant>1.7.0</version.apache.ant>
+ <version.apache.aries.blueprint>1.0.0-incubating-SNAPSHOT</version.apache.aries.blueprint>
+ <version.apache.aries.util>1.0.0-incubating-SNAPSHOT</version.apache.aries.util>
<version.apache.felix.configadmin>1.2.4</version.apache.felix.configadmin>
<version.apache.felix.core>1.4.0</version.apache.felix.core>
<version.apache.felix.eventadmin>1.0.0</version.apache.felix.eventadmin>
@@ -51,7 +53,7 @@
<version.apache.felix.metatype>1.0.2</version.apache.felix.metatype>
<version.izpack>4.3.1</version.izpack>
<version.jboss.osgi.apache.xerces>2.9.1.SP3</version.jboss.osgi.apache.xerces>
- <version.jboss.osgi.blueprint>1.0.0.Alpha3</version.jboss.osgi.blueprint>
+ <version.jboss.osgi.blueprint>1.0.0.Beta1</version.jboss.osgi.blueprint>
<version.jboss.osgi.common>1.0.3</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
<version.jboss.osgi.deployment>1.0.1-SNAPSHOT</version.jboss.osgi.deployment>
@@ -73,7 +75,7 @@
<version.jboss.osgi.xml.binding>2.0.2-SNAPSHOT</version.jboss.osgi.xml.binding>
<version.ops4j.pax.web>0.7.2</version.ops4j.pax.web>
<version.osgi>4.2.0</version.osgi>
-
+
<surefire.memory.args>-Xmx512m</surefire.memory.args>
<surefire.jpda.args></surefire.jpda.args>
<surefire.profiler.args></surefire.profiler.args>
@@ -82,14 +84,26 @@
<!-- DependencyManagement -->
<dependencyManagement>
<dependencies>
-
+
<!-- apache ant -->
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>${version.apache.ant}</version>
</dependency>
-
+
+ <!-- apache aries -->
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint</artifactId>
+ <version>${version.apache.aries.blueprint}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries</groupId>
+ <artifactId>org.apache.aries.util</artifactId>
+ <version>${version.apache.aries.util}</version>
+ </dependency>
+
<!-- jboss.osgi -->
<dependency>
<groupId>org.jboss.osgi</groupId>
@@ -248,7 +262,7 @@
<artifactId>pax-web-jetty-bundle</artifactId>
<version>${version.ops4j.pax.web}</version>
</dependency>
-
+
<!-- org.osgi -->
<dependency>
<groupId>org.osgi</groupId>
@@ -276,7 +290,7 @@
<scope>test</scope>
</dependency>
</dependencies>
-
+
<!-- Repositories -->
<repositories>
<repository>
@@ -339,7 +353,7 @@
<surefire.jpda.args>-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</surefire.jpda.args>
</properties>
</profile>
-
+
<!--
Name: yourkit
Descr: Enable YourKit remote profiling
@@ -355,7 +369,7 @@
<surefire.profiler.args>-agentlib:yjpagent=onexit=memory</surefire.profiler.args>
</properties>
</profile>
-
+
<!--
Name: embedded-testing
Descr: Setup for embedded integration testing
@@ -407,7 +421,7 @@
</plugins>
</build>
</profile>
-
+
<!--
Name: remote-testing
Descr: Setup for remote integration testing
@@ -479,7 +493,7 @@
</plugins>
</build>
</profile>
-
+
</profiles>
</project>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2010-01-20 14:27:59 UTC (rev 99658)
@@ -20,7 +20,7 @@
<artifactId>jboss-osgi-blueprint</artifactId>
<packaging>bundle</packaging>
- <version>1.0.0.Alpha3</version>
+ <version>1.0.0.Beta1</version>
<!-- Parent -->
<parent>
@@ -37,31 +37,21 @@
<!-- Dependencies -->
<dependencies>
<dependency>
- <groupId>org.jboss.osgi.runtime</groupId>
- <artifactId>jboss-osgi-deployment</artifactId>
+ <groupId>biz.aQute</groupId>
+ <artifactId>bnd</artifactId>
</dependency>
-
- <!-- Provided Dependencies -->
+
+ <!-- Compile Dependencies -->
<dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.log</artifactId>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-apache-xerces</artifactId>
- <scope>provided</scope>
+ <groupId>org.apache.aries</groupId>
+ <artifactId>org.apache.aries.util</artifactId>
</dependency>
+
+ <!-- Provided Dependencies -->
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-common</artifactId>
@@ -69,35 +59,15 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-husky</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jaxb</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-jmx</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-reflect</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-xml-binding</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.osgi.runtime</groupId>
<artifactId>jboss-osgi-framework</artifactId>
<scope>provided</scope>
@@ -137,33 +107,13 @@
org.jboss.osgi.blueprint.*
</Private-Package>
<Export-Package>
- org.jboss.osgi.blueprint;version=1.0.0,
- org.osgi.service.blueprint.*;version=1.0
+ org.jboss.osgi.blueprint;version=${version},
</Export-Package>
<Import-Package>
- javax.xml.bind.annotation,
- javax.xml.namespace,
- org.apache.xerces.dom,
- org.jboss.beans.metadata*,
- org.jboss.dependency.spi,
- org.jboss.kernel.spi*,
- org.jboss.osgi.deployment.interceptor,
- org.jboss.osgi.jbossxb;version=2.0,
- org.jboss.osgi.microcontainer;version=1.0,
- org.jboss.osgi.spi;version=1.0,
org.jboss.osgi.spi.capability;version=1.0,
- org.jboss.osgi.spi.service;version=1.0,
- org.jboss.osgi.spi.util;version=1.0,
- org.jboss.reflect.spi,
- org.jboss.xb.annotations,
org.osgi.framework,
org.osgi.service.blueprint.container;version=1.0,
org.osgi.service.blueprint.reflect;version=1.0,
- org.osgi.service.log;version=1.3,
- org.osgi.util.tracker;version=1.4,
- org.slf4j;version="[1.5,2.0)",
- org.w3c.dom,
- org.xml.sax,
</Import-Package>
</instructions>
</configuration>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml 2010-01-20 14:27:59 UTC (rev 99658)
@@ -14,16 +14,22 @@
<outputDirectory>bundles</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
- <include>*:jboss-osgi-apache-xerces:jar</include>
+ <include>*:org.apache.aries.blueprint:jar</include>
+ <include>*:org.apache.aries.util:jar</include>
+ </includes>
+ <useStrictFiltering>true</useStrictFiltering>
+ <scope>compile</scope>
+ <unpack>false</unpack>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>bundles</outputDirectory>
+ <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+ <includes>
<include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-common-core:jar</include>
- <include>*:jboss-osgi-deployment:jar</include>
<include>*:jboss-osgi-husky:jar</include>
- <include>*:jboss-osgi-jaxb:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
- <include>*:jboss-osgi-reflect:jar</include>
- <include>*:jboss-osgi-xml-binding:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/BlueprintCapability.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/BlueprintCapability.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/BlueprintCapability.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -23,9 +23,7 @@
//$Id$
-import org.jboss.osgi.jbossxb.XMLBindingCapability;
import org.jboss.osgi.spi.capability.Capability;
-import org.jboss.osgi.testing.OSGiRuntime;
/**
* Adds the Blueprint capability to the {@link OSGiRuntime}
@@ -33,7 +31,7 @@
*
* It is ignored if the {@link BlueprintService} is already registered.
*
- * Installed bundles: jboss-osgi-blueprint.jar
+ * Installed bundles: jboss-osgi-blueprint.jar, org.apache.aries.blueprint.jar
*
* @author thomas.diesler(a)jboss.com
* @since 05-May-2009
@@ -42,10 +40,10 @@
{
public BlueprintCapability()
{
- super (BlueprintService.class.getName());
-
- addDependency(new XMLBindingCapability());
-
+ super(BlueprintService.class.getName());
+
addBundle("bundles/jboss-osgi-blueprint.jar");
+ addBundle("bundles/org.apache.aries.util.jar");
+ addBundle("bundles/org.apache.aries.blueprint.jar");
}
}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/BlueprintContext.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/BlueprintContext.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/BlueprintContext.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.blueprint;
-
-//$Id$
-
-import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.osgi.framework.BundleContext;
-
-/**
- * The context of the Blueprint implementation
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public interface BlueprintContext
-{
- String XMLNS_BLUEPRINT = "http://www.osgi.org/xmlns/blueprint/v1.0.0";
-
- BundleContext getBundleContext();
-
- BlueprintParser getBlueprintParser();
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/BlueprintException.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/BlueprintException.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/BlueprintException.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.blueprint;
-
-//$Id$
-
-/**
- * The Blueprint implementation throws this exception on various
- * error conditions.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class BlueprintException extends RuntimeException
-{
- private static final long serialVersionUID = 1L;
-
- public BlueprintException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public BlueprintException(String message)
- {
- super(message);
- }
-
- public BlueprintException(Throwable cause)
- {
- super(cause);
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintActivator.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintActivator.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintActivator.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -26,47 +26,23 @@
import org.jboss.osgi.blueprint.BlueprintService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleListener;
/**
- * The Blueprint activator registeres the {@link BlueprintExtender}
- * as {@link BundleListener}
+ * The Blueprint activator registeres the {@link BlueprintService}
*
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
public class BlueprintActivator implements BundleActivator
{
- private BlueprintExtender extender;
- private BlueprintInterceptor interceptor;
-
public void start(BundleContext context) throws Exception
{
// Register the marker service
BlueprintService service = new BlueprintService(){};
context.registerService(BlueprintService.class.getName(), service, null);
-
- BlueprintProcessor processor = new BlueprintProcessor(new BlueprintContextImpl(context));
-
- interceptor = new BlueprintInterceptor(processor);
- interceptor.start();
-
- extender = new BlueprintExtender(processor);
- extender.start();
}
public void stop(BundleContext context) throws Exception
{
- if (interceptor != null)
- {
- interceptor.stop();
- interceptor = null;
- }
-
- if (extender != null)
- {
- extender.stop();
- extender = null;
- }
}
}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintContextImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintContextImpl.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintContextImpl.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.blueprint.extender;
-
-//$Id$
-
-import org.jboss.osgi.blueprint.BlueprintContext;
-import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.osgi.framework.BundleContext;
-
-/**
- * The context of the Blueprint implementation
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class BlueprintContextImpl implements BlueprintContext
-{
- public static final String XMLNS_BLUEPRINT = "http://www.osgi.org/xmlns/blueprint/v1.0.0";
-
- private BundleContext context;
- private BlueprintParser parser;
-
- public BlueprintContextImpl(BundleContext context)
- {
- this.context = context;
-
- this.parser = new BlueprintParser(this);
- }
-
- public BundleContext getBundleContext()
- {
- return context;
- }
-
- public BlueprintParser getBlueprintParser()
- {
- return parser;
- }
-
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.blueprint.extender;
-
-//$Id$
-
-import org.jboss.osgi.blueprint.BlueprintContext;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.SynchronousBundleListener;
-
-/**
- * The Blueprint extender
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class BlueprintExtender implements SynchronousBundleListener
-{
- private BlueprintProcessor processor;
-
- public BlueprintExtender(BlueprintProcessor processor)
- {
- this.processor = processor;
- }
-
- /**
- * Start the BlueprintExtender
- */
- public void start()
- {
- BlueprintContext bpContext = processor.getBlueprintContext();
- bpContext.getBundleContext().addBundleListener(this);
- }
-
- /**
- * Stop the BlueprintExtender
- */
- public void stop()
- {
- BlueprintContext bpContext = processor.getBlueprintContext();
- bpContext.getBundleContext().removeBundleListener(this);
- processor.stopAllContainers();
- }
-
- /**
- * Handle the bundle event
- */
- public void bundleChanged(BundleEvent event)
- {
- Bundle bundle = event.getBundle();
-
- int eventType = event.getType();
- if (eventType == BundleEvent.STARTING)
- {
- if (processor.hasContainer(bundle) == false)
- processor.createContainer(bundle);
- }
- else if (eventType == BundleEvent.STOPPED)
- {
- if (processor.hasContainer(bundle))
- processor.stopContainer(bundle);
- }
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintInterceptor.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintInterceptor.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintInterceptor.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.blueprint.extender;
-
-//$Id$
-
-import org.jboss.osgi.blueprint.BlueprintContext;
-import org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptor;
-import org.jboss.osgi.deployment.interceptor.InvocationContext;
-import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
-import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorException;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The Blueprint interceptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 20-Oct-2009
- */
-public class BlueprintInterceptor extends AbstractLifecycleInterceptor implements LifecycleInterceptor
-{
- // Provide logging
- private Logger log = LoggerFactory.getLogger(BlueprintInterceptor.class);
-
- private BlueprintProcessor processor;
-
- public BlueprintInterceptor(BlueprintProcessor processor)
- {
- this.processor = processor;
- }
-
- public void start()
- {
- BlueprintContext bpContext = processor.getBlueprintContext();
- BundleContext context = bpContext.getBundleContext();
- context.registerService(LifecycleInterceptor.class.getName(), this, null);
- }
-
- public void stop()
- {
- processor.stopAllContainers();
- }
-
- public void invoke(int state, InvocationContext context) throws LifecycleInterceptorException
- {
- Bundle bundle = context.getBundle();
- if (state == Bundle.STARTING)
- {
- log.debug("Create blueprint container");
- processor.createContainer(bundle);
- }
- else if (state == Bundle.STOPPING)
- {
- log.debug("Stop blueprint container");
- processor.stopContainer(bundle);
- }
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintProcessor.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintProcessor.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintProcessor.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,116 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.blueprint.extender;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.osgi.blueprint.BlueprintContext;
-import org.jboss.osgi.blueprint.container.BlueprintContainerImpl;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
-
-/**
- * The Blueprint metadata processor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 20-Oct-2009
- */
-class BlueprintProcessor
-{
- private BlueprintContext bpContext;
- private Map<String, BlueprintContainerImpl> containers = new LinkedHashMap<String, BlueprintContainerImpl>();
-
- public BlueprintProcessor(BlueprintContext bpContext)
- {
- this.bpContext = bpContext;
- }
-
- public BlueprintContext getBlueprintContext()
- {
- return bpContext;
- }
-
- @SuppressWarnings("unchecked")
- protected void createContainer(Bundle bundle)
- {
- // If a Bundle-Blueprint manifest header is defined, then this header contains a list of paths.
- // If this header is not defined, then resources ending in .xml in the bundle’s
- // OSGI-INF/blueprint directory must be used. These are the resources that
- // would be found by calling the Bundle findEntries("OSGI-INF/blueprint", "*.xml", false) method.
-
- boolean hasBlueprintMetadata = false;
-
- String descriptorPaths = (String)bundle.getHeaders().get(BlueprintContainerImpl.HEADER_BUNDLE_BLUEPRINT);
- hasBlueprintMetadata = (descriptorPaths != null);
-
- Enumeration foundEntries = bundle.findEntries("OSGI-INF/blueprint", "*.xml", false);
- hasBlueprintMetadata |= (foundEntries != null);
-
- if (hasBlueprintMetadata)
- {
- BlueprintContainerImpl container = new BlueprintContainerImpl(bpContext, bundle);
- container.initialize();
-
- String key = getBundleKey(bundle);
- containers.put(key, container);
- }
- }
-
- protected boolean hasContainer(Bundle bundle)
- {
- String key = getBundleKey(bundle);
- return containers.containsKey(key);
- }
-
- protected void stopContainer(Bundle bundle)
- {
- String key = getBundleKey(bundle);
- BlueprintContainerImpl container = containers.remove(key);
- if (container != null)
- container.shutdown();
- }
-
- protected void stopAllContainers()
- {
- Collection<BlueprintContainerImpl> values = containers.values();
- List<BlueprintContainerImpl> list = new ArrayList<BlueprintContainerImpl>(values);
- Collections.reverse(list);
-
- for (BlueprintContainerImpl container : list)
- container.shutdown();
- }
-
- private String getBundleKey(Bundle bundle)
- {
- String symbolicName = bundle.getSymbolicName();
- String version = (String)bundle.getHeaders().get(Constants.BUNDLE_VERSION);
- return symbolicName + "-" + version;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintException.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintException.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintException.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.blueprint.parser;
-
-//$Id$
-
-/**
- * The Blueprint implementation throws this exception on various
- * error conditions.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class BlueprintException extends RuntimeException
-{
- private static final long serialVersionUID = 1L;
-
- public BlueprintException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public BlueprintException(String message)
- {
- super(message);
- }
-
- public BlueprintException(Throwable cause)
- {
- super(cause);
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,109 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.blueprint.parser;
-
-import static org.jboss.osgi.blueprint.container.BlueprintContainerImpl.HEADER_BUNDLE_BLUEPRINT;
-
-import java.net.URL;
-import java.util.Enumeration;
-
-import org.jboss.osgi.blueprint.BlueprintContext;
-import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
-import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
-import org.osgi.framework.Bundle;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-//$Id$
-
-/**
- * The Blueprint descriptor parser.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class BlueprintParser
-{
- // Provide Logging
- private Logger log = LoggerFactory.getLogger(BlueprintParser.class);
-
- private BlueprintContext context;
- private JBossXBParser parser;
-
- public BlueprintParser(BlueprintContext context)
- {
- this.context = context;
- this.parser = new SchemaResolverParser(context);
- }
-
- @SuppressWarnings("unchecked")
- public BlueprintMetadata getBlueprintMetadata(Bundle bundle)
- {
- TBlueprint tBlueprint = null;
-
- // If a Bundle-Blueprint manifest header is defined, then this header contains a list of paths.
- // If this header is not defined, then resources ending in .xml in the bundle’s
- // OSGI-INF/blueprint directory must be used. These are the resources that
- // would be found by calling the Bundle findEntries("OSGI-INF/blueprint", "*.xml", false) method.
-
- String descriptorPaths = (String)bundle.getHeaders().get(HEADER_BUNDLE_BLUEPRINT);
- if (descriptorPaths != null)
- {
- log.info(HEADER_BUNDLE_BLUEPRINT + ": " + descriptorPaths + " in bundle: " + bundle);
- String[] descritors = descriptorPaths.split(", ");
-
- for (String descriptor : descritors)
- {
- TBlueprint aux = parse(bundle, descriptor);
- tBlueprint = aux.merge(tBlueprint);
- }
- }
-
- Enumeration<URL> foundEntries = bundle.findEntries("OSGI-INF/blueprint", "*.xml", false);
- if (foundEntries != null)
- {
- while (foundEntries.hasMoreElements())
- {
- URL nextEntry = foundEntries.nextElement();
- TBlueprint aux = parse(nextEntry);
- tBlueprint = aux.merge(tBlueprint);
- }
- }
-
- if (tBlueprint == null)
- throw new IllegalStateException("Cannot obtain blueprint metadata");
-
- return new BlueprintMetadata(context, tBlueprint);
- }
-
- public TBlueprint parse(Bundle bundle, String descriptor)
- {
- URL descriptorURL = bundle.getResource(descriptor);
- return parse(descriptorURL);
- }
-
- public TBlueprint parse(URL descriptorURL)
- {
- TBlueprint blueprint = parser.parse(descriptorURL);
- return blueprint;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/JBossXBParser.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/JBossXBParser.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/JBossXBParser.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.blueprint.parser;
-
-//$Id$
-
-import java.net.URL;
-
-import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-
-/**
- * The SchemaBindingParser builds a JBossXB {@link SchemaBinding} from an annotated blueprint.xsd
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public interface JBossXBParser
-{
- /*
- * Parse a blueprint descriptor
- */
- public TBlueprint parse(URL xmlURL);
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/SchemaResolverParser.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/SchemaResolverParser.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/main/java/org/jboss/osgi/blueprint/parser/SchemaResolverParser.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.blueprint.parser;
-
-//$Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.osgi.blueprint.BlueprintContext;
-import org.jboss.osgi.blueprint.BlueprintException;
-import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
-import org.jboss.osgi.jbossxb.UnmarshallerService;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-/**
- * The Blueprint descriptor parser.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class SchemaResolverParser implements JBossXBParser
-{
- private BlueprintContext bpContext;
-
- public SchemaResolverParser(BlueprintContext bpContext)
- {
- this.bpContext = bpContext;
- }
-
- /*
- * Parse a blueprint descriptor
- */
- public TBlueprint parse(URL xmlURL)
- {
- if (xmlURL == null)
- throw new IllegalArgumentException("Cannot parse null descriptor URL");
-
- BundleContext context = bpContext.getBundleContext();
- ServiceReference sref = context.getServiceReference(UnmarshallerService.class.getName());
- if (sref == null)
- throw new IllegalStateException("Cannot obtain: " + UnmarshallerService.class.getName());
-
- UnmarshallerService unmarshaller = (UnmarshallerService)context.getService(sref);
- try
- {
- unmarshaller.setSchemaValidation(true);
- unmarshaller.setNamespaceAware(true);
- unmarshaller.setValidation(true);
-
- unmarshaller.registerSchemaLocation("http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd", "schema/blueprint.xsd");
-
- unmarshaller.addClassBinding(BlueprintContext.XMLNS_BLUEPRINT, TBlueprint.class);
-
- TBlueprint tBlueprint = (TBlueprint)unmarshaller.unmarshal(xmlURL.toExternalForm());
-
- return tBlueprint;
- }
- catch (IOException ex)
- {
- throw new BlueprintException("Cannot parse blueprint descriptor: " + xmlURL, ex);
- }
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -190,7 +190,7 @@
Set<String> compNames = bpContainer.getComponentIds();
assertNotNull("ComponentNames not null", compNames);
- assertEquals("ComponentNames size", 4, compNames.size());
+ assertEquals("ComponentNames size", 8, compNames.size());
assertTrue("ComponentNames contains beanA", compNames.contains("beanA"));
assertTrue("ComponentNames contains serviceA", compNames.contains("serviceA"));
assertTrue("ComponentNames contains serviceB", compNames.contains("serviceB"));
@@ -209,7 +209,7 @@
Collection<BeanMetadata> bcMetadata = bpContainer.getMetadata(BeanMetadata.class);
assertNotNull("BeanComponentsMetadata not null", bcMetadata);
- assertEquals("BeanComponentsMetadata size", 1, bcMetadata.size());
+ assertEquals("BeanComponentsMetadata size", 2, bcMetadata.size());
BeanMetadata bmd = bcMetadata.iterator().next();
assertEquals("beanA", bmd.getId());
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/AbstractParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/AbstractParserTestCase.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/AbstractParserTestCase.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.blueprint.parser;
-
-//$Id$
-
-import java.net.URL;
-
-import org.jboss.osgi.blueprint.BlueprintContext;
-import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
-import org.jboss.osgi.testing.OSGiTest;
-import org.jboss.util.xml.JBossEntityResolver;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
-
-/**
- * An abstract Blueprint parser
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public abstract class AbstractParserTestCase extends OSGiTest
-{
- protected TBlueprint parse(URL xmlURL) throws JBossXBException
- {
- if (xmlURL == null)
- throw new IllegalArgumentException("Cannot parse null descriptor URL");
-
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setSchemaValidation(true);
- unmarshaller.setNamespaceAware(true);
- unmarshaller.setValidation(true);
-
- JBossEntityResolver entityResolver = new JBossEntityResolver();
- entityResolver.registerLocalEntity("http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd", "schema/blueprint.xsd");
- unmarshaller.setEntityResolver(entityResolver);
-
- DefaultSchemaResolver schemaBindingResolver = new DefaultSchemaResolver();
- schemaBindingResolver.addClassBinding(BlueprintContext.XMLNS_BLUEPRINT, TBlueprint.class);
-
- TBlueprint tBlueprint = (TBlueprint)unmarshaller.unmarshal(xmlURL.toExternalForm(), schemaBindingResolver);
- return tBlueprint;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,131 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.blueprint.parser;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.net.URL;
-import java.util.Collection;
-import java.util.List;
-
-import org.jboss.osgi.blueprint.parser.xb.TActivation;
-import org.jboss.osgi.blueprint.parser.xb.TAvailability;
-import org.jboss.osgi.blueprint.parser.xb.TBean;
-import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
-import org.jboss.osgi.blueprint.parser.xb.TRef;
-import org.jboss.osgi.blueprint.parser.xb.TReference;
-import org.jboss.osgi.blueprint.parser.xb.TService;
-import org.jboss.osgi.blueprint.parser.xb.TServiceReference;
-import org.jboss.osgi.blueprint.parser.xb.TTypeConverters;
-import org.jboss.osgi.testing.OSGiTestHelper;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Blueprint parser tests
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class AllElementsParserTestCase extends AbstractParserTestCase
-{
- private static TBlueprint blueprint;
-
- @BeforeClass
- public static void beforeClass() throws Exception
- {
- URL xmlURL = new OSGiTestHelper().getResourceURL("parser/blueprint-all-elements.xml");
- blueprint = new AllElementsParserTestCase().parse(xmlURL);
- }
-
- @Test
- public void testRootAttributes() throws Exception
- {
- TAvailability defaultAvailability = blueprint.getDefaultAvailability();
- assertEquals(TAvailability.mandatory, defaultAvailability);
-
- TActivation defaultActivation = blueprint.getDefaultActivation();
- assertEquals(TActivation.eager, defaultActivation);
-
- long defaultTimeout = blueprint.getDefaultTimeout().longValue();
- assertEquals(300000, defaultTimeout);
- }
-
- @Test
- public void getDescription() throws Exception
- {
- String description = blueprint.getDescription();
- assertEquals("blueprint description", description);
- }
-
- @Test
- public void getTypeConverters() throws Exception
- {
- TTypeConverters typeConverters = blueprint.getTypeConverters();
- assertNotNull("TypeConverters not null", typeConverters);
-
- List<Object> converters = typeConverters.getComponents();
- assertEquals("TypeConverters size", 5, converters.size());
-
- TBean conv1 = (TBean)converters.get(0);
- assertNotNull("Converter not null", conv1);
-
- TReference conv2 = (TReference)converters.get(1);
- assertNotNull("Converter not null", conv2);
-
- TReference conv3 = (TReference)converters.get(2);
- assertNotNull("Converter not null", conv3);
-
- TRef conv4 = (TRef)converters.get(3);
- assertNotNull("Converter not null", conv4);
-
- TRef conv5 = (TRef)converters.get(4);
- assertNotNull("Converter not null", conv5);
- }
-
- @Test
- public void getExportedServicesMetadata() throws Exception
- {
- Collection<TService> services = blueprint.getMetadata(TService.class);
- assertNotNull("ServiceMetadata not null", services);
- assertEquals("ServiceMetadata size", 2, services.size());
- }
-
- @Test
- public void getReferencedServicesMetadata() throws Exception
- {
- Collection<TServiceReference> serviceRefs = blueprint.getMetadata(TServiceReference.class);
- assertNotNull("ServiceReferenceMetadata not null", serviceRefs);
- assertEquals("ServiceReferenceMetadata size", 2, serviceRefs.size());
- }
-
- @Test
- public void getBeanComponentsMetadata() throws Exception
- {
- Collection<TBean> beans = blueprint.getMetadata(TBean.class);
- assertNotNull("BeanMetadata not null", beans);
- assertEquals("BeanMetadata size", 3, beans.size());
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.blueprint.parser;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.jboss.osgi.blueprint.parser.xb.TBean;
-import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
-import org.jboss.osgi.blueprint.parser.xb.TComponent;
-import org.jboss.test.osgi.blueprint.parser.common.BeanA;
-import org.jboss.test.osgi.blueprint.parser.common.BeanB;
-import org.junit.Test;
-
-/**
- * Blueprint parser tests
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class BasicBeansParserTestCase extends AbstractParserTestCase
-{
- @Test
- public void testBasicBeans() throws Exception
- {
- TBlueprint blueprint = parse(getResourceURL("parser/blueprint-basic-beans.xml"));
-
- List<TComponent> compList = blueprint.getComponents();
- assertTrue(compList.size() > 0);
-
- TBean beanA = (TBean)compList.get(0);
- assertEquals(BeanA.class.getName(), beanA.getClassName());
- assertEquals("beanA", beanA.getId());
- assertEquals("BeanA Description", beanA.getDescription());
-
- TBean beanB = (TBean)compList.get(1);
- assertEquals(BeanB.class.getName(), beanB.getClassName());
- assertEquals("beanB", beanB.getId());
- assertEquals("BeanB Description", beanB.getDescription());
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.blueprint.parser;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.jboss.osgi.blueprint.parser.xb.TBean;
-import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
-import org.jboss.osgi.blueprint.parser.xb.TComponent;
-import org.jboss.osgi.blueprint.parser.xb.TService;
-import org.jboss.test.osgi.blueprint.parser.common.BeanA;
-import org.jboss.test.osgi.blueprint.parser.common.ServiceA;
-import org.jboss.test.osgi.blueprint.parser.common.ServiceB;
-import org.junit.Test;
-
-/**
- * Blueprint parser tests
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class BasicServiceParserTestCase extends AbstractParserTestCase
-{
- @Test
- public void testBasicService() throws Exception
- {
- TBlueprint blueprint = parse(getResourceURL("parser/blueprint-basic-service.xml"));
-
- List<TComponent> compList = blueprint.getComponents();
- assertTrue(compList.size() > 0);
-
- TBean beanA = (TBean)compList.get(0);
- assertEquals(BeanA.class.getName(), beanA.getClassName());
- assertEquals("beanA", beanA.getId());
-
- TService serviceA = (TService)compList.get(1);
- assertEquals("serviceA", serviceA.getId());
-
- List<String> intfsA = serviceA.getInterfaces().getValues();
- assertTrue(intfsA.size() > 0);
- assertEquals(ServiceA.class.getName(), intfsA.get(0));
-
- TService serviceB = (TService)compList.get(2);
- assertEquals("serviceB", serviceB.getId());
-
- List<String> intfsB = serviceB.getInterfaces().getValues();
- assertTrue(intfsB.size() > 0);
- assertEquals(ServiceB.class.getName(), intfsB.get(0));
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/BlueprintContainerParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/BlueprintContainerParserTestCase.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/BlueprintContainerParserTestCase.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,126 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.blueprint.parser;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.net.URL;
-import java.util.List;
-
-import javax.management.MBeanServer;
-
-import org.jboss.osgi.blueprint.parser.xb.TBean;
-import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
-import org.jboss.osgi.blueprint.parser.xb.TProperty;
-import org.jboss.osgi.blueprint.parser.xb.TReference;
-import org.jboss.osgi.blueprint.parser.xb.TService;
-import org.jboss.osgi.testing.OSGiTestHelper;
-import org.jboss.test.osgi.blueprint.container.bundle.BeanA;
-import org.jboss.test.osgi.blueprint.container.bundle.BeanB;
-import org.jboss.test.osgi.blueprint.container.bundle.ServiceA;
-import org.jboss.test.osgi.blueprint.container.bundle.ServiceB;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Blueprint parser tests
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class BlueprintContainerParserTestCase extends AbstractParserTestCase
-{
- private static TBlueprint blueprint;
-
- @BeforeClass
- public static void beforeClass() throws Exception
- {
- URL xmlURL = new OSGiTestHelper().getResourceURL("container/OSGI-INF/blueprint/basic-service.xml");
- blueprint = new BlueprintContainerParserTestCase().parse(xmlURL);
- }
-
- @Test
- public void getBeanMetadata() throws Exception
- {
- List<TBean> beans = blueprint.getMetadata(TBean.class);
- assertNotNull("TBeans not null", beans);
- assertEquals("TBeans size", 1, beans.size());
-
- TBean bean = beans.get(0);
- assertNotNull("TBean not null", bean);
- assertEquals(BeanA.class.getName(), bean.getClassName());
-
- List<TProperty> props = bean.getProperties();
- assertNotNull("TProperties not null", props);
- assertEquals("TProperties size", 1, props.size());
-
- TProperty prop = props.get(0);
- assertNotNull("TProperty not null", prop);
- assertEquals("mbeanServer", prop.getName());
- assertEquals("mbeanService", prop.getRef());
- }
-
- @Test
- public void getServiceMetadata() throws Exception
- {
- List<TService> services = blueprint.getMetadata(TService.class);
- assertNotNull("TServices not null", services);
- assertEquals("TServices size", 2, services.size());
-
- TService serviceA = services.get(0);
- assertEquals("serviceA", serviceA.getId());
- assertEquals("beanA", serviceA.getRef());
- assertEquals(ServiceA.class.getName(), serviceA.getInterface());
-
- TService serviceB = services.get(1);
- assertEquals("serviceB", serviceB.getId());
- assertEquals(ServiceB.class.getName(), serviceB.getInterface());
-
- TBean bean = serviceB.getBean();
- assertNotNull("TBean not null", bean);
- assertEquals(BeanB.class.getName(), bean.getClassName());
-
- List<TProperty> props = bean.getProperties();
- assertNotNull("TProperties not null", props);
- assertEquals("TProperties size", 1, props.size());
-
- TProperty prop = props.get(0);
- assertNotNull("TProperty not null", prop);
- assertEquals("beanA", prop.getName());
- assertEquals("beanA", prop.getRef());
- }
-
- @Test
- public void getReferenceMetadata() throws Exception
- {
- List<TReference> references = blueprint.getMetadata(TReference.class);
- assertNotNull("TReferences not null", references);
- assertEquals("TReferences size", 1, references.size());
-
- TReference ref = references.get(0);
- assertEquals("mbeanService", ref.getId());
- assertEquals(MBeanServer.class.getName(), ref.getInterface());
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/RootElementParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/RootElementParserTestCase.java 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/test/java/org/jboss/test/osgi/blueprint/parser/RootElementParserTestCase.java 2010-01-20 14:27:59 UTC (rev 99658)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.blueprint.parser;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-
-import java.math.BigInteger;
-
-import org.jboss.osgi.blueprint.parser.xb.TActivation;
-import org.jboss.osgi.blueprint.parser.xb.TAvailability;
-import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
-import org.junit.Test;
-
-/**
- * Blueprint parser tests
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class RootElementParserTestCase extends AbstractParserTestCase
-{
- @Test
- public void testBlueprintDefaultAttributes() throws Exception
- {
- TBlueprint blueprint = parse(getResourceURL("parser/blueprint-root-defaults.xml"));
-
- // assert default attributes
- assertEquals("availability", TAvailability.mandatory, blueprint.getDefaultAvailability());
- assertEquals("timeout", new BigInteger("300000"), blueprint.getDefaultTimeout());
- assertEquals("activation", TActivation.eager, blueprint.getDefaultActivation());
- }
-
- @Test
- public void testBlueprintDescription() throws Exception
- {
- TBlueprint blueprint = parse(getResourceURL("parser/blueprint-basic-root.xml"));
-
- // assert default attributes
- assertEquals("availability", TAvailability.optional, blueprint.getDefaultAvailability());
- assertEquals("timeout", new BigInteger("100000"), blueprint.getDefaultTimeout());
- assertEquals("activation", TActivation.lazy, blueprint.getDefaultActivation());
-
- // assert description
- assertEquals("some text", blueprint.getDescription());
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-01-20 14:27:59 UTC (rev 99658)
@@ -12,7 +12,6 @@
<constructor>
<parameter><inject bean="jboss.kernel:service=Kernel" /></parameter>
<parameter><inject bean="MainDeployer" /></parameter>
- <parameter><inject bean="DeploymentRegistry" /></parameter>
</constructor>
<property name="properties">
<map keyClass="java.lang.String" valueClass="java.lang.String">
@@ -74,6 +73,12 @@
</list>
</property>
</bean>
+ <bean name="OSGiControllerContextPlugin" class="org.jboss.osgi.framework.bundle.ControllerContextPluginImpl">
+ <constructor>
+ <parameter><inject bean="OSGiBundleManager" /></parameter>
+ <parameter><inject bean="DeploymentRegistry" /></parameter>
+ </constructor>
+ </bean>
<bean name="OSGiFrameworkEventsPlugin" class="org.jboss.osgi.framework.plugins.internal.FrameworkEventsPluginImpl">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2010-01-20 14:27:59 UTC (rev 99658)
@@ -27,6 +27,8 @@
<include>*:jboss-osgi-reflect:jar</include>
<include>*:jboss-osgi-webapp:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
+ <include>*:org.apache.aries.blueprint:jar</include>
+ <include>*:org.apache.aries.util:jar</include>
<include>*:org.apache.felix.configadmin:jar</include>
<include>*:org.apache.felix.eventadmin:jar</include>
<include>*:org.apache.felix.log:jar</include>
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2010-01-20 14:27:59 UTC (rev 99658)
@@ -26,6 +26,8 @@
<include>*:jboss-osgi-reflect:jar</include>
<include>*:jboss-osgi-webapp:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
+ <include>*:org.apache.aries.blueprint:jar</include>
+ <include>*:org.apache.aries.util:jar</include>
<include>*:org.apache.felix.configadmin:jar</include>
<include>*:org.apache.felix.eventadmin:jar</include>
<include>*:org.apache.felix.log:jar</include>
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2010-01-20 13:25:17 UTC (rev 99657)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2010-01-20 14:27:59 UTC (rev 99658)
@@ -59,6 +59,11 @@
<!-- Bundle Dependencies -->
<dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.log</artifactId>
<scope>provided</scope>
16 years, 6 months