JBoss-OSGI SVN: r99449 - projects/jboss-osgi/trunk/reactor.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-15 03:44:25 -0500 (Fri, 15 Jan 2010)
New Revision: 99449
Modified:
projects/jboss-osgi/trunk/reactor/pom.xml
Log:
By default build external reactor projects
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2010-01-15 08:14:12 UTC (rev 99448)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2010-01-15 08:44:25 UTC (rev 99449)
@@ -48,15 +48,14 @@
<profiles>
<!--
- Name: framework-jbossmc
- Descr: Build the MC based framework
+ Name: externals
+ Descr: Build the external reactor projects
-->
<profile>
- <id>framework-jbossmc</id>
+ <id>externals</id>
<activation>
<property>
- <name>framework</name>
- <value>jbossmc</value>
+ <name>!noexternals</name>
</property>
</activation>
<modules>
15 years, 11 months
JBoss-OSGI SVN: r99448 - projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-15 03:14:12 -0500 (Fri, 15 Jan 2010)
New Revision: 99448
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
Log:
Use dummy URLStreamHandler for 'bundle' protocol
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2010-01-15 06:11:51 UTC (rev 99447)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2010-01-15 08:14:12 UTC (rev 99448)
@@ -23,8 +23,11 @@
// $Id$
+import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
import java.util.Dictionary;
import javax.management.ObjectName;
@@ -51,34 +54,34 @@
{
// Provide logging
private final Logger log = LoggerFactory.getLogger(RemoteBundle.class);
-
+
private ManagedBundleMBean bundle;
private String location;
-
+
private long bundleId;
private String symbolicName;
private Dictionary<String, String> headers;
private Version version;
-
+
public RemoteBundle(OSGiRuntimeImpl runtime, ManagedBundleMBean bundle, BundleInfo info)
{
this(runtime, bundle);
this.location = info.getLocation();
}
-
+
public RemoteBundle(OSGiRuntimeImpl runtime, ManagedBundleMBean bundle)
{
super(runtime);
this.bundle = bundle;
-
+
// The getHeaders methods must continue to provide the manifest header
// information after the bundle enters the UNINSTALLED state.
-
+
bundleId = bundle.getBundleId();
symbolicName = bundle.getSymbolicName();
location = bundle.getLocation();
headers = bundle.getHeaders();
-
+
String versionStr = headers.get(Constants.BUNDLE_VERSION);
version = Version.parseVersion(versionStr);
}
@@ -131,14 +134,14 @@
public URL getEntry(String path)
{
assertNotUninstalled();
- return toURL(bundle.getEntry(path));
+ return toURL(bundle.getEntry(path), null);
}
@Override
public URL getResource(String name)
{
assertNotUninstalled();
- return toURL(bundle.getResource(name));
+ return toURL(bundle.getResource(name), null);
}
@Override
@@ -149,6 +152,7 @@
String bundleId = providerBundle.getKeyProperty(ManagedBundle.PROPERTY_ID);
return getRuntime().getBundle(new Long(bundleId));
}
+
@Override
public void start() throws BundleException
{
@@ -183,15 +187,32 @@
log.error("Cannot uninstall: " + getLocation(), ex);
}
}
-
- private URL toURL(String urlstr)
+
+ private URL toURL(String urlstr, URLStreamHandler sh)
{
+ if (urlstr == null)
+ return null;
+
try
{
- return urlstr != null ? new URL(urlstr) : null;
+ return sh == null ? new URL(urlstr) : new URL (null, urlstr, sh);
}
catch (MalformedURLException ex)
{
+ // In case of the 'bundle' protocol, use a dummy URLStreamHandler
+ // Access to remote content via the bundle URL is invalid anyway
+ if (sh == null && urlstr.startsWith("bundle:"))
+ {
+ sh = new URLStreamHandler()
+ {
+ @Override
+ protected URLConnection openConnection(URL url) throws IOException
+ {
+ return null;
+ }
+ };
+ return toURL(urlstr, sh);
+ }
throw new IllegalArgumentException("Invalid URL: " + urlstr);
}
}
15 years, 11 months
JBoss-OSGI SVN: r99394 - in projects/jboss-osgi: projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-14 04:37:45 -0500 (Thu, 14 Jan 2010)
New Revision: 99394
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiSystemState.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle/SystemBundleUnitTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
Log:
Update jboss-aop-mc-int-2.2.0.Alpha1
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2010-01-14 09:01:51 UTC (rev 99393)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2010-01-14 09:37:45 UTC (rev 99394)
@@ -400,9 +400,7 @@
manifest = new Manifest();
// [TODO] populate some bundle information
Attributes attributes = manifest.getMainAttributes();
- attributes.put(new Name(Constants.BUNDLE_NAME), unit.getName());
attributes.put(new Name(Constants.BUNDLE_SYMBOLICNAME), unit.getName());
- attributes.put(new Name(Constants.BUNDLE_MANIFESTVERSION), "2");
osgiMetaData = new AbstractOSGiMetaData(manifest);
unit.addAttachment(OSGiMetaData.class, osgiMetaData);
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiSystemState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiSystemState.java 2010-01-14 09:01:51 UTC (rev 99393)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiSystemState.java 2010-01-14 09:37:45 UTC (rev 99394)
@@ -59,9 +59,7 @@
{
Manifest manifest = new Manifest();
Attributes attributes = manifest.getMainAttributes();
- attributes.put(new Name(Constants.BUNDLE_NAME), Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
attributes.put(new Name(Constants.BUNDLE_SYMBOLICNAME), Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
- attributes.put(new Name(Constants.BUNDLE_MANIFESTVERSION), "2");
osgiMetaData = new AbstractOSGiMetaData(manifest);
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle/SystemBundleUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle/SystemBundleUnitTestCase.java 2010-01-14 09:01:51 UTC (rev 99393)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle/SystemBundleUnitTestCase.java 2010-01-14 09:37:45 UTC (rev 99394)
@@ -92,9 +92,7 @@
public void testGetHeaders() throws Exception
{
Dictionary expected = new Hashtable();
- expected.put(Constants.BUNDLE_NAME, Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
expected.put(Constants.BUNDLE_SYMBOLICNAME, Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
- expected.put(Constants.BUNDLE_MANIFESTVERSION, "2");
// todo expected.put(Attributes.Name.IMPLEMENTATION_TITLE.toString(), "JBoss OSGi");
// todo expected.put(Attributes.Name.IMPLEMENTATION_VENDOR.toString(), "jboss.org");
// todo expected.put(Attributes.Name.IMPLEMENTATION_VERSION.toString(), "r4v41");
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2010-01-14 09:01:51 UTC (rev 99393)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2010-01-14 09:37:45 UTC (rev 99394)
@@ -38,21 +38,15 @@
<properties>
<version.javax.ejb>3.0</version.javax.ejb>
<version.jboss.ejb3>1.0.0</version.jboss.ejb3>
- <version.jboss.aop.mc.int>2.2.0.M2</version.jboss.aop.mc.int>
+ <version.jboss.aop.mc.int>2.2.0.Alpha2</version.jboss.aop.mc.int>
</properties>
<!-- Dependencies -->
<dependencies>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-aop-mc-int</artifactId>
<version>${version.jboss.aop.mc.int}</version>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>javax.ejb</groupId>
15 years, 11 months
JBoss-OSGI SVN: r99389 - projects/jboss-osgi/projects/runtime/framework/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2010-01-14 03:58:39 -0500 (Thu, 14 Jan 2010)
New Revision: 99389
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml
Log:
Use Kernel 2.2.0.Alpha2.
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml 2010-01-14 08:53:48 UTC (rev 99388)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml 2010-01-14 08:58:39 UTC (rev 99389)
@@ -50,7 +50,7 @@
<version.jboss.aop>2.1.0.CR3</version.jboss.aop>
<version.jboss.classloading>2.0.8.GA</version.jboss.classloading>
<version.jboss.deployers>2.2.0.Alpha1</version.jboss.deployers>
- <version.jboss.kernel>2.2.0.Alpha1</version.jboss.kernel>
+ <version.jboss.kernel>2.2.0.Alpha2</version.jboss.kernel>
<version.jboss.osgi.apache.xerces>2.9.1.SP3</version.jboss.osgi.apache.xerces>
<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>
15 years, 11 months
JBoss-OSGI SVN: r99356 - in projects/jboss-osgi: projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-13 15:12:32 -0500 (Wed, 13 Jan 2010)
New Revision: 99356
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiSystemState.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle/SystemBundleUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/smoke/OSGiSmokeTestCase.java
projects/jboss-osgi/trunk/reactor/pom.xml
Log:
Default to Bundle-ManifestVersion: 2
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2010-01-13 19:57:37 UTC (rev 99355)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2010-01-13 20:12:32 UTC (rev 99356)
@@ -402,6 +402,7 @@
Attributes attributes = manifest.getMainAttributes();
attributes.put(new Name(Constants.BUNDLE_NAME), unit.getName());
attributes.put(new Name(Constants.BUNDLE_SYMBOLICNAME), unit.getName());
+ attributes.put(new Name(Constants.BUNDLE_MANIFESTVERSION), "2");
osgiMetaData = new AbstractOSGiMetaData(manifest);
unit.addAttachment(OSGiMetaData.class, osgiMetaData);
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiSystemState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiSystemState.java 2010-01-13 19:57:37 UTC (rev 99355)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiSystemState.java 2010-01-13 20:12:32 UTC (rev 99356)
@@ -61,6 +61,7 @@
Attributes attributes = manifest.getMainAttributes();
attributes.put(new Name(Constants.BUNDLE_NAME), Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
attributes.put(new Name(Constants.BUNDLE_SYMBOLICNAME), Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
+ attributes.put(new Name(Constants.BUNDLE_MANIFESTVERSION), "2");
osgiMetaData = new AbstractOSGiMetaData(manifest);
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle/SystemBundleUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle/SystemBundleUnitTestCase.java 2010-01-13 19:57:37 UTC (rev 99355)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle/SystemBundleUnitTestCase.java 2010-01-13 20:12:32 UTC (rev 99356)
@@ -94,6 +94,7 @@
Dictionary expected = new Hashtable();
expected.put(Constants.BUNDLE_NAME, Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
expected.put(Constants.BUNDLE_SYMBOLICNAME, Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
+ expected.put(Constants.BUNDLE_MANIFESTVERSION, "2");
// todo expected.put(Attributes.Name.IMPLEMENTATION_TITLE.toString(), "JBoss OSGi");
// todo expected.put(Attributes.Name.IMPLEMENTATION_VENDOR.toString(), "jboss.org");
// todo expected.put(Attributes.Name.IMPLEMENTATION_VERSION.toString(), "r4v41");
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/smoke/OSGiSmokeTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/smoke/OSGiSmokeTestCase.java 2010-01-13 19:57:37 UTC (rev 99355)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/smoke/OSGiSmokeTestCase.java 2010-01-13 20:12:32 UTC (rev 99356)
@@ -109,7 +109,6 @@
{
Manifest manifest = new Manifest();
Attributes attributes = manifest.getMainAttributes();
- attributes.putValue("Bundle-Name", "SmokeDeployment");
attributes.putValue("Bundle-SymbolicName", "org.jboss.test.osgi.smoke.deployment");
OSGiMetaData metaData = new AbstractOSGiMetaData(manifest);
Bundle bundle = deployBundle("smoke-deployment", metaData, A.class);
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2010-01-13 19:57:37 UTC (rev 99355)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2010-01-13 20:12:32 UTC (rev 99356)
@@ -18,7 +18,7 @@
To pull in a particular subproject, set one or more svn:external definitions. For example
- framework https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
+ ../../projects/runtime/framework/trunk framework
<module>framework</module>
15 years, 11 months
JBoss-OSGI SVN: r99354 - 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-13 13:15:51 -0500 (Wed, 13 Jan 2010)
New Revision: 99354
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateAddDeployer.java
projects/jboss-osgi/trunk/reactor/
Log:
Fix relative paths in svn:externals
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateAddDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateAddDeployer.java 2010-01-13 17:58:53 UTC (rev 99353)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateAddDeployer.java 2010-01-13 18:15:51 UTC (rev 99354)
@@ -30,9 +30,8 @@
/**
* OSGiBundleStateDeployer.<p>
*
- * This deployer creates a bundle state object for all top level deployments
- * regardless of whether they are OSGi deployments or not. TODO - this is not true!
- *
+ * This deployer creates a bundle state object for all top level bundle deployments.
+ *
* Note: undeploy/remove part is in a separate deployer.
*
* @author <a href="adrian(a)jboss.com">Adrian Brock</a>
Property changes on: projects/jboss-osgi/trunk/reactor
___________________________________________________________________
Name: svn:externals
- framework https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
+ ../../projects/runtime/framework/trunk framework
15 years, 11 months
JBoss-OSGI SVN: r99346 - in projects/jboss-osgi/projects/runtime/framework/trunk: src/main/java/org/jboss/osgi/framework/bundle and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2010-01-13 11:44:19 -0500 (Wed, 13 Jan 2010)
New Revision: 99346
Added:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/FilterParserAndMatcher.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/MANIFEST.MF
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/jboss-beans.xml
Removed:
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/MANIFEST.MF
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/jboss-beans.xml
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans1/META-INF/MANIFEST.MF
Log:
Update MC libs and bring back the service-mix test.
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml 2010-01-13 16:41:46 UTC (rev 99345)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml 2010-01-13 16:44:19 UTC (rev 99346)
@@ -49,8 +49,8 @@
<version.drools>5.0.1</version.drools>
<version.jboss.aop>2.1.0.CR3</version.jboss.aop>
<version.jboss.classloading>2.0.8.GA</version.jboss.classloading>
- <version.jboss.deployers>2.2.0-SNAPSHOT</version.jboss.deployers>
- <version.jboss.kernel>2.2.0-SNAPSHOT</version.jboss.kernel>
+ <version.jboss.deployers>2.2.0.Alpha1</version.jboss.deployers>
+ <version.jboss.kernel>2.2.0.Alpha1</version.jboss.kernel>
<version.jboss.osgi.apache.xerces>2.9.1.SP3</version.jboss.osgi.apache.xerces>
<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>
Added: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/FilterParserAndMatcher.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/FilterParserAndMatcher.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/FilterParserAndMatcher.java 2010-01-13 16:44:19 UTC (rev 99346)
@@ -0,0 +1,90 @@
+/*
+* 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.bundle;
+
+import java.util.Dictionary;
+import java.util.Set;
+
+import org.jboss.beans.metadata.api.model.QualifierContent;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.spi.qualifier.QualifierMatcher;
+import org.jboss.kernel.spi.qualifier.QualifierParser;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.metadata.spi.scope.CommonLevels;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+
+/**
+ * OSGi filter parsing and matching.
+ *
+ * @author <a href="ales.justin(a)jboss.org">Ales Justin</a>
+ */
+class FilterParserAndMatcher implements QualifierParser, QualifierMatcher<Filter>
+{
+ static final FilterParserAndMatcher INSTANCE = new FilterParserAndMatcher();
+
+ private FilterParserAndMatcher()
+ {
+ }
+
+ public Class<Filter> getHandledType()
+ {
+ return Filter.class;
+ }
+
+ public QualifierContent getHandledContent()
+ {
+ return QualifierContent.getContent("filter");
+ }
+
+ public boolean matches(ControllerContext context, Set<Object> suppliedQualifiers, Filter filter)
+ {
+ MetaData metaData = context.getScopeInfo().getMetaData();
+ if (metaData == null)
+ return false;
+
+ MetaData instanceMD = metaData.getScopeMetaData(CommonLevels.INSTANCE);
+ if (instanceMD == null)
+ return false;
+
+ Dictionary dictionary = instanceMD.getMetaData(Dictionary.class);
+ return dictionary != null && filter.match(dictionary);
+ }
+
+ public Object parseWanted(ClassLoader cl, Object rawQualifier)
+ {
+ try
+ {
+ return FrameworkUtil.createFilter(String.valueOf(rawQualifier));
+ }
+ catch (InvalidSyntaxException e)
+ {
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ public Object parseSupplied(ClassLoader cl, Object rawQualifier)
+ {
+ return parseWanted(cl, rawQualifier);
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2010-01-13 16:41:46 UTC (rev 99345)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2010-01-13 16:44:19 UTC (rev 99346)
@@ -46,8 +46,8 @@
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.jar.Attributes;
+import java.util.jar.Attributes.Name;
import java.util.jar.Manifest;
-import java.util.jar.Attributes.Name;
import org.jboss.dependency.spi.Controller;
import org.jboss.dependency.spi.ControllerContext;
@@ -68,9 +68,10 @@
import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.qualifier.QualifierMatchers;
import org.jboss.logging.Logger;
import org.jboss.metadata.plugins.loader.memory.MemoryMetaDataLoader;
-import org.jboss.metadata.spi.loader.MutableMetaDataLoader;
+import org.jboss.metadata.spi.MutableMetaData;
import org.jboss.metadata.spi.repository.MutableMetaDataRepository;
import org.jboss.metadata.spi.retrieval.MetaDataRetrieval;
import org.jboss.metadata.spi.retrieval.MetaDataRetrievalFactory;
@@ -150,6 +151,8 @@
private MainDeployerStructure deployerStructure;
/** The deployment registry */
private DeploymentRegistry registry;
+ /** The previous context tracker */
+ private ContextTracker previousTracker;
/** The instance metadata factory */
private MetaDataRetrievalFactory factory;
/** The executor */
@@ -264,23 +267,37 @@
retrieval = new MemoryMetaDataLoader(ScopeKey.DEFAULT_SCOPE);
repository.addMetaDataRetrieval(retrieval);
}
- if (retrieval != null && retrieval instanceof MutableMetaDataLoader)
+ if (retrieval != null && retrieval instanceof MutableMetaData)
{
- MutableMetaDataLoader mmdl = (MutableMetaDataLoader)retrieval;
+ MutableMetaData mmd = (MutableMetaData)retrieval;
if (register)
{
- mmdl.addMetaData(systemBundle, ContextTracker.class);
+ previousTracker = mmd.addMetaData(systemBundle, ContextTracker.class);
}
else
{
- mmdl.removeMetaData(ContextTracker.class);
- if (mmdl.isEmpty())
- repository.removeMetaDataRetrieval(mmdl.getScope());
+ if (previousTracker == null)
+ {
+ mmd.removeMetaData(ContextTracker.class);
+ if (retrieval.isEmpty())
+ repository.removeMetaDataRetrieval(retrieval.getScope());
+ }
+ else
+ {
+ mmd.addMetaData(previousTracker, ContextTracker.class);
+ }
}
}
+ // osgi ldap filter parsing and matching
+ FilterParserAndMatcher fpm = FilterParserAndMatcher.INSTANCE;
+ QualifierMatchers matchers = QualifierMatchers.getInstance();
+
if (register)
{
+ matchers.addParser(fpm);
+ matchers.addMatcher(fpm);
+
MetaDataRetrievalFactory mdrFactory = factory;
if (mdrFactory == null)
{
@@ -296,6 +313,9 @@
else
{
repository.removeMetaDataRetrievalFactory(CommonLevels.INSTANCE);
+
+ matchers.removeParser(fpm.getHandledContent());
+ matchers.removeMatcher(fpm.getHandledType());
}
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2010-01-13 16:41:46 UTC (rev 99345)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2010-01-13 16:44:19 UTC (rev 99346)
@@ -460,6 +460,47 @@
}
}
+ public void testServiceInjection() throws Throwable
+ {
+ Bundle bundle = installBundle(assembleBundle("simple2", "/bundles/service/service-bundle2", A.class));
+ try
+ {
+ bundle.start();
+ BundleContext bundleContext1 = bundle.getBundleContext();
+ assertNotNull(bundleContext1);
+
+ Class<?> aClass = bundle.loadClass(A.class.getName());
+ Object a = aClass.newInstance();
+ Hashtable<String, Object> table = new Hashtable<String, Object>();
+ table.put("a", "b");
+ ServiceRegistration reg1 = bundleContext1.registerService(A.class.getName(), a, table);
+ assertNotNull(reg1);
+
+ AssembledDirectory mix = createAssembledDirectory("beans1", "");
+ addPath(mix, "/bundles/service/service-beans2", "");
+ addPackage(mix, C.class);
+ Deployment deployment = assertDeploy(mix);
+ try
+ {
+ checkComplete();
+
+ Bundle beans = getBundle(getDeploymentUnit(deployment));
+ beans.start();
+
+ Object c = getBean("C");
+ assertEquals(a, getter(c, "getA", "C"));
+ }
+ finally
+ {
+ undeploy(deployment);
+ }
+ }
+ finally
+ {
+ uninstall(bundle);
+ }
+ }
+
public void testFiltering() throws Throwable
{
Deployment bean = addBean("beanA", A.class);
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans1/META-INF/MANIFEST.MF
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans1/META-INF/MANIFEST.MF 2010-01-13 16:41:46 UTC (rev 99345)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans1/META-INF/MANIFEST.MF 2010-01-13 16:44:19 UTC (rev 99346)
@@ -2,6 +2,6 @@
Implementation-Title: JBoss OSGi tests
Implementation-Version: test
Implementation-Vendor: jboss.org
-Bundle-Name: Service1
-Bundle-SymbolicName: org.jboss.test.osgi.service1
+Bundle-Name: Beans1
+Bundle-SymbolicName: org.jboss.test.osgi.beans1
Export-Package: org.jboss.test.osgi.service.support.a
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2 (from rev 99343, projects/jboss-osgi/projects/runtime/framework/branches/alesj/src/test/resources/bundles/service/service-beans2)
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF (from rev 99343, projects/jboss-osgi/projects/runtime/framework/branches/alesj/src/test/resources/bundles/service/service-beans2/META-INF)
Deleted: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/MANIFEST.MF
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/branches/alesj/src/test/resources/bundles/service/service-beans2/META-INF/MANIFEST.MF 2010-01-13 14:51:43 UTC (rev 99343)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/MANIFEST.MF 2010-01-13 16:44:19 UTC (rev 99346)
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Implementation-Title: JBoss OSGi tests
-Implementation-Version: test
-Implementation-Vendor: jboss.org
-Bundle-Name: Beans2
-Bundle-SymbolicName: org.jboss.test.osgi.beans2
-Export-Package: org.jboss.test.osgi.service.support.c
-Import-Package: org.jboss.test.osgi.service.support.a
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/MANIFEST.MF (from rev 99343, projects/jboss-osgi/projects/runtime/framework/branches/alesj/src/test/resources/bundles/service/service-beans2/META-INF/MANIFEST.MF)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/MANIFEST.MF (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/MANIFEST.MF 2010-01-13 16:44:19 UTC (rev 99346)
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Implementation-Title: JBoss OSGi tests
+Implementation-Version: test
+Implementation-Vendor: jboss.org
+Bundle-Name: Beans2
+Bundle-SymbolicName: org.jboss.test.osgi.beans2
+Export-Package: org.jboss.test.osgi.service.support.c
+Import-Package: org.jboss.test.osgi.service.support.a
Deleted: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/jboss-beans.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/branches/alesj/src/test/resources/bundles/service/service-beans2/META-INF/jboss-beans.xml 2010-01-13 14:51:43 UTC (rev 99343)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/jboss-beans.xml 2010-01-13 16:44:19 UTC (rev 99346)
@@ -1,11 +0,0 @@
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <bean name="C" class="org.jboss.test.osgi.service.support.c.C">
- <property name="a">
- <inject>
- <qualifier content="filter" type="required">(a=b)</qualifier>
- </inject>
- </property>
- </bean>
-
-</deployment>
\ No newline at end of file
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/jboss-beans.xml (from rev 99343, projects/jboss-osgi/projects/runtime/framework/branches/alesj/src/test/resources/bundles/service/service-beans2/META-INF/jboss-beans.xml)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/jboss-beans.xml (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-beans2/META-INF/jboss-beans.xml 2010-01-13 16:44:19 UTC (rev 99346)
@@ -0,0 +1,11 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="C" class="org.jboss.test.osgi.service.support.c.C">
+ <property name="a">
+ <inject>
+ <qualifier content="filter" type="required">(a=b)</qualifier>
+ </inject>
+ </property>
+ </bean>
+
+</deployment>
\ No newline at end of file
15 years, 11 months
JBoss-OSGI SVN: r99339 - in projects/jboss-osgi/projects/runtime/framework/trunk/src: main/java/org/jboss/osgi/framework/deployers and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-13 08:39:48 -0500 (Wed, 13 Jan 2010)
New Revision: 99339
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleCapability.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleRequirement.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/OSGiFragmentClassLoadingDeployer.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/classloader/RequireBundleUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java
Log:
Simplify Bundle Capability/Requirement
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleCapability.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleCapability.java 2010-01-13 13:31:40 UTC (rev 99338)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleCapability.java 2010-01-13 13:39:48 UTC (rev 99339)
@@ -26,6 +26,7 @@
import org.jboss.classloading.plugins.metadata.ModuleCapability;
import org.jboss.classloading.spi.dependency.Module;
import org.jboss.classloading.spi.metadata.Requirement;
+import org.jboss.classloading.spi.version.VersionRange;
import org.jboss.osgi.framework.bundle.AbstractBundleState;
import org.jboss.osgi.framework.metadata.OSGiMetaData;
import org.jboss.osgi.framework.metadata.Parameter;
@@ -66,7 +67,7 @@
return new OSGiBundleCapability(symbolicName, version, bundleState);
}
-
+
/**
* Create a new OSGiBundleCapability.
*
@@ -82,7 +83,7 @@
throw new IllegalArgumentException("Null bundleState");
this.bundleState = bundleState;
}
-
+
/**
* Get the metadata.
*
@@ -100,33 +101,34 @@
return false;
if (requirement instanceof OSGiBundleRequirement == false)
return true;
-
+
// Review its not clear to me from the spec whether attribute matching
// beyond the version should work for require-bundle?
- OSGiBundleRequirement bundleRequirement = (OSGiBundleRequirement) requirement;
- OSGiMetaData osgiMetaData = getMetaData();
- ParameterizedAttribute ourParameters = osgiMetaData.getBundleParameters();
- ParameterizedAttribute otherParameters = bundleRequirement.getRequireBundle();
- if (otherParameters != null)
+ Version ourVersion = Version.parseVersion(getMetaData().getBundleVersion());
+ OSGiBundleRequirement bundleRequirement = (OSGiBundleRequirement)requirement;
+ VersionRange requiredRange = bundleRequirement.getVersionRange();
+ if (requiredRange.isInRange(ourVersion) == false)
+ return false;
+
+ ParameterizedAttribute ourParameters = getMetaData().getBundleParameters();
+ if (ourParameters == null)
+ return false;
+
+ Map<String, Parameter> params = bundleRequirement.getAttributes();
+ if (params != null && params.isEmpty() == false)
{
- Map<String, Parameter> params = otherParameters.getAttributes();
- if (params != null && params.isEmpty() == false)
+ for (String name : params.keySet())
{
- for (String name : params.keySet())
- {
- if (Constants.BUNDLE_VERSION_ATTRIBUTE.equals(name) == false)
- {
- if (ourParameters == null)
- return false;
- String ourValue = ourParameters.getAttributeValue(name, String.class);
- if (ourValue == null)
- return false;
- if (ourValue.equals(otherParameters.getAttributeValue(name, String.class)) == false)
- return false;
- }
- }
+ if (Constants.BUNDLE_VERSION_ATTRIBUTE.equals(name))
+ continue;
+
+ String reqValue = (String)params.get(name).getValue();
+ String ourValue = ourParameters.getAttributeValue(name, String.class);
+ if (reqValue.equals(ourValue) == false)
+ return false;
}
}
+
return true;
}
@@ -137,9 +139,9 @@
return true;
if (obj == null || obj instanceof OSGiBundleCapability == false)
return false;
- if (super.equals(obj) ==false)
+ if (super.equals(obj) == false)
return false;
- OSGiBundleCapability other = (OSGiBundleCapability) obj;
+ OSGiBundleCapability other = (OSGiBundleCapability)obj;
return getMetaData().equals(other.getMetaData());
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleRequirement.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleRequirement.java 2010-01-13 13:31:40 UTC (rev 99338)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleRequirement.java 2010-01-13 13:39:48 UTC (rev 99339)
@@ -21,6 +21,8 @@
*/
package org.jboss.osgi.framework.classloading;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.Map;
import org.jboss.classloading.plugins.metadata.ModuleRequirement;
@@ -42,10 +44,11 @@
{
/** The serialVersionUID */
private static final long serialVersionUID = 4264597072894634275L;
-
- /** The attributes */
- private ParameterizedAttribute requireBundle;
+ private String visibility;
+ private String resolution;
+ private Map<String, Parameter> attributes;
+
/**
* Create a new OSGiBundleRequirement.
*
@@ -59,49 +62,61 @@
throw new IllegalArgumentException("Null require bundle");
String name = requireBundle.getAttribute();
-
+
AbstractVersionRange range = null;
String version = requireBundle.getAttributeValue(Constants.BUNDLE_VERSION_ATTRIBUTE, String.class);
if (version != null)
- range = (AbstractVersionRange) AbstractVersionRange.valueOf(version);
+ range = (AbstractVersionRange)AbstractVersionRange.valueOf(version);
- return new OSGiBundleRequirement(name, range, requireBundle);
+ String visibility = requireBundle.getDirectiveValue(Constants.VISIBILITY_DIRECTIVE, String.class);
+ String resolution = requireBundle.getDirectiveValue(Constants.RESOLUTION_DIRECTIVE, String.class);
+ Map<String, Parameter> attributes = requireBundle.getAttributes();
+
+ return new OSGiBundleRequirement(name, range, visibility, resolution, attributes);
}
-
+
/**
- * Create a new OSGiBundleRequirement.
+ * Create a new bundle requirement.
*
- * @param name the name
- * @param versionRange the version range - pass null for all versions
- * @param requireBundle the require bundle metadata
- * @throws IllegalArgumentException for a null name or requireBundle
+ * @param name the symbolic name of the required bundle
+ * @param versionRange the version range of the required bundle
*/
- public OSGiBundleRequirement(String name, VersionRange versionRange, ParameterizedAttribute requireBundle)
+ public static OSGiBundleRequirement create(String name, VersionRange versionRange)
{
+ return new OSGiBundleRequirement(name, versionRange, Constants.VISIBILITY_PRIVATE, Constants.RESOLUTION_MANDATORY, null);
+ }
+
+ /**
+ * Create a new OSGiBundleRequirement.
+ */
+ private OSGiBundleRequirement(String name, VersionRange versionRange, String visDirective, String resDirective, Map<String, Parameter> attrMap)
+ {
super(name, versionRange);
- if (requireBundle == null)
- throw new IllegalArgumentException("Null requireBundle");
- this.requireBundle = requireBundle;
- String visibility = requireBundle.getDirectiveValue(Constants.VISIBILITY_DIRECTIVE, String.class);
+ attributes = attrMap;
+ if (attributes == null)
+ attributes = new HashMap<String, Parameter>();
+
+ visibility = visDirective;
+ if (visibility == null)
+ visibility = Constants.VISIBILITY_PRIVATE;
+
+ resolution = resDirective;
+ if (resolution == null)
+ resolution = Constants.RESOLUTION_MANDATORY;
+
if (Constants.VISIBILITY_REEXPORT.equals(visibility))
setReExport(true);
- String resolution = requireBundle.getDirectiveValue(Constants.RESOLUTION_DIRECTIVE, String.class);
if (Constants.RESOLUTION_OPTIONAL.equals(resolution))
setOptional(true);
}
-
- /**
- * Get the requireBundle metadata.
- *
- * @return the requireBundle.
- */
- public ParameterizedAttribute getRequireBundle()
+
+ public Map<String, Parameter> getAttributes()
{
- return requireBundle;
+ return Collections.unmodifiableMap(attributes);
}
-
+
@Override
public boolean equals(Object obj)
{
@@ -109,9 +124,9 @@
return true;
if (obj == null || obj instanceof OSGiBundleRequirement == false)
return false;
- if (super.equals(obj) ==false)
+ if (super.equals(obj) == false)
return false;
-
+
return true;
}
@@ -119,8 +134,10 @@
protected void toString(StringBuffer buffer)
{
super.toString(buffer);
- Map<String, Parameter> parameters = requireBundle.getAttributes();
- if (parameters != null && parameters.isEmpty() == false)
- buffer.append(" attributes=").append(parameters);
+ if (attributes.containsKey(Constants.VISIBILITY_DIRECTIVE) == false)
+ buffer.append(Constants.VISIBILITY_DIRECTIVE + ":=" + visibility);
+ if (attributes.containsKey(Constants.RESOLUTION_DIRECTIVE) == false)
+ buffer.append(Constants.RESOLUTION_DIRECTIVE + ":=" + resolution);
+ buffer.append(attributes);
}
}
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-13 13:31:40 UTC (rev 99338)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java 2010-01-13 13:39:48 UTC (rev 99339)
@@ -112,7 +112,7 @@
{
if (fragmentLoaders == null)
fragmentLoaders = new ArrayList<DelegateLoader>();
-
+
fragmentLoaders.add(delegateLoader);
}
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-13 13:31:40 UTC (rev 99338)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiClassLoadingDeployer.java 2010-01-13 13:39:48 UTC (rev 99339)
@@ -56,7 +56,7 @@
{
private ClassLoaderDomain domain;
private ClassLoaderFactory factory;
-
+
public AbstractOSGiClassLoadingDeployer()
{
super(OSGiMetaData.class);
@@ -70,7 +70,7 @@
{
this.domain = domain;
}
-
+
public void setFactory(ClassLoaderFactory factory)
{
this.factory = factory;
@@ -85,9 +85,9 @@
AbstractBundleState bundleState = unit.getAttachment(AbstractBundleState.class);
if (bundleState == null)
throw new IllegalStateException("No bundle state");
-
+
OSGiBundleManager bundleManager = bundleState.getBundleManager();
-
+
OSGiClassLoadingMetaData classLoadingMetaData = new OSGiClassLoadingMetaData();
classLoadingMetaData.setName(bundleState.getSymbolicName());
classLoadingMetaData.setVersion(bundleState.getVersion());
@@ -95,10 +95,10 @@
CapabilitiesMetaData capabilities = classLoadingMetaData.getCapabilities();
RequirementsMetaData requirements = classLoadingMetaData.getRequirements();
-
+
OSGiBundleCapability bundleCapability = OSGiBundleCapability.create(bundleState);
capabilities.addCapability(bundleCapability);
-
+
List<ParameterizedAttribute> requireBundles = osgiMetaData.getRequireBundles();
if (requireBundles != null && requireBundles.isEmpty() == false)
{
@@ -108,17 +108,17 @@
requirements.addRequirement(requirement);
}
}
-
+
List<PackageAttribute> exported = osgiMetaData.getExportPackages();
if (exported != null && exported.isEmpty() == false)
{
for (PackageAttribute packageAttribute : exported)
{
- OSGiPackageCapability packageCapability = OSGiPackageCapability.create(bundleState, packageAttribute);
+ OSGiPackageCapability packageCapability = OSGiPackageCapability.create(bundleState, packageAttribute);
capabilities.addCapability(packageCapability);
}
}
-
+
List<PackageAttribute> imported = osgiMetaData.getImportPackages();
if (imported != null && imported.isEmpty() == false)
{
@@ -126,22 +126,22 @@
for (PackageAttribute packageAttribute : imported)
{
String packageName = packageAttribute.getAttribute();
-
+
// [TODO] Should system packages be added as capabilities?
boolean isSystemPackage = syspackPlugin.isSystemPackage(packageName);
if (isSystemPackage == false)
{
- OSGiPackageRequirement requirement = OSGiPackageRequirement.create(bundleState, packageAttribute);
+ OSGiPackageRequirement requirement = OSGiPackageRequirement.create(bundleState, packageAttribute);
requirements.addRequirement(requirement);
}
}
}
-
+
unit.addAttachment(ClassLoadingMetaData.class, classLoadingMetaData);
// AnnotationMetaDataDeployer.ANNOTATION_META_DATA_COMPLETE
unit.addAttachment("org.jboss.deployment.annotation.metadata.complete", Boolean.TRUE);
-
+
// Add the OSGi ClassLoaderFactory if configured
if (factory != null)
unit.addAttachment(ClassLoaderFactory.class, factory);
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentClassLoadingDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentClassLoadingDeployer.java 2010-01-13 13:31:40 UTC (rev 99338)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentClassLoadingDeployer.java 2010-01-13 13:39:48 UTC (rev 99339)
@@ -48,25 +48,33 @@
public void deploy(DeploymentUnit unit, OSGiMetaData osgiMetaData) throws DeploymentException
{
super.deploy(unit, osgiMetaData);
-
+
// Return if this is not a bundle fragment
AbstractBundleState bundleState = unit.getAttachment(AbstractBundleState.class);
if (bundleState.isFragment() == false)
return;
-
+
OSGiClassLoadingMetaData classLoadingMetaData = (OSGiClassLoadingMetaData)unit.getAttachment(ClassLoadingMetaData.class);
-
+
// Initialize the Fragment-Host
ParameterizedAttribute hostAttr = osgiMetaData.getFragmentHost();
FragmentHostMetaData fragmentHost = new FragmentHostMetaData(hostAttr.getAttribute());
classLoadingMetaData.setFragmentHost(fragmentHost);
-
+
Parameter bundleVersionAttr = hostAttr.getAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE);
if (bundleVersionAttr != null)
fragmentHost.setBundleVersion((Version)bundleVersionAttr.getValue());
-
+
Parameter extensionDirective = hostAttr.getDirective(Constants.EXTENSION_DIRECTIVE);
if (extensionDirective != null)
fragmentHost.setExtension((String)extensionDirective.getValue());
+
+ // TODO Modify the CL metadata of the host such that eventually the CL policy
+ // contains a DelegateLoader for the attached fragment
+
+ // Adding the fragment as an OSGiBundleRequirement to the host does not work because
+ // those requirements end up as DependencyItems already during the INSTALL phase.
+ // Remember to do equivalent code in OSGiBundleClassLoadingDeployer
+ // in case the fragment gets installed before the host.
}
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/classloader/RequireBundleUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/classloader/RequireBundleUnitTestCase.java 2010-01-13 13:31:40 UTC (rev 99338)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/classloader/RequireBundleUnitTestCase.java 2010-01-13 13:39:48 UTC (rev 99339)
@@ -317,11 +317,17 @@
public void testAttributeRequireBundleFails() throws Exception
{
+ // Bundle-SymbolicName: org.jboss.test.osgi.classloader.bundleA;test=x
+ // Export-Package: org.jboss.test.osgi.classloader.support.a;version=1.0.0;test=x
+ // Bundle-Version: 1.0.0
Bundle bundle1 = installBundle(assembleBundle("bundleA", "/bundles/classloader/bundleA", A.class));
try
{
bundle1.start();
assertLoadClass(bundle1, A.class);
+
+ // Bundle-SymbolicName: org.jboss.test.osgi.classloader.bundleB
+ // Require-Bundle: org.jboss.test.osgi.classloader.bundleA;doesnotexist=true;test=y
Bundle bundle2 = installBundle(assembleBundle("attributerequirebundlefails", "/bundles/classloader/attributerequirebundlefails", B.class));
try
{
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java 2010-01-13 13:31:40 UTC (rev 99338)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java 2010-01-13 13:39:48 UTC (rev 99339)
@@ -307,14 +307,14 @@
// Clarify error behaviour when fragments fail to attach
// https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1524
- //
- // Felix: Merges FragC Require-Bundle into HostA and fails to resolve
+
// Equinox: Resolves HostA but does not attach FragA
if (hostA.getState() == Bundle.ACTIVE)
assertBundleState(Bundle.INSTALLED, fragC.getState());
}
catch (BundleException ex)
{
+ // Felix: Merges FragC's bundle requirement into HostA and fails to resolve
assertBundleState(Bundle.INSTALLED, hostA.getState());
}
15 years, 11 months
JBoss-OSGI SVN: r99305 - projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-12 12:45:11 -0500 (Tue, 12 Jan 2010)
New Revision: 99305
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java
Log:
[JBOSGI-245] Framework fragments
Add @Ignore for unsupported functionality
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java 2010-01-12 17:29:06 UTC (rev 99304)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java 2010-01-12 17:45:11 UTC (rev 99305)
@@ -36,6 +36,7 @@
import org.jboss.test.osgi.fragments.subA.SubBeanA;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -169,14 +170,9 @@
}
@Test
+ @Ignore
public void testHiddenPrivatePackage() throws Exception
{
- if (framework != null)
- {
- System.out.println("FIXME [JBOSGI-245] Framework fragments");
- return;
- }
-
// Bundle-SymbolicName: simple-hostA
// Private-Package: org.jboss.test.osgi.fragments.hostA, org.jboss.test.osgi.fragments.subA
Bundle hostA = context.installBundle(getTestArchivePath("fragments-simple-hostA.jar"));
@@ -214,14 +210,9 @@
}
@Test
+ @Ignore
public void testFragmentExportsPackage() throws Exception
{
- if (framework != null)
- {
- System.out.println("FIXME [JBOSGI-245] Framework fragments");
- return;
- }
-
// Bundle-SymbolicName: simple-hostA
// Private-Package: org.jboss.test.osgi.fragments.hostA, org.jboss.test.osgi.fragments.subA
Bundle hostA = context.installBundle(getTestArchivePath("fragments-simple-hostA.jar"));
@@ -294,14 +285,9 @@
}
@Test
+ @Ignore
public void testFragmentRequireBundle() throws Exception
{
- if (framework != null)
- {
- System.out.println("FIXME [JBOSGI-245] Framework fragments");
- return;
- }
-
// Bundle-SymbolicName: simple-hostA
// Private-Package: org.jboss.test.osgi.fragments.hostA, org.jboss.test.osgi.fragments.subA
Bundle hostA = context.installBundle(getTestArchivePath("fragments-simple-hostA.jar"));
15 years, 11 months
JBoss-OSGI SVN: r99304 - in projects/jboss-osgi: projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers and 6 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-01-12 12:29:06 -0500 (Tue, 12 Jan 2010)
New Revision: 99304
Added:
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/fragA/
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/fragB/
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/fragC/
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/hostA/HostAActivator.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/hostB/
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/hostC/
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/subA/
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-fragA.bnd
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-fragB.bnd
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-fragC.bnd
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostA.bnd
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostB.bnd
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostC.bnd
Removed:
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/frgmA/
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/hostA/FragmentHostActivator.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-frgmA.bnd
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostA.bnd
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/scripts/antrun-test-jars.xml
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/OSGiBundleClassLoadingDeployer.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentClassLoadingDeployer.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
Log:
[JBOSGI-245] Framework fragments
Add more test coverage
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/scripts/antrun-test-jars.xml 2010-01-12 17:01:54 UTC (rev 99303)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/scripts/antrun-test-jars.xml 2010-01-12 17:29:06 UTC (rev 99304)
@@ -54,6 +54,14 @@
</fileset>
</war>
+ <!-- fragments/simple -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/fragments-simple-hostA.jar" files="${tests.resources.dir}/fragments/simple-hostA.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/fragments-simple-hostB.jar" files="${tests.resources.dir}/fragments/simple-hostB.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/fragments-simple-hostC.jar" files="${tests.resources.dir}/fragments/simple-hostC.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/fragments-simple-fragA.jar" files="${tests.resources.dir}/fragments/simple-fragA.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/fragments-simple-fragB.jar" files="${tests.resources.dir}/fragments/simple-fragB.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/fragments-simple-fragC.jar" files="${tests.resources.dir}/fragments/simple-fragC.bnd" />
+
<!-- simple -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/simple-bundle.jar" files="${tests.resources.dir}/integration/simple/simple.bnd" />
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/simple-logservice-bundle.jar" files="${tests.resources.dir}/integration/simple/simple-logservice.bnd" />
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-12 17:01:54 UTC (rev 99303)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiClassLoadingDeployer.java 2010-01-12 17:29:06 UTC (rev 99304)
@@ -23,16 +23,28 @@
// $Id$
+import java.util.List;
+
import org.jboss.classloader.spi.ClassLoaderDomain;
+import org.jboss.classloading.spi.metadata.CapabilitiesMetaData;
import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.classloading.spi.metadata.RequirementsMetaData;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentStages;
import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
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.classloading.OSGiBundleCapability;
+import org.jboss.osgi.framework.classloading.OSGiBundleRequirement;
import org.jboss.osgi.framework.classloading.OSGiClassLoadingMetaData;
+import org.jboss.osgi.framework.classloading.OSGiPackageCapability;
+import org.jboss.osgi.framework.classloading.OSGiPackageRequirement;
import org.jboss.osgi.framework.metadata.OSGiMetaData;
+import org.jboss.osgi.framework.metadata.PackageAttribute;
+import org.jboss.osgi.framework.metadata.ParameterizedAttribute;
+import org.jboss.osgi.framework.plugins.SystemPackagesPlugin;
/**
* An abstract OSGi classloading deployer, that maps osgi metadata into classloading metadata.
@@ -74,11 +86,57 @@
if (bundleState == null)
throw new IllegalStateException("No bundle state");
+ OSGiBundleManager bundleManager = bundleState.getBundleManager();
+
OSGiClassLoadingMetaData classLoadingMetaData = new OSGiClassLoadingMetaData();
classLoadingMetaData.setName(bundleState.getSymbolicName());
classLoadingMetaData.setVersion(bundleState.getVersion());
classLoadingMetaData.setDomain(domain != null ? domain.getName() : null);
+ CapabilitiesMetaData capabilities = classLoadingMetaData.getCapabilities();
+ RequirementsMetaData requirements = classLoadingMetaData.getRequirements();
+
+ OSGiBundleCapability bundleCapability = OSGiBundleCapability.create(bundleState);
+ capabilities.addCapability(bundleCapability);
+
+ List<ParameterizedAttribute> requireBundles = osgiMetaData.getRequireBundles();
+ if (requireBundles != null && requireBundles.isEmpty() == false)
+ {
+ for (ParameterizedAttribute requireBundle : requireBundles)
+ {
+ OSGiBundleRequirement requirement = OSGiBundleRequirement.create(requireBundle);
+ requirements.addRequirement(requirement);
+ }
+ }
+
+ List<PackageAttribute> exported = osgiMetaData.getExportPackages();
+ if (exported != null && exported.isEmpty() == false)
+ {
+ for (PackageAttribute packageAttribute : exported)
+ {
+ OSGiPackageCapability packageCapability = OSGiPackageCapability.create(bundleState, packageAttribute);
+ capabilities.addCapability(packageCapability);
+ }
+ }
+
+ List<PackageAttribute> imported = osgiMetaData.getImportPackages();
+ if (imported != null && imported.isEmpty() == false)
+ {
+ SystemPackagesPlugin syspackPlugin = bundleManager.getPlugin(SystemPackagesPlugin.class);
+ for (PackageAttribute packageAttribute : imported)
+ {
+ String packageName = packageAttribute.getAttribute();
+
+ // [TODO] Should system packages be added as capabilities?
+ boolean isSystemPackage = syspackPlugin.isSystemPackage(packageName);
+ if (isSystemPackage == false)
+ {
+ OSGiPackageRequirement requirement = OSGiPackageRequirement.create(bundleState, packageAttribute);
+ requirements.addRequirement(requirement);
+ }
+ }
+ }
+
unit.addAttachment(ClassLoadingMetaData.class, classLoadingMetaData);
// AnnotationMetaDataDeployer.ANNOTATION_META_DATA_COMPLETE
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleClassLoadingDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleClassLoadingDeployer.java 2010-01-12 17:01:54 UTC (rev 99303)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleClassLoadingDeployer.java 2010-01-12 17:29:06 UTC (rev 99304)
@@ -23,23 +23,10 @@
// $Id: $
-import java.util.List;
-
-import org.jboss.classloading.spi.metadata.CapabilitiesMetaData;
-import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
-import org.jboss.classloading.spi.metadata.RequirementsMetaData;
import org.jboss.deployers.spi.DeploymentException;
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.classloading.OSGiBundleCapability;
-import org.jboss.osgi.framework.classloading.OSGiBundleRequirement;
-import org.jboss.osgi.framework.classloading.OSGiPackageCapability;
-import org.jboss.osgi.framework.classloading.OSGiPackageRequirement;
import org.jboss.osgi.framework.metadata.OSGiMetaData;
-import org.jboss.osgi.framework.metadata.PackageAttribute;
-import org.jboss.osgi.framework.metadata.ParameterizedAttribute;
-import org.jboss.osgi.framework.plugins.SystemPackagesPlugin;
/**
* An OSGi classloading deployer, that maps osgi metadata into classloading metadata
@@ -61,51 +48,6 @@
if (bundleState.isFragment())
return;
- OSGiBundleManager bundleManager = bundleState.getBundleManager();
-
- ClassLoadingMetaData classLoadingMetaData = unit.getAttachment(ClassLoadingMetaData.class);
- CapabilitiesMetaData capabilities = classLoadingMetaData.getCapabilities();
- RequirementsMetaData requirements = classLoadingMetaData.getRequirements();
-
- OSGiBundleCapability capability = OSGiBundleCapability.create(bundleState);
- capabilities.addCapability(capability);
-
- List<ParameterizedAttribute> requireBundles = osgiMetaData.getRequireBundles();
- if (requireBundles != null && requireBundles.isEmpty() == false)
- {
- for (ParameterizedAttribute requireBundle : requireBundles)
- {
- OSGiBundleRequirement requirement = OSGiBundleRequirement.create(requireBundle);
- requirements.addRequirement(requirement);
- }
- }
-
- List<PackageAttribute> exported = osgiMetaData.getExportPackages();
- if (exported != null && exported.isEmpty() == false)
- {
- for (PackageAttribute packageAttribute : exported)
- {
- OSGiPackageCapability packageCapability = OSGiPackageCapability.create(bundleState, packageAttribute);
- capabilities.addCapability(packageCapability);
- }
- }
-
- List<PackageAttribute> imported = osgiMetaData.getImportPackages();
- if (imported != null && imported.isEmpty() == false)
- {
- SystemPackagesPlugin syspackPlugin = bundleManager.getPlugin(SystemPackagesPlugin.class);
- for (PackageAttribute packageAttribute : imported)
- {
- String packageName = packageAttribute.getAttribute();
-
- // [TODO] Should system packages be added as capabilities?
- boolean isSystemPackage = syspackPlugin.isSystemPackage(packageName);
- if (isSystemPackage == false)
- {
- OSGiPackageRequirement requirement = OSGiPackageRequirement.create(bundleState, packageAttribute);
- requirements.addRequirement(requirement);
- }
- }
- }
+ // nothing special to do
}
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentClassLoadingDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentClassLoadingDeployer.java 2010-01-12 17:01:54 UTC (rev 99303)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentClassLoadingDeployer.java 2010-01-12 17:29:06 UTC (rev 99304)
@@ -55,8 +55,6 @@
return;
OSGiClassLoadingMetaData classLoadingMetaData = (OSGiClassLoadingMetaData)unit.getAttachment(ClassLoadingMetaData.class);
- if (classLoadingMetaData == null)
- throw new IllegalStateException("Null ClassLoadingMetaData");
// Initialize the Fragment-Host
ParameterizedAttribute hostAttr = osgiMetaData.getFragmentHost();
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments (from rev 99165, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments)
Deleted: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java 2010-01-08 15:37:37 UTC (rev 99165)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java 2010-01-12 17:29:06 UTC (rev 99304)
@@ -1,147 +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.fragments;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-
-import java.net.URL;
-
-import org.jboss.osgi.testing.OSGiBundle;
-import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
-import org.jboss.test.osgi.fragments.frgmA.FragmentService;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-
-/**
- * Test Fragment functionality
- *
- * @author thomas.diesler(a)jboss.com
- * @since 07-Jan-2010
- */
-public class FragmentTestCase extends OSGiTest
-{
- @Test
- public void testHostOnly() throws Exception
- {
- OSGiRuntime runtime = getDefaultRuntime();
- try
- {
- OSGiBundle host = runtime.installBundle("fragments-simple-hostA.jar");
- assertBundleState(Bundle.INSTALLED, host.getState());
-
- host.start();
- assertBundleState(Bundle.ACTIVE, host.getState());
-
- URL entryURL = host.getEntry("resources/resource.txt");
- assertNull("Entry URL null", entryURL);
-
- URL resourceURL = host.getResource("resources/resource.txt");
- assertNull("Resource URL null", resourceURL);
-
- host.uninstall();
- assertBundleState(Bundle.UNINSTALLED, host.getState());
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testFragmentOnly() throws Exception
- {
- OSGiRuntime runtime = getDefaultRuntime();
- try
- {
- OSGiBundle fragment = runtime.installBundle("fragments-simple-frgmA.jar");
- assertBundleState(Bundle.INSTALLED, fragment.getState());
-
- URL entryURL = fragment.getEntry("resources/resource.txt");
- assertNotNull("Entry URL not null", entryURL);
-
- URL resourceURL = fragment.getResource("resources/resource.txt");
- assertNull("Resource URL null", resourceURL);
-
- try
- {
- fragment.start();
- fail("Fragment bundles can not be started");
- }
- catch (BundleException e)
- {
- assertBundleState(Bundle.INSTALLED, fragment.getState());
- }
-
- fragment.uninstall();
- assertBundleState(Bundle.UNINSTALLED, fragment.getState());
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testAttachedFragment() throws Exception
- {
- OSGiRuntime runtime = getDefaultRuntime();
- try
- {
- OSGiBundle host = runtime.installBundle("fragments-simple-hostA.jar");
- assertBundleState(Bundle.INSTALLED, host.getState());
-
- OSGiBundle fragment = runtime.installBundle("fragments-simple-frgmA.jar");
- assertBundleState(Bundle.INSTALLED, fragment.getState());
-
- host.start();
- assertBundleState(Bundle.ACTIVE, host.getState());
- assertBundleState(Bundle.RESOLVED, fragment.getState());
-
- URL entryURL = host.getEntry("resources/resource.txt");
- assertNull("Entry URL null", entryURL);
-
- URL resourceURL = host.getResource("resources/resource.txt");
- assertNotNull("Resource URL not null", resourceURL);
-
- OSGiBundle classProvider = host.loadClass(FragmentService.class.getName());
- assertEquals("Class provided by fragment", host, classProvider);
-
- host.uninstall();
- assertBundleState(Bundle.UNINSTALLED, host.getState());
- assertBundleState(Bundle.RESOLVED, fragment.getState());
-
- fragment.uninstall();
- assertBundleState(Bundle.UNINSTALLED, fragment.getState());
- }
- finally
- {
- runtime.shutdown();
- }
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java 2010-01-12 17:29:06 UTC (rev 99304)
@@ -0,0 +1,351 @@
+/*
+ * 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.fragments;
+
+//$Id$
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
+import java.net.URL;
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.test.osgi.fragments.fragA.FragBeanA;
+import org.jboss.test.osgi.fragments.subA.SubBeanA;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.launch.Framework;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * Test Fragment functionality
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Jan-2010
+ */
+public class FragmentTestCase extends OSGiTest
+{
+ private Framework framework;
+ private BundleContext context;
+
+ @Before
+ public void setUp() throws Exception
+ {
+ OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+ framework = bootProvider.getFramework();
+ framework.start();
+
+ context = framework.getBundleContext();
+ }
+
+ @After
+ public void tearDown() throws Exception
+ {
+ if (framework != null)
+ {
+ framework.stop();
+ framework.waitForStop(5000);
+ }
+ }
+
+ @Test
+ public void testHostOnly() throws Exception
+ {
+ // Bundle-SymbolicName: simple-hostA
+ // Private-Package: org.jboss.test.osgi.fragments.hostA, org.jboss.test.osgi.fragments.subA
+ Bundle hostA = context.installBundle(getTestArchivePath("fragments-simple-hostA.jar"));
+ assertBundleState(Bundle.INSTALLED, hostA.getState());
+
+ hostA.start();
+ assertBundleState(Bundle.ACTIVE, hostA.getState());
+
+ URL entryURL = hostA.getEntry("resources/resource.txt");
+ assertNull("Entry URL null", entryURL);
+
+ URL resourceURL = hostA.getResource("resources/resource.txt");
+ assertNull("Resource URL null", resourceURL);
+
+ // Load a private class
+ assertBundleLoadClass(hostA, SubBeanA.class.getName(), true);
+
+ hostA.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, hostA.getState());
+ }
+
+ @Test
+ public void testFragmentOnly() throws Exception
+ {
+ // Bundle-SymbolicName: simple-fragA
+ // Export-Package: org.jboss.test.osgi.fragments.fragA
+ // Include-Resource: resources/resource.txt=resource.txt
+ // Fragment-Host: simple-hostA
+ Bundle fragA = context.installBundle(getTestArchivePath("fragments-simple-fragA.jar"));
+ assertBundleState(Bundle.INSTALLED, fragA.getState());
+
+ URL entryURL = fragA.getEntry("resources/resource.txt");
+ assertNotNull("Entry URL not null", entryURL);
+
+ URL resourceURL = fragA.getResource("resources/resource.txt");
+ assertNull("Resource URL null", resourceURL);
+
+ try
+ {
+ fragA.start();
+ fail("Fragment bundles can not be started");
+ }
+ catch (BundleException e)
+ {
+ assertBundleState(Bundle.INSTALLED, fragA.getState());
+ }
+
+ fragA.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, fragA.getState());
+ }
+
+ @Test
+ public void testAttachedFragment() throws Exception
+ {
+ // Bundle-SymbolicName: simple-hostA
+ // Private-Package: org.jboss.test.osgi.fragments.hostA, org.jboss.test.osgi.fragments.subA
+ Bundle hostA = context.installBundle(getTestArchivePath("fragments-simple-hostA.jar"));
+ assertBundleState(Bundle.INSTALLED, hostA.getState());
+
+ // Bundle-SymbolicName: simple-fragA
+ // Export-Package: org.jboss.test.osgi.fragments.fragA
+ // Include-Resource: resources/resource.txt=resource.txt
+ // Fragment-Host: simple-hostA
+ Bundle fragA = context.installBundle(getTestArchivePath("fragments-simple-fragA.jar"));
+ assertBundleState(Bundle.INSTALLED, fragA.getState());
+
+ hostA.start();
+ assertBundleState(Bundle.ACTIVE, hostA.getState());
+ assertBundleState(Bundle.RESOLVED, fragA.getState());
+
+ URL entryURL = hostA.getEntry("resources/resource.txt");
+ assertNull("Entry URL null", entryURL);
+
+ URL resourceURL = hostA.getResource("resources/resource.txt");
+ assertNotNull("Resource URL not null", resourceURL);
+
+ // Load class provided by the fragment
+ assertBundleLoadClass(hostA, FragBeanA.class.getName(), true);
+
+ // Load a private class
+ assertBundleLoadClass(hostA, SubBeanA.class.getName(), true);
+
+ hostA.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, hostA.getState());
+ assertBundleState(Bundle.RESOLVED, fragA.getState());
+
+ fragA.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, fragA.getState());
+ }
+
+ @Test
+ public void testHiddenPrivatePackage() throws Exception
+ {
+ if (framework != null)
+ {
+ System.out.println("FIXME [JBOSGI-245] Framework fragments");
+ return;
+ }
+
+ // Bundle-SymbolicName: simple-hostA
+ // Private-Package: org.jboss.test.osgi.fragments.hostA, org.jboss.test.osgi.fragments.subA
+ Bundle hostA = context.installBundle(getTestArchivePath("fragments-simple-hostA.jar"));
+ assertBundleState(Bundle.INSTALLED, hostA.getState());
+
+ // Bundle-SymbolicName: simple-hostB
+ // Export-Package: org.jboss.test.osgi.fragments.subA
+ // Private-Package: org.jboss.test.osgi.fragments.hostB
+ Bundle hostB = context.installBundle(getTestArchivePath("fragments-simple-hostB.jar"));
+ assertBundleState(Bundle.INSTALLED, hostB.getState());
+
+ // Bundle-SymbolicName: simple-fragB
+ // Import-Package: org.jboss.test.osgi.fragments.subA
+ // Fragment-Host: simple-hostA
+ Bundle fragB = context.installBundle(getTestArchivePath("fragments-simple-fragB.jar"));
+ assertBundleState(Bundle.INSTALLED, fragB.getState());
+
+ hostA.start();
+ assertBundleState(Bundle.ACTIVE, hostA.getState());
+ assertBundleState(Bundle.RESOLVED, fragB.getState());
+
+ // The fragment contains an overwrites Private-Package with Import-Package
+ // The SubBeanA is expected to come from HostB, which exports that package
+ assertBundleLoadClass(hostB, SubBeanA.class.getName(), true);
+
+ hostA.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, hostA.getState());
+ assertBundleState(Bundle.RESOLVED, fragB.getState());
+
+ hostB.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, hostB.getState());
+
+ fragB.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, fragB.getState());
+ }
+
+ @Test
+ public void testFragmentExportsPackage() throws Exception
+ {
+ if (framework != null)
+ {
+ System.out.println("FIXME [JBOSGI-245] Framework fragments");
+ return;
+ }
+
+ // Bundle-SymbolicName: simple-hostA
+ // Private-Package: org.jboss.test.osgi.fragments.hostA, org.jboss.test.osgi.fragments.subA
+ Bundle hostA = context.installBundle(getTestArchivePath("fragments-simple-hostA.jar"));
+ assertBundleState(Bundle.INSTALLED, hostA.getState());
+
+ // Bundle-SymbolicName: simple-hostC
+ // Import-Package: org.jboss.test.osgi.fragments.fragA
+ // Private-Package: org.jboss.test.osgi.fragments.hostC
+ Bundle hostC = context.installBundle(getTestArchivePath("fragments-simple-hostC.jar"));
+ assertBundleState(Bundle.INSTALLED, hostA.getState());
+
+ hostA.start();
+ assertBundleState(Bundle.ACTIVE, hostA.getState());
+
+ try
+ {
+ // HostA does not export the package needed by HostC
+ hostC.start();
+ fail("Unresolved constraint expected");
+ }
+ catch (BundleException ex)
+ {
+ assertBundleState(Bundle.INSTALLED, hostC.getState());
+ }
+
+ // Bundle-SymbolicName: simple-fragA
+ // Export-Package: org.jboss.test.osgi.fragments.fragA
+ // Include-Resource: resources/resource.txt=resource.txt
+ // Fragment-Host: simple-hostA
+ Bundle fragA = context.installBundle(getTestArchivePath("fragments-simple-fragA.jar"));
+ assertBundleState(Bundle.INSTALLED, fragA.getState());
+
+ try
+ {
+ // FragA does not attach to the aleady resolved HostA
+ // HostA does not export the package needed by HostC
+ hostC.start();
+ fail("Unresolved constraint expected");
+ }
+ catch (BundleException ex)
+ {
+ assertBundleState(Bundle.INSTALLED, hostC.getState());
+ }
+
+ // Refreshing HostA causes the FragA to get attached
+ ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
+ PackageAdmin packageAdmin = (PackageAdmin)context.getService(sref);
+ packageAdmin.refreshPackages(new Bundle[] { hostA });
+
+ // Wait for the fragment to get attached
+ int timeout = 2000;
+ while (timeout > 0 && fragA.getState() != Bundle.RESOLVED)
+ {
+ Thread.sleep(200);
+ timeout -= 200;
+ }
+
+ // HostC should now resolve and start
+ hostC.start();
+ assertBundleState(Bundle.ACTIVE, hostC.getState());
+
+ hostA.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, hostA.getState());
+
+ hostC.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, hostC.getState());
+
+ fragA.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, fragA.getState());
+ }
+
+ @Test
+ public void testFragmentRequireBundle() throws Exception
+ {
+ if (framework != null)
+ {
+ System.out.println("FIXME [JBOSGI-245] Framework fragments");
+ return;
+ }
+
+ // Bundle-SymbolicName: simple-hostA
+ // Private-Package: org.jboss.test.osgi.fragments.hostA, org.jboss.test.osgi.fragments.subA
+ Bundle hostA = context.installBundle(getTestArchivePath("fragments-simple-hostA.jar"));
+ assertBundleState(Bundle.INSTALLED, hostA.getState());
+
+ // Bundle-SymbolicName: simple-fragC
+ // Export-Package: org.jboss.test.osgi.fragments.fragC
+ // Require-Bundle: simple-hostB
+ // Fragment-Host: simple-hostA
+ Bundle fragC = context.installBundle(getTestArchivePath("fragments-simple-fragC.jar"));
+ assertBundleState(Bundle.INSTALLED, fragC.getState());
+
+ try
+ {
+ // The attached FragA requires bundle HostB, which is not yet installed
+ hostA.start();
+
+ // Clarify error behaviour when fragments fail to attach
+ // https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1524
+ //
+ // Felix: Merges FragC Require-Bundle into HostA and fails to resolve
+ // Equinox: Resolves HostA but does not attach FragA
+ if (hostA.getState() == Bundle.ACTIVE)
+ assertBundleState(Bundle.INSTALLED, fragC.getState());
+ }
+ catch (BundleException ex)
+ {
+ assertBundleState(Bundle.INSTALLED, hostA.getState());
+ }
+
+ // Bundle-SymbolicName: simple-hostB
+ // Export-Package: org.jboss.test.osgi.fragments.subA
+ // Private-Package: org.jboss.test.osgi.fragments.hostB
+ Bundle hostB = context.installBundle(getTestArchivePath("fragments-simple-hostB.jar"));
+ assertBundleState(Bundle.INSTALLED, hostB.getState());
+
+ // HostA should resolve and start after HostB got installed
+ hostA.start();
+ assertBundleState(Bundle.ACTIVE, hostA.getState());
+
+ hostA.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, hostA.getState());
+
+ fragC.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, fragC.getState());
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/fragA (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/fragA)
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/fragB (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/fragB)
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/fragC (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/fragC)
Deleted: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/hostA/FragmentHostActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/hostA/FragmentHostActivator.java 2010-01-08 15:37:37 UTC (rev 99165)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/hostA/FragmentHostActivator.java 2010-01-12 17:29:06 UTC (rev 99304)
@@ -1,38 +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.fragments.hostA;
-
-//$Id$
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class FragmentHostActivator implements BundleActivator
-{
- public void start(BundleContext context)
- {
- }
-
- public void stop(BundleContext context)
- {
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/hostA/HostAActivator.java (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/hostA/HostAActivator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/hostA/HostAActivator.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/hostA/HostAActivator.java 2010-01-12 17:29:06 UTC (rev 99304)
@@ -0,0 +1,41 @@
+/*
+ * 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.fragments.hostA;
+
+//$Id$
+
+import org.jboss.test.osgi.fragments.subA.SubBeanA;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class HostAActivator implements BundleActivator
+{
+ public void start(BundleContext context)
+ {
+ SubBeanA subBean = new SubBeanA();
+ subBean.getProvider(context);
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/hostB (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/hostB)
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/hostC (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/hostC)
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/fragments/subA (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/subA)
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments (from rev 99165, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments)
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-fragA.bnd (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-fragA.bnd)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-fragA.bnd (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-fragA.bnd 2010-01-12 17:29:06 UTC (rev 99304)
@@ -0,0 +1,9 @@
+# bnd build -classpath target/test-classes -output target/test-libs/fragments-simple-fragA.jar src/test/resources/fragments/simple-fragA.bnd
+
+Bundle-SymbolicName: simple-fragA
+Export-Package: org.jboss.test.osgi.fragments.fragA
+Include-Resource: resources/resource.txt=resource.txt
+Fragment-Host: simple-hostA
+
+-removeheaders: Include-Resource
+
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-fragB.bnd (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-fragB.bnd)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-fragB.bnd (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-fragB.bnd 2010-01-12 17:29:06 UTC (rev 99304)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/fragments-simple-fragB.jar src/test/resources/fragments/simple-fragB.bnd
+
+Bundle-SymbolicName: simple-fragB
+Export-Package: org.jboss.test.osgi.fragments.fragB
+Import-Package: org.jboss.test.osgi.fragments.subA
+Fragment-Host: simple-hostA
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-fragC.bnd (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-fragC.bnd)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-fragC.bnd (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-fragC.bnd 2010-01-12 17:29:06 UTC (rev 99304)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/fragments-simple-fragC.jar src/test/resources/fragments/simple-fragC.bnd
+
+Bundle-SymbolicName: simple-fragC
+Export-Package: org.jboss.test.osgi.fragments.fragC
+Require-Bundle: simple-hostB
+Fragment-Host: simple-hostA
Deleted: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-frgmA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-frgmA.bnd 2010-01-08 15:37:37 UTC (rev 99165)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-frgmA.bnd 2010-01-12 17:29:06 UTC (rev 99304)
@@ -1,9 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/fragments-simple-frgmA.jar src/test/resources/fragments/simple-frgmA.bnd
-
-Bundle-SymbolicName: simple-frgmA
-Fragment-Host: simple-hostA
-Export-Package: org.jboss.test.osgi.fragments.frgmA
-Include-Resource: resources/resource.txt=resource.txt
-
--removeheaders: Include-Resource
-
Deleted: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-hostA.bnd 2010-01-08 15:37:37 UTC (rev 99165)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostA.bnd 2010-01-12 17:29:06 UTC (rev 99304)
@@ -1,6 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/fragments-simple-hostA.jar src/test/resources/fragments/simple-hostA.bnd
-
-Bundle-SymbolicName: simple-hostA
-Bundle-Activator: org.jboss.test.osgi.fragments.hostA.FragmentHostActivator
-Private-Package: org.jboss.test.osgi.fragments.hostA
-
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostA.bnd (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-hostA.bnd)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostA.bnd (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostA.bnd 2010-01-12 17:29:06 UTC (rev 99304)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/fragments-simple-hostA.jar src/test/resources/fragments/simple-hostA.bnd
+
+Bundle-SymbolicName: simple-hostA
+Bundle-Activator: org.jboss.test.osgi.fragments.hostA.HostAActivator
+Private-Package: org.jboss.test.osgi.fragments.hostA, org.jboss.test.osgi.fragments.subA
+
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostB.bnd (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-hostB.bnd)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostB.bnd (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostB.bnd 2010-01-12 17:29:06 UTC (rev 99304)
@@ -0,0 +1,7 @@
+# bnd build -classpath target/test-classes -output target/test-libs/fragments-simple-hostB.jar src/test/resources/fragments/simple-hostB.bnd
+
+Bundle-SymbolicName: simple-hostB
+Bundle-Activator: org.jboss.test.osgi.fragments.hostB.HostBActivator
+Export-Package: org.jboss.test.osgi.fragments.subA
+Private-Package: org.jboss.test.osgi.fragments.hostB
+
Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostC.bnd (from rev 99284, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-hostC.bnd)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostC.bnd (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/fragments/simple-hostC.bnd 2010-01-12 17:29:06 UTC (rev 99304)
@@ -0,0 +1,7 @@
+# bnd build -classpath target/test-classes -output target/test-libs/fragments-simple-hostC.jar src/test/resources/fragments/simple-hostC.bnd
+
+Bundle-SymbolicName: simple-hostC
+Bundle-Activator: org.jboss.test.osgi.fragments.hostC.HostCActivator
+Private-Package: org.jboss.test.osgi.fragments.hostC
+Import-Package: org.osgi.framework, org.jboss.test.osgi.fragments.fragA
+
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-12 17:01:54 UTC (rev 99303)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-01-12 17:29:06 UTC (rev 99304)
@@ -106,9 +106,6 @@
<bean name="LifecycleInterceptorService" class="org.jboss.osgi.framework.service.internal.LifecycleInterceptorServiceImpl">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
- <bean name="MessageBoardService" class="org.jboss.osgi.framework.service.internal.MessageBoardServiceImpl">
- <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
- </bean>
<!--
********************************
15 years, 11 months