Author: thomas.diesler(a)jboss.com
Date: 2010-02-03 12:04:42 -0500 (Wed, 03 Feb 2010)
New Revision: 100355
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/HttpServiceCapability.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
Log:
[JBOSGI-287] Optional import loaded from system classloader
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
===================================================================
---
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2010-02-03
16:54:19 UTC (rev 100354)
+++
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2010-02-03
17:04:42 UTC (rev 100355)
@@ -111,6 +111,7 @@
log.debug("Skip bundle: " + location);
}
}
+
// Start the capability bundles
for (OSGiBundle bundle : installed)
{
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml 2010-02-03 16:54:19 UTC (rev
100354)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml 2010-02-03 17:04:42 UTC (rev
100355)
@@ -21,7 +21,7 @@
<artifactId>jboss-osgi-webapp</artifactId>
<packaging>bundle</packaging>
- <version>0.7.3-SNAPSHOT</version>
+ <version>0.7.2.SP1-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -39,7 +39,7 @@
<!-- Properties -->
<properties>
- <version.jboss.osgi.deployment>1.0.0</version.jboss.osgi.deployment>
+
<version.jboss.osgi.deployment>1.0.1-SNAPSHOT</version.jboss.osgi.deployment>
<version.ops4j.pax.web>0.7.2</version.ops4j.pax.web>
<version.osgi>4.2.0</version.osgi>
</properties>
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-02-03
16:54:19 UTC (rev 100354)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java 2010-02-03
17:04:42 UTC (rev 100355)
@@ -56,19 +56,22 @@
*/
public class OSGiClassLoaderPolicy extends VFSClassLoaderPolicy
{
+ /** The associated bundle state */
+ private AbstractBundleState bundleState;
/** The fragment roots */
private List<VirtualFile> fragments;
- public OSGiClassLoaderPolicy(AbstractBundleState absBundleState, VirtualFile[] roots)
+ public OSGiClassLoaderPolicy(AbstractBundleState bundleState, VirtualFile[] roots)
{
super(roots);
- if (absBundleState == null)
+ if (bundleState == null)
throw new IllegalArgumentException("Null bundleState");
-
- if (absBundleState instanceof AbstractDeployedBundleState)
+ this.bundleState = bundleState;
+
+ if (bundleState instanceof AbstractDeployedBundleState)
{
- AbstractDeployedBundleState depBundleState =
(AbstractDeployedBundleState)absBundleState;
+ AbstractDeployedBundleState depBundleState =
(AbstractDeployedBundleState)bundleState;
DeploymentUnit unit = depBundleState.getDeploymentUnit();
Module module = unit.getAttachment(Module.class);
if (module instanceof OSGiModule == false)
@@ -91,6 +94,13 @@
}
}
+
+ @Override
+ public String getName()
+ {
+ return bundleState.getCanonicalName();
+ }
+
/**
* Processes the NativeLibraryMetaData that is part of the OSGiClassLoadingMetaData
* and adds the NativeLibraryProviders to the ClassLoaderPolicy
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/HttpServiceCapability.java
===================================================================
---
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/HttpServiceCapability.java 2010-02-03
16:54:19 UTC (rev 100354)
+++
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/HttpServiceCapability.java 2010-02-03
17:04:42 UTC (rev 100355)
@@ -31,6 +31,7 @@
*
* It is ignored if the {@link HttpService} is already registered.
*
+ * Dependent Capability: {@link ConfigAdminCapability}
* Installed bundles: pax-web-jetty-bundle.jar
*
* Default properties set by this capability
@@ -49,7 +50,7 @@
{
super(HttpService.class.getName());
addSystemProperty("org.osgi.service.http.port", "8090");
-
+ addDependency(new ConfigAdminCapability());
addBundle("bundles/pax-web-jetty-bundle.jar");
}
}
\ No newline at end of file
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java
===================================================================
---
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java 2010-02-03
16:54:19 UTC (rev 100354)
+++
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java 2010-02-03
17:04:42 UTC (rev 100355)
@@ -63,6 +63,9 @@
public static ObjectName getObjectName(Bundle bundle)
{
+ if (bundle == null)
+ throw new IllegalArgumentException("Null bundle");
+
long id = bundle.getBundleId();
String name = bundle.getSymbolicName();
Version version = bundle.getVersion();
@@ -144,7 +147,7 @@
ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
PackageAdmin packageAdmin = (PackageAdmin)context.getService(sref);
Bundle providingBundle = packageAdmin.getBundle(clazz);
- return getObjectName(providingBundle);
+ return providingBundle != null ? getObjectName(providingBundle) : null;
}
public File getDataFile(String filename)
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
===================================================================
---
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2010-02-03
16:54:19 UTC (rev 100354)
+++
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2010-02-03
17:04:42 UTC (rev 100355)
@@ -21,6 +21,10 @@
<entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
<entry><key>org.osgi.framework.system.packages.extra</key><value>
+ <!-- [JBOSGI-287] Optional import loaded from system classloader -->
+ javax.servlet,
+ javax.servlet.http,
+
<!-- loging -->
org.apache.log4j;version=1.2,
org.slf4j;version=1.5,
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2010-02-03 16:54:19 UTC (rev 100354)
+++ projects/jboss-osgi/trunk/pom.xml 2010-02-03 17:04:42 UTC (rev 100355)
@@ -71,7 +71,7 @@
<version.jboss.osgi.runtime.jbossas>1.0.2</version.jboss.osgi.runtime.jbossas>
<version.jboss.osgi.serviceloader>1.0.0-SNAPSHOT</version.jboss.osgi.serviceloader>
<version.jboss.osgi.spi>1.0.4-SNAPSHOT</version.jboss.osgi.spi>
- <version.jboss.osgi.webapp>0.7.2</version.jboss.osgi.webapp>
+
<version.jboss.osgi.webapp>0.7.2.SP1-SNAPSHOT</version.jboss.osgi.webapp>
<version.jboss.osgi.webconsole>1.0.2</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.2-SNAPSHOT</version.jboss.osgi.xml.binding>
<version.ops4j.pax.web>0.7.2</version.ops4j.pax.web>
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-02-03
16:54:19 UTC (rev 100354)
+++
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-02-03
17:04:42 UTC (rev 100355)
@@ -55,20 +55,6 @@
********************************
-->
- <bean name="OSGiAutoInstallPlugin"
class="org.jboss.osgi.framework.plugins.internal.AutoInstallPluginImpl">
- <constructor><parameter><inject bean="OSGiBundleManager"
/></parameter></constructor>
- <property name="autoInstall">
- <list elementClass="java.net.URL">
-
<value>${test.archive.directory}/bundles/org.osgi.compendium.jar</value>
- </list>
- </property>
- <property name="autoStart">
- <list elementClass="java.net.URL">
-
<value>${test.archive.directory}/bundles/org.apache.felix.log.jar</value>
- <value>${test.archive.directory}/bundles/jboss-osgi-common.jar</value>
- </list>
- </property>
- </bean>
<bean name="OSGiControllerContextPlugin"
class="org.jboss.osgi.framework.bundle.ControllerContextPluginImpl">
<constructor>
<parameter><inject bean="OSGiBundleManager"
/></parameter>