JBoss-OSGI SVN: r91790 - projects/jboss-osgi/projects/parent/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-29 16:50:29 -0400 (Wed, 29 Jul 2009)
New Revision: 91790
Modified:
projects/jboss-osgi/projects/parent/trunk/pom.xml
Log:
Add jbossmc properties
Modified: projects/jboss-osgi/projects/parent/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/parent/trunk/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
+++ projects/jboss-osgi/projects/parent/trunk/pom.xml 2009-07-29 20:50:29 UTC (rev 91790)
@@ -314,19 +314,19 @@
</profile>
<!--
- Name: framework-knopflerfish
- Descr: Setup for Knopflerfish framework integration testing
+ Name: framework-jbossmc
+ Descr: Setup for JBossMC framework integration testing
-->
<profile>
- <id>framework-knopflerfish</id>
+ <id>framework-jbossmc</id>
<activation>
<property>
<name>framework</name>
- <value>knopflerfish</value>
+ <value>jbossmc</value>
</property>
</activation>
<properties>
- <jboss.osgi.framework.properties>jboss-osgi-knopflerfish.properties</jboss.osgi.framework.properties>
+ <jboss.osgi.framework.properties>jboss-osgi-jbossmc.properties</jboss.osgi.framework.properties>
</properties>
</profile>
@@ -347,17 +347,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemProperties>
- <!--
- You can copy these properties in Eclipse to debug example tests
-
- -Djava.protocol.handler.pkgs=org.jboss.net.protocol|org.jboss.virtual.protocol
- -Djndi.server.port=1199
- -Dlog4j.output.dir=${workspace_loc:jboss-osgi-testsuite-example/target}
- -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeAwareParserConfiguration
- -Djboss.osgi.framework.properties=jboss-osgi-felix.properties
- -Dorg.jboss.osgi.husky.Invoker=org.jboss.osgi.husky.internal.OSGiInvoker
- -Dtest.archive.directory=${workspace_loc:jboss-osgi-testsuite-example/target}/test-libs
- -->
<property>
<name>java.protocol.handler.pkgs</name>
<value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
14 years, 9 months
JBoss-OSGI SVN: r91789 - in projects/jboss-osgi: projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework and 28 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-29 16:49:03 -0400 (Wed, 29 Jul 2009)
New Revision: 91789
Added:
projects/jboss-osgi/projects/runtime/felix/trunk/bootstrap/
projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-jbossmc.properties
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleContextImpl.java
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleImpl.java
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkImpl.java
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/SystemBundleContext.java
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/META-INF/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/META-INF/services/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/jbossmc/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/jbossmc/FrameworkLaunchTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/framework/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/framework/FrameworkTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-jbossmc.properties
Removed:
projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-knopflerfish.properties
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/felix/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/ExportedPackageHelper.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java
projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/user-input-spec.xml
projects/jboss-osgi/trunk/distribution/pom.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml
projects/jboss-osgi/trunk/reactor/pom.xml
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/.classpath
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Add initial MC facade
Copied: projects/jboss-osgi/projects/runtime/felix/trunk/bootstrap (from rev 91756, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap)
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -208,7 +208,7 @@
{
try
{
- return file.toURI().toURL();
+ return file.toURL();
}
catch (MalformedURLException e)
{
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -288,7 +288,8 @@
String value = props.getProperty(key);
// Replace property variables
- propMap.put(key, StringPropertyReplacer.replaceProperties(value));
+ value = StringPropertyReplacer.replaceProperties(value);
+ propMap.put(key, value);
if (key.endsWith(".instance"))
{
@@ -306,7 +307,7 @@
}
// Merge optional extra properties
- String extraPropsValue = props.getProperty(PROP_OSGI_FRAMEWORK_EXTRA);
+ String extraPropsValue = (String)propMap.get(PROP_OSGI_FRAMEWORK_EXTRA);
if (extraPropsValue != null)
{
URL extraPropsURL = null;
@@ -323,7 +324,7 @@
File propsFile = new File(extraPropsValue);
try
{
- extraPropsURL = propsFile.toURI().toURL();
+ extraPropsURL = propsFile.toURL();
}
catch (MalformedURLException e)
{
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/ExportedPackageHelper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/ExportedPackageHelper.java 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/ExportedPackageHelper.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -50,17 +50,18 @@
public ExportedPackageHelper(BundleContext context)
{
ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
- packageAdmin = (PackageAdmin)context.getService(sref);
+ if (sref != null)
+ packageAdmin = (PackageAdmin)context.getService(sref);
}
public boolean resolveBundle(Bundle bundle)
{
- return packageAdmin.resolveBundles(new Bundle[] { bundle });
+ return packageAdmin != null ? packageAdmin.resolveBundles(new Bundle[] { bundle }) : false;
}
public boolean resolveBundles(Bundle[] bundles)
{
- return packageAdmin.resolveBundles(bundles);
+ return packageAdmin != null ? packageAdmin.resolveBundles(bundles) : false;
}
/*
@@ -68,18 +69,21 @@
*/
public void logExportedPackages(Bundle bundle)
{
- log.debug("Exported-Packages: " + bundle.getSymbolicName());
-
- ExportedPackage[] exportedPackages = packageAdmin.getExportedPackages(bundle);
- if (exportedPackages != null)
+ if (packageAdmin != null)
{
- List<String> packages = new ArrayList<String>();
- for (ExportedPackage exp : exportedPackages)
- packages.add(" " + exp.getName() + ";version=" + exp.getVersion());
+ log.debug("Exported-Packages: " + bundle.getSymbolicName());
- Collections.sort(packages);
- for (String exp : packages)
- log.debug(exp);
+ ExportedPackage[] exportedPackages = packageAdmin.getExportedPackages(bundle);
+ if (exportedPackages != null)
+ {
+ List<String> packages = new ArrayList<String>();
+ for (ExportedPackage exp : exportedPackages)
+ packages.add(" " + exp.getName() + ";version=" + exp.getVersion());
+
+ Collections.sort(packages);
+ for (String exp : packages)
+ log.debug(exp);
+ }
}
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -98,7 +98,7 @@
try
{
File resourceFile = getResourceFile(resource);
- resURL = resourceFile.toURI().toURL();
+ resURL = resourceFile.toURL();
}
catch (MalformedURLException e)
{
@@ -112,7 +112,7 @@
{
try
{
- return getTestArchiveFile(archive).toURI().toURL();
+ return getTestArchiveFile(archive).toURL();
}
catch (MalformedURLException ex)
{
Modified: projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-equinox.properties 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-equinox.properties 2009-07-29 20:49:03 UTC (rev 91789)
@@ -4,9 +4,6 @@
# $Id$
#
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.equinox.framework.EquinoxIntegration
-
# Properties to configure the Framework
org.osgi.framework.storage=${osgi.server.home}/data/osgi-store
org.osgi.framework.storage.clean=onFirstInit
Modified: projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-felix.properties 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-felix.properties 2009-07-29 20:49:03 UTC (rev 91789)
@@ -4,9 +4,6 @@
# $Id: $
#
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
-
# Extra server specific properties
org.jboss.osgi.spi.framework.extra=${osgi.server.home}/conf/jboss-osgi-extra.properties
Copied: projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-jbossmc.properties (from rev 91756, projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-knopflerfish.properties)
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-jbossmc.properties (rev 0)
+++ projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-jbossmc.properties 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,10 @@
+#
+# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
+#
+# $Id$
+#
+
+# Properties to configure the Framework
+org.osgi.framework.storage=${osgi.server.home}/data/osgi-store
+org.osgi.framework.storage.clean=onFirstInit
+
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-knopflerfish.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-knopflerfish.properties 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-knopflerfish.properties 2009-07-29 20:49:03 UTC (rev 91789)
@@ -1,96 +0,0 @@
-#
-# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
-#
-# $Id$
-#
-
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.knopflerfish.framework.KnopflerfishIntegration
-
-# Properties to configure the Framework
-org.osgi.framework.storage=${osgi.server.home}/data/osgi-store
-org.osgi.framework.storage.clean=onFirstInit
-
-# Hot Deployement
-org.jboss.osgi.hotdeploy.scandir=${osgi.server.home}/deploy
-
-# HTTP Service Port
-org.osgi.service.http.port=8090
-
-# Config Admin Service
-felix.cm.dir=${osgi.server.home}/data/osgi-configadmin
-
-# JMX bundle properties
-org.jboss.osgi.jmx.host=${jboss.bind.address}
-org.jboss.osgi.jmx.rmi.port=1098
-
-# JNDI bundle properties
-org.jboss.osgi.jndi.host=${jboss.bind.address}
-org.jboss.osgi.jndi.rmi.port=1098
-org.jboss.osgi.jndi.port=1099
-
-# Remote Logging
-org.jboss.osgi.service.remote.log.sender=true
-org.jboss.osgi.service.remote.log.host=${jboss.bind.address}
-org.jboss.osgi.service.remote.log.port=5400
-
-# Husky socket connector properties
-org.jboss.osgi.husky.runtime.connector.host=${jboss.bind.address}
-org.jboss.osgi.husky.runtime.connector.port=5401
-
-# System Packages
-org.osgi.framework.system.packages=\
- javax.imageio, \
- javax.imageio.stream, \
- javax.management, \
- javax.management.remote, \
- javax.naming, \
- javax.naming.event, \
- javax.naming.spi, \
- javax.net, \
- javax.net.ssl, \
- javax.xml.datatype, \
- javax.xml.namespace, \
- javax.xml.parsers, \
- javax.xml.transform, \
- javax.xml.transform.dom, \
- javax.xml.transform.sax, \
- javax.xml.transform.stream, \
- javax.xml.validation, \
- org.w3c.dom, \
- org.w3c.dom.events, \
- org.w3c.dom.ls, \
- org.w3c.dom.ranges, \
- org.w3c.dom.traversal, \
- org.w3c.dom.views, \
- org.xml.sax, \
- org.xml.sax.ext, \
- org.xml.sax.helpers, \
- org.osgi.framework;version=1.4, \
- org.osgi.service.packageadmin;version=1.2, \
- org.osgi.service.startlevel;version=1.1, \
- org.jboss.osgi.spi;version=1.0, \
- org.jboss.osgi.spi.capability;version=1.0, \
- org.jboss.osgi.spi.logging;version=1.0, \
- org.jboss.osgi.spi.management;version=1.0, \
- org.jboss.osgi.spi.service;version=1.0, \
- org.jboss.osgi.spi.testing;version=1.0, \
- org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.logging, \
- org.jboss.net.protocol, \
- org.jboss.virtual, \
- org.jboss.virtual.plugins.registry, \
- org.jboss.virtual.plugins.context.jar, \
- org.jboss.virtual.plugins.vfs.helpers, \
- org.jboss.virtual.protocol, \
- sun.reflect
-
-# Bundles that need to be installed with the Framework automatically
-org.jboss.osgi.spi.framework.autoInstall=\
- file://${osgi.home}/server/minimal/deploy/org.osgi.compendium.jar
-
-# Bundles that need to be started automatically
-org.jboss.osgi.spi.framework.autoStart=\
- file://${osgi.home}/server/minimal/deploy/org.apache.felix.log.jar \
- file://${osgi.home}/server/minimal/deploy/jboss-osgi-common.jar \
- file://${osgi.home}/server/minimal/deploy/jboss-osgi-hotdeploy.jar
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -25,11 +25,8 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<useStrictFiltering>true</useStrictFiltering>
<excludes>
- <!--
- Distribute the Apache Felix compendium jar
- [JBOSGI-92] Class.forName issue with XMLParserActivator
- -->
- <exclude>org.osgi:org.osgi.compendium:jar</exclude>
+ <exclude>org.apache.felix:org.osgi.compendium:jar</exclude>
+ <exclude>org.apache.felix:org.osgi.core:jar</exclude>
</excludes>
<scope>compile</scope>
<unpack>false</unpack>
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -52,9 +52,9 @@
<name>frameworkSelection</name>
<value>equinox</value>
</condition>
- <condition type="variable" id="isKnopflerfish">
+ <condition type="variable" id="isJBossMC">
<name>frameworkSelection</name>
- <value>knopflerfish</value>
+ <value>jbossmc</value>
</condition>
<condition type="variable" id="isJBoss501">
<name>jbossSelection</name>
@@ -134,7 +134,7 @@
<include name="jboss-osgi-runtime-equinox-sources.jar" />
<include name="jboss-osgi-runtime-felix-sources.jar" />
<include name="jboss-osgi-runtime-jbossas-sources.jar" />
- <include name="jboss-osgi-runtime-knopflerfish-sources.jar" />
+ <include name="jboss-osgi-runtime-jbossmc-sources.jar" />
<include name="jboss-osgi-spi-sources.jar" />
<include name="jboss-osgi-webconsole-sources.jar" />
<include name="jboss-osgi-xml-binding-sources.jar" />
@@ -251,14 +251,14 @@
<include name="org.eclipse.osgi.services.jar" />
</fileset>
- <!-- Knopflerfish Integration -->
+ <!-- JBossMC Integration -->
- <singlefile condition="isKnopflerfish" src="@{runtime.dir}/conf/jboss-osgi-knopflerfish.properties" target="$INSTALL_PATH/runtime/conf/jboss-osgi-framework.properties" override="true"/>
- <fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/lib" override="true">
- <include name="jboss-osgi-runtime-knopflerfish.jar" />
- <include name="org.knopflerfish.framework.jar" />
+ <singlefile condition="isJBossMC" src="@{runtime.dir}/conf/jboss-osgi-jbossmc.properties" target="$INSTALL_PATH/runtime/conf/jboss-osgi-framework.properties" override="true"/>
+ <fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/lib" override="true">
+ <include name="jboss-osgi-runtime-jbossmc.jar" />
+ <include name="org.osgi.core.jar" />
</fileset>
- <fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/minimal/deploy" override="true">
+ <fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/minimal/deploy" override="true">
<include name="org.osgi.compendium.jar" />
</fileset>
@@ -326,15 +326,17 @@
<include name="org.eclipse.osgi.services.jar" />
</fileset>
- <!-- Knopflerfish Integration -->
+ <!-- JBossMC Integration -->
- <fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer" override="true">
- <include name="jboss-osgi-runtime-knopflerfish.jar" />
- <include name="org.knopflerfish.framework.jar" />
+ <fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer" override="true">
+ <include name="jboss-osgi-runtime-jbossmc.jar" />
+ <include name="org.jbossmc.framework.jar" />
</fileset>
- <singlefile condition="isKnopflerfish" src="@{deploy.artifacts.dir}/resources/jbossas-config/jboss-beans-knopflerfish.xml"
+ <!--
+ <singlefile condition="isJBossMC" src="@{deploy.artifacts.dir}/resources/jbossas-config/jboss-beans-jbossmc.xml"
target="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer/META-INF/jboss-osgi-jboss-beans.xml" override="true"/>
- <fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi" override="true">
+ -->
+ <fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi" override="true">
<include name="org.osgi.compendium.jar" />
</fileset>
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/user-input-spec.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/user-input-spec.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/user-input-spec.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -5,7 +5,7 @@
<spec>
<choice txt="Felix" value="felix" set="true"/>
<choice txt="Equinox" value="equinox"/>
- <choice txt="Knopflerfish" value="knopflerfish"/>
+ <choice txt="Microcontainer" value="jbossmc"/>
</spec>
</field>
</panel>
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -354,16 +354,16 @@
<scope>provided</scope>
</dependency>
- <!-- Knopflerfish Dependencies -->
+ <!-- JBossMC Dependencies -->
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
- <version>${version.jboss.osgi.runtime.knopflerfish}</version>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-jbossmc</artifactId>
+ <version>${version.jboss.osgi.runtime.jbossmc}</version>
</dependency>
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
- <version>${version.jboss.osgi.runtime.knopflerfish}</version>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-jbossmc</artifactId>
+ <version>${version.jboss.osgi.runtime.jbossmc}</version>
<classifier>sources</classifier>
</dependency>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.1</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Modules -->
@@ -56,7 +56,7 @@
<version.jboss.osgi.runtime.equinox>3.5-SNAPSHOT</version.jboss.osgi.runtime.equinox>
<version.jboss.osgi.runtime.felix>1.9.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.runtime.jbossas>1.0.0</version.jboss.osgi.runtime.jbossas>
- <version.jboss.osgi.runtime.knopflerfish>1.0.0</version.jboss.osgi.runtime.knopflerfish>
+ <version.jboss.osgi.runtime.jbossmc>1.0.0-SNAPSHOT</version.jboss.osgi.runtime.jbossmc>
<version.jboss.osgi.spi>1.0.1-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.webconsole>1.0.0</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.1</version.jboss.osgi.xml.binding>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -162,15 +162,15 @@
</profile>
<!--
- Name: framework-knopflerfish
- Descr: Setup for Knopflerfish framework integration testing
+ Name: framework-jbossmc
+ Descr: Setup for JBossMC framework integration testing
-->
<profile>
- <id>framework-knopflerfish</id>
+ <id>framework-jbossmc</id>
<activation>
<property>
<name>framework</name>
- <value>knopflerfish</value>
+ <value>jbossmc</value>
</property>
</activation>
<build>
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -76,6 +76,7 @@
<module>spi</module>
<module>runtime/equinox</module>
<module>runtime/felix</module>
+ <module>runtime/jbossmc</module>
<module>bundles/common</module>
<module>blueprint</module>
</modules>
Copied: projects/jboss-osgi/trunk/reactor/runtime/jbossmc (from rev 91756, projects/jboss-osgi/projects/runtime/felix/trunk)
Modified: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/.classpath
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/.classpath 2009-07-29 02:40:06 UTC (rev 91756)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/.classpath 2009-07-29 20:49:03 UTC (rev 91789)
@@ -3,6 +3,7 @@
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml 2009-07-29 02:40:06 UTC (rev 91756)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -14,13 +14,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBossOSGi Runtime - Felix</name>
+ <name>JBossOSGi Runtime - JBossMC</name>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-jbossmc</artifactId>
<packaging>jar</packaging>
- <version>1.9.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -30,8 +30,8 @@
</parent>
<properties>
- <version.felix.framework>1.9.0-SNAPSHOT</version.felix.framework>
<version.jboss.osgi.spi>1.0.1-SNAPSHOT</version.jboss.osgi.spi>
+ <version.osgi>r4v42-20090728</version.osgi>
</properties>
<!-- Dependencies -->
@@ -42,10 +42,15 @@
<version>${version.jboss.osgi.spi}</version>
</dependency>
<dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.framework</artifactId>
- <version>${version.felix.framework}</version>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>${version.osgi}</version>
</dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <version>${version.osgi}</version>
+ </dependency>
</dependencies>
<!-- Build -->
Added: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleContextImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleContextImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleContextImpl.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,179 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.jbossmc.framework;
+
+//$Id$
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.Dictionary;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.BundleListener;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkListener;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * An implementation of an OSGi BundleContext
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 29-Jul-2009
+ */
+public class BundleContextImpl implements BundleContext
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(BundleContextImpl.class);
+
+ private BundleContext sysContext;
+ private Bundle bundle;
+
+ public BundleContextImpl(BundleContext sysContext, Bundle bundle)
+ {
+ this.sysContext = sysContext;
+ this.bundle = bundle;
+ }
+
+ BundleContext getSystemContext()
+ {
+ return sysContext;
+ }
+
+ public void addBundleListener(BundleListener listener)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void addFrameworkListener(FrameworkListener listener)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void addServiceListener(ServiceListener listener)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void addServiceListener(ServiceListener listener, String filter) throws InvalidSyntaxException
+ {
+ throw new NotImplementedException();
+ }
+
+ public Filter createFilter(String filter) throws InvalidSyntaxException
+ {
+ throw new NotImplementedException();
+ }
+
+ public ServiceReference[] getAllServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ {
+ throw new NotImplementedException();
+ }
+
+ public Bundle getBundle()
+ {
+ return bundle;
+ }
+
+ public Bundle getBundle(long id)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Bundle[] getBundles()
+ {
+ throw new NotImplementedException();
+ }
+
+ public File getDataFile(String filename)
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getProperty(String key)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Object getService(ServiceReference reference)
+ {
+ throw new NotImplementedException();
+ }
+
+ public ServiceReference getServiceReference(String clazz)
+ {
+ // [TODO] getServiceReference
+ return null;
+ }
+
+ public ServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ {
+ // [TODO] getServiceReferences
+ return null;
+ }
+
+ public Bundle installBundle(String location) throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public Bundle installBundle(String location, InputStream input) throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public ServiceRegistration registerService(String[] clazzes, Object service, Dictionary properties)
+ {
+ throw new NotImplementedException();
+ }
+
+ public ServiceRegistration registerService(String clazz, Object service, Dictionary properties)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void removeBundleListener(BundleListener listener)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void removeFrameworkListener(FrameworkListener listener)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void removeServiceListener(ServiceListener listener)
+ {
+ throw new NotImplementedException();
+ }
+
+ public boolean ungetService(ServiceReference reference)
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleContextImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleImpl.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,190 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.jbossmc.framework;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
+
+/**
+ * An implementation of an OSGi Bundle
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 29-Jul-2009
+ */
+public class BundleImpl implements Bundle
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(BundleImpl.class);
+
+ private int state;
+ private BundleContext bndContext;
+
+ public long getBundleId()
+ {
+ throw new NotImplementedException();
+ }
+
+ public int getState()
+ {
+ return state;
+ }
+
+ public void setState(int state)
+ {
+ this.state = state;
+ }
+
+ public String getLocation()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getSymbolicName()
+ {
+ throw new NotImplementedException();
+ }
+
+ public void start() throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void start(int options) throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void stop() throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void stop(int options) throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void uninstall() throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void update() throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void update(InputStream in) throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public Enumeration findEntries(String path, String filePattern, boolean recurse)
+ {
+ throw new NotImplementedException();
+ }
+
+ public BundleContext getBundleContext()
+ {
+ return bndContext;
+ }
+
+ public URL getEntry(String path)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Enumeration getEntryPaths(String path)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Dictionary getHeaders()
+ {
+ throw new NotImplementedException();
+ }
+
+ public Dictionary getHeaders(String locale)
+ {
+ throw new NotImplementedException();
+ }
+
+ public long getLastModified()
+ {
+ throw new NotImplementedException();
+ }
+
+ public ServiceReference[] getRegisteredServices()
+ {
+ throw new NotImplementedException();
+ }
+
+ public URL getResource(String name)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Enumeration getResources(String name) throws IOException
+ {
+ throw new NotImplementedException();
+ }
+
+ public ServiceReference[] getServicesInUse()
+ {
+ throw new NotImplementedException();
+
+ }
+
+ public Map getSignerCertificates(int signersType)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Version getVersion()
+ {
+ throw new NotImplementedException();
+ }
+
+ public boolean hasPermission(Object permission)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Class loadClass(String name) throws ClassNotFoundException
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.jbossmc.framework;
+
+//$Id$
+
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
+
+/**
+ * An implementation of an OSGi FrameworkFactory
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 29-Jul-2009
+ */
+public class FrameworkFactoryImpl implements FrameworkFactory
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(FrameworkFactoryImpl.class);
+
+ public Framework newFramework(Map configuration)
+ {
+ return new FrameworkImpl(configuration);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkImpl.java (from rev 91756, projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkImpl.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,241 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.jbossmc.framework;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.FrameworkEvent;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * An impementation of an OSGi Framework
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 29-Jul-2009
+ */
+public class FrameworkImpl extends BundleImpl implements Framework
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(FrameworkImpl.class);
+
+ private Map configuration;
+ private SystemBundleContext sysContext;
+ private int startLevel;
+
+ public FrameworkImpl(Map configuration)
+ {
+ this.configuration = configuration;
+ }
+
+ /**
+ * Returns the Framework unique identifier. This Framework is assigned the unique identifier zero (0) since this Framework is also a System Bundle.
+ */
+ @Override
+ public long getBundleId()
+ {
+ return 0;
+ }
+
+ /**
+ * Returns the symbolic name of this Framework.
+ */
+ @Override
+ public String getSymbolicName()
+ {
+ return "org.jboss.osgi.jbossmc";
+ }
+
+ /**
+ * Returns the Framework location identifier. This Framework is assigned the unique location "<code>System Bundle</code>" since this Framework is also a
+ * System Bundle.
+ */
+ @Override
+ public String getLocation()
+ {
+ return "System Bundle";
+ }
+
+ int getStartLevel()
+ {
+ return startLevel;
+ }
+
+ void setStartLevel(int startLevel)
+ {
+ this.startLevel = startLevel;
+ }
+
+ @Override
+ public BundleContext getBundleContext()
+ {
+ return sysContext;
+ }
+
+ public void init() throws BundleException
+ {
+ initInternal();
+ }
+
+ @Override
+ public void start() throws BundleException
+ {
+ startInternal();
+ }
+
+ @Override
+ public void start(int options) throws BundleException
+ {
+ startInternal();
+ }
+
+ @Override
+ public void stop() throws BundleException
+ {
+ // [TODO] The method returns immediately to the caller after initiating the following steps
+
+ stopInternal();
+ }
+
+ @Override
+ public void stop(int options) throws BundleException
+ {
+ // [TODO] The method returns immediately to the caller after initiating the following steps
+
+ stopInternal();
+ }
+
+ @Override
+ public void update() throws BundleException
+ {
+ updateInternal();
+ }
+
+ /**
+ * Calling this method is the same as calling {@link #update()} except that any provided InputStream is immediately closed.
+ */
+ @Override
+ public void update(InputStream in) throws BundleException
+ {
+ if (in != null)
+ {
+ try
+ {
+ in.close();
+ }
+ catch (IOException ex)
+ {
+ // ignore
+ }
+ }
+
+ // [TODO] The method returns immediately to the caller after initiating the following steps
+
+ updateInternal();
+ }
+
+ /**
+ * The Framework cannot be uninstalled.
+ * <p>
+ * This method always throws a BundleException.
+ */
+ @Override
+ public void uninstall() throws BundleException
+ {
+ throw new BundleException("The system bundle cannot be uninstalled");
+ }
+
+ private void initInternal()
+ {
+ // This method does nothing if called when this Framework is in the
+ // STARTING, ACTIVE or STOPPING state
+ if (getState() == STARTING || getState() == ACTIVE || getState() == STOPPING)
+ return;
+
+ // Put into the STARTING state
+ setState(STARTING);
+
+ // Have a valid Bundle Context
+ sysContext = new SystemBundleContext(this);
+
+ // Be at start level 0
+ setStartLevel(0);
+
+ // [TODO] Have event handling enabled
+
+ // [TODO] Have reified Bundle objects for all installed bundles
+
+ // [TODO] Have registered any framework services
+ }
+
+ private void startInternal()
+ {
+ // If this Framework is not in the STARTING state, initialize this Framework
+ if (getState() != STARTING)
+ initInternal();
+
+ // [TODO] All installed bundles must be started
+
+ // [TODO] This Framework's state is set to ACTIVE
+ setState(ACTIVE);
+
+ // [TODO] A framework event of type STARTED is fired
+ }
+
+ private void stopInternal()
+ {
+ // [TODO] This Framework's state is set to STOPPING
+
+ // [TODO] All installed bundles must be stopped
+
+ // [TODO] Unregister all services registered by this Framework
+
+ // [TODO] Event handling is disabled
+
+ // [TODO] This Framework's state is set to RESOLVED
+
+ // [TODO] All resources held by this Framework are released.
+
+ // [TODO] Notify all threads that are waiting at waitForStop(long)
+ }
+
+ private void updateInternal()
+ {
+ stopInternal();
+
+ startInternal();
+ }
+
+ public FrameworkEvent waitForStop(long timeout) throws InterruptedException
+ {
+ // [TODO] Wait until this Framework has completely stopped.
+
+ // [TODO] A Framework Event indicating the reason this method returned
+ return new FrameworkEvent(FrameworkEvent.STOPPED, this, null);
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/SystemBundleContext.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/SystemBundleContext.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/SystemBundleContext.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.jbossmc.framework;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * An implementation of the OSGi system BundleContext
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 29-Jul-2009
+ */
+public class SystemBundleContext extends BundleContextImpl
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(SystemBundleContext.class);
+
+ public SystemBundleContext(Framework framework)
+ {
+ super(null, framework);
+ }
+
+ @Override
+ BundleContext getSystemContext()
+ {
+ return this;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/SystemBundleContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1 @@
+org.jboss.osgi.jbossmc.framework.FrameworkFactoryImpl
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java 2009-07-29 02:40:06 UTC (rev 91756)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -1,48 +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.felix;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-
-import org.jboss.osgi.spi.framework.FrameworkLoader;
-import org.junit.Test;
-import org.osgi.framework.launch.Framework;
-
-/**
- * Test OSGi System bundle access
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-Jul-2009
- */
-public class FrameworkLaunchTestCase
-{
- @Test
- public void testFrameworkLaunch()
- {
- Framework framework = FrameworkLoader.newFramework(null);
-
- assertEquals("BundleId == 0", 0, framework.getBundleId());
- assertEquals("SymbolicName", "org.apache.felix.framework", framework.getSymbolicName());
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java 2009-07-29 02:40:06 UTC (rev 91756)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -1,53 +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.felix;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-
-import org.jboss.osgi.felix.FelixIntegration;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-
-/**
- * Test OSGi System bundle access
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public class SystemBundleTestCase extends OSGiTest
-{
- @Test
- public void testFelixIntegration()
- {
- FelixIntegration framework = new FelixIntegration();
- framework.create();
- framework.start();
-
- Bundle bundle = framework.getBundle();
-
- assertEquals("BundleId == 0", 0, bundle.getBundleId());
- assertEquals("SymbolicName", "org.apache.felix.framework", bundle.getSymbolicName());
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/jbossmc/FrameworkLaunchTestCase.java (from rev 91756, projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/jbossmc/FrameworkLaunchTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/jbossmc/FrameworkLaunchTestCase.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,50 @@
+/*
+ * 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.jbossmc;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+
+import org.jboss.osgi.spi.util.ServiceLoader;
+import org.junit.Test;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
+
+/**
+ * Test OSGi System bundle access
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-Jul-2009
+ */
+public class FrameworkLaunchTestCase
+{
+ @Test
+ public void testFrameworkLaunch()
+ {
+ FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
+ Framework framework = factory.newFramework(null);
+
+ assertEquals("BundleId == 0", 0, framework.getBundleId());
+ assertEquals("SymbolicName", "org.jboss.osgi.jbossmc", framework.getSymbolicName());
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -48,53 +48,64 @@
</dependency>
</dependencies>
- <!-- Build -->
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>bundles</id>
- <phase>test-compile</phase>
- <goals>
- <goal>directory-single</goal>
- </goals>
- <configuration>
- <finalName>test-libs</finalName>
- <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
- <appendAssemblyId>false</appendAssemblyId>
- <descriptors>
- <descriptor>scripts/assembly-bundles.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>build-test-jars</id>
- <phase>test-compile</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
- <property name="tests.output.dir" value="${project.build.directory}" />
- <ant antfile="scripts/antrun-test-jars.xml" />
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
<!-- Profiles -->
<profiles>
+
+ <!--
+ Name: noprepare
+ Descr: Skip building the test bundles
+ -->
+ <profile>
+ <id>noprepare</id>
+ <activation>
+ <property>
+ <name>!noprepare</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>bundles</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>directory-single</goal>
+ </goals>
+ <configuration>
+ <finalName>test-libs</finalName>
+ <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>scripts/assembly-bundles.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build-test-jars</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
+ <property name="tests.output.dir" value="${project.build.directory}" />
+ <ant antfile="scripts/antrun-test-jars.xml" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -1,166 +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.
- */
-
-
-//$Id$
-package org.jboss.test.osgi.bootstrap;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import javax.management.MBeanServer;
-import javax.naming.InitialContext;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.jboss.osgi.jaxb.JAXBCapability;
-import org.jboss.osgi.jaxb.JAXBService;
-import org.jboss.osgi.jbossxb.XMLBindingCapability;
-import org.jboss.osgi.jbossxb.XMLBindingService;
-import org.jboss.osgi.jmx.JMXCapability;
-import org.jboss.osgi.jndi.JNDICapability;
-import org.jboss.osgi.spi.testing.OSGiBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiServiceReference;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.xml.XMLParserCapability;
-import org.junit.Test;
-import org.osgi.framework.BundleException;
-
-/**
- * Test OSGi runtime capabilities
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public class CapabilityTestCase extends OSGiTest
-{
- @Test
- public void testXMLParserCapability() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundle = runtime.getBundle("jboss-osgi-apache-xerces", null);
- assertNull("Test bundle null", bundle);
-
- runtime.addCapability(new XMLParserCapability());
-
- OSGiServiceReference saxRef = runtime.getServiceReference(SAXParserFactory.class.getName());
- assertNotNull("SAXParserFactory registered", saxRef);
- assertEquals("namespaceAware", Boolean.TRUE, saxRef.getProperty("parser.namespaceAware"));
- assertEquals("validating", Boolean.TRUE, saxRef.getProperty("parser.validating"));
- assertEquals("xincludeAware", Boolean.TRUE, saxRef.getProperty("parser.xincludeAware"));
-
- OSGiServiceReference domRef = runtime.getServiceReference(DocumentBuilderFactory.class.getName());
- assertNotNull("DocumentBuilderFactory registered", domRef);
- assertEquals("namespaceAware", Boolean.TRUE, domRef.getProperty("parser.namespaceAware"));
- assertEquals("validating", Boolean.TRUE, domRef.getProperty("parser.validating"));
- assertEquals("xincludeAware", Boolean.TRUE, domRef.getProperty("parser.xincludeAware"));
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testJAXBCapability() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundle = runtime.getBundle("jboss-osgi-jaxb", null);
- assertNull("Test bundle null", bundle);
-
- runtime.addCapability(new JAXBCapability());
-
- OSGiServiceReference saxRef = runtime.getServiceReference(JAXBService.class.getName());
- assertNotNull("JAXBService registered", saxRef);
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testXMLBindingCapability() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundle = runtime.getBundle("jboss-osgi-xml-binding", null);
- assertNull("Test bundle null", bundle);
-
- runtime.addCapability(new XMLBindingCapability());
-
- OSGiServiceReference saxRef = runtime.getServiceReference(XMLBindingService.class.getName());
- assertNotNull("XMLBindingService registered", saxRef);
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testJNDICapability() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundle = runtime.getBundle("jboss-osgi-jndi", null);
- assertNull("Test bundle null", bundle);
-
- runtime.addCapability(new JNDICapability());
-
- OSGiServiceReference saxRef = runtime.getServiceReference(InitialContext.class.getName());
- assertNotNull("InitialContext registered", saxRef);
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testJMXCapability() throws Exception
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundle = runtime.getBundle("jboss-osgi-jmx", null);
- assertNull("Test bundle null", bundle);
-
- runtime.addCapability(new JMXCapability());
-
- OSGiServiceReference saxRef = runtime.getServiceReference(MBeanServer.class.getName());
- assertNotNull("MBeanServer registered", saxRef);
- }
- finally
- {
- runtime.shutdown();
- }
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java (from rev 91756, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,166 @@
+/*
+ * 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.
+ */
+
+
+//$Id$
+package org.jboss.test.osgi.capabilities;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import javax.management.MBeanServer;
+import javax.naming.InitialContext;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.jboss.osgi.jaxb.JAXBCapability;
+import org.jboss.osgi.jaxb.JAXBService;
+import org.jboss.osgi.jbossxb.XMLBindingCapability;
+import org.jboss.osgi.jbossxb.XMLBindingService;
+import org.jboss.osgi.jmx.JMXCapability;
+import org.jboss.osgi.jndi.JNDICapability;
+import org.jboss.osgi.spi.testing.OSGiBundle;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiServiceReference;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.xml.XMLParserCapability;
+import org.junit.Test;
+import org.osgi.framework.BundleException;
+
+/**
+ * Test OSGi runtime capabilities
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public class CapabilityTestCase extends OSGiTest
+{
+ @Test
+ public void testXMLParserCapability() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-apache-xerces", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new XMLParserCapability());
+
+ OSGiServiceReference saxRef = runtime.getServiceReference(SAXParserFactory.class.getName());
+ assertNotNull("SAXParserFactory registered", saxRef);
+ assertEquals("namespaceAware", Boolean.TRUE, saxRef.getProperty("parser.namespaceAware"));
+ assertEquals("validating", Boolean.TRUE, saxRef.getProperty("parser.validating"));
+ assertEquals("xincludeAware", Boolean.TRUE, saxRef.getProperty("parser.xincludeAware"));
+
+ OSGiServiceReference domRef = runtime.getServiceReference(DocumentBuilderFactory.class.getName());
+ assertNotNull("DocumentBuilderFactory registered", domRef);
+ assertEquals("namespaceAware", Boolean.TRUE, domRef.getProperty("parser.namespaceAware"));
+ assertEquals("validating", Boolean.TRUE, domRef.getProperty("parser.validating"));
+ assertEquals("xincludeAware", Boolean.TRUE, domRef.getProperty("parser.xincludeAware"));
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ @Test
+ public void testJAXBCapability() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-jaxb", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new JAXBCapability());
+
+ OSGiServiceReference saxRef = runtime.getServiceReference(JAXBService.class.getName());
+ assertNotNull("JAXBService registered", saxRef);
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ @Test
+ public void testXMLBindingCapability() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-xml-binding", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new XMLBindingCapability());
+
+ OSGiServiceReference saxRef = runtime.getServiceReference(XMLBindingService.class.getName());
+ assertNotNull("XMLBindingService registered", saxRef);
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ @Test
+ public void testJNDICapability() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-jndi", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new JNDICapability());
+
+ OSGiServiceReference saxRef = runtime.getServiceReference(InitialContext.class.getName());
+ assertNotNull("InitialContext registered", saxRef);
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ @Test
+ public void testJMXCapability() throws Exception
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-jmx", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new JMXCapability());
+
+ OSGiServiceReference saxRef = runtime.getServiceReference(MBeanServer.class.getName());
+ assertNotNull("MBeanServer registered", saxRef);
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/framework/FrameworkTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/framework/FrameworkTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/framework/FrameworkTestCase.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,192 @@
+/*
+ * 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.framework;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * Test the Framework functionality
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 29-Jul-2009
+ */
+public class FrameworkTestCase
+{
+ public static Framework framework;
+
+ @BeforeClass
+ public static void beforeClass() throws BundleException
+ {
+ OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+ framework = bootProvider.getFramework();
+ framework.start();
+ }
+
+ @Test
+ public void testGetBundleId()
+ {
+ assertEquals("BundleId == 0", 0, framework.getBundleId());
+ }
+
+ @Test
+ public void testGetSymbolicName()
+ {
+ assertNotNull("SymbolicName not null", framework.getSymbolicName());
+ }
+
+ @Test
+ public void testGetLocation()
+ {
+ assertEquals("System Bundle", framework.getLocation());
+ }
+
+ @Test
+ public void testUninstall()
+ {
+ try
+ {
+ framework.uninstall();
+ fail("BundleException expected");
+ }
+ catch (BundleException ex)
+ {
+ // expected
+ }
+ }
+
+ @Test
+ @Ignore
+ public void testFindEntries()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetBundleContext()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetEntry()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetEntryPaths()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetHeaders()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetLastModified()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetRegisteredServices()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetResource()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetResources()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetServicesInUse()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetSignerCertificates()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetState()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetVersion()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testHasPermission()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testLoadClass()
+ {
+
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/framework/FrameworkTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-jbossmc.properties (from rev 91756, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-jbossmc.properties (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-jbossmc.properties 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,10 @@
+#
+# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
+#
+# $Id$
+#
+
+# Properties to configure the Framework
+org.osgi.framework.storage=${basedir}/target/osgi-store
+org.osgi.framework.storage.clean=onFirstInit
+
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties 2009-07-29 20:49:03 UTC (rev 91789)
@@ -1,45 +0,0 @@
-#
-# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
-#
-# $Id$
-#
-
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.knopflerfish.framework.KnopflerfishIntegration
-
-# Properties to configure the Framework
-org.osgi.framework.storage=${basedir}/target/osgi-store
-org.osgi.framework.storage.clean=onFirstInit
-
-# Extra System Packages
-org.osgi.framework.system.packages=\
- javax.management, \
- org.apache.log4j, \
- org.jboss.logging, \
- org.jboss.net.protocol, \
- org.jboss.osgi.spi;version=1.0, \
- org.jboss.osgi.spi.capability;version=1.0, \
- org.jboss.osgi.spi.logging;version=1.0, \
- org.jboss.osgi.spi.management;version=1.0, \
- org.jboss.osgi.spi.service;version=1.0, \
- org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.virtual, \
- org.jboss.virtual.plugins.registry, \
- org.jboss.virtual.plugins.context.jar, \
- org.jboss.virtual.plugins.vfs.helpers, \
- org.jboss.virtual.protocol, \
- org.jboss.util, \
- org.jboss.util.id, \
- org.jboss.util.threadpool, \
- org.jboss.util.propertyeditor, \
- org.osgi.framework;version\=1.4, \
- org.osgi.service.startlevel;version\=1.1
-
-# Bundles that need to be installed with the Framework automatically
-# org.jboss.osgi.spi.framework.autoInstall=\
-# file://${test.archive.directory}/bundles/org.osgi.compendium.jar
-
-# Bundles that need to be started automatically
-# org.jboss.osgi.spi.framework.autoStart=\
-# file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
-# file://${test.archive.directory}/bundles/jboss-osgi-common.jar
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -46,16 +46,21 @@
<groupId>biz.aQute</groupId>
<artifactId>bnd</artifactId>
</dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>${version.javax.servlet}</version>
- </dependency>
<dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${version.javax.servlet}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.naming</groupId>
<artifactId>jnpserver</artifactId>
<version>${version.jboss.naming}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ <version>${version.jboss.osgi.spi}</version>
+ </dependency>
<!-- Bundle Dependencies -->
<dependency>
@@ -170,6 +175,7 @@
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-runtime-felix</artifactId>
<version>${version.jboss.osgi.runtime.felix}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
@@ -197,6 +203,7 @@
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-runtime-equinox</artifactId>
<version>${version.jboss.osgi.runtime.equinox}</version>
+ <scope>provided</scope>
</dependency>
</dependencies>
<build>
@@ -215,22 +222,23 @@
</profile>
<!--
- Name: framework-knopflerfish
+ Name: framework-jbossmc
Descr: Setup for Knopflerfish framework integration testing
-->
<profile>
- <id>framework-knopflerfish</id>
+ <id>framework-jbossmc</id>
<activation>
<property>
<name>framework</name>
- <value>knopflerfish</value>
+ <value>jbossmc</value>
</property>
</activation>
<dependencies>
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
- <version>${version.jboss.osgi.runtime.knopflerfish}</version>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-jbossmc</artifactId>
+ <version>${version.jboss.osgi.runtime.jbossmc}</version>
+ <scope>provided</scope>
</dependency>
</dependencies>
<build>
@@ -240,7 +248,7 @@
<configuration>
<includes>
<!-- Minimal bootstrap testing -->
- <include>org/jboss/test/osgi/bootstrap/BootstrapTestCase.*</include>
+ <include>org/jboss/test/osgi/framework/**</include>
</includes>
</configuration>
</plugin>
14 years, 9 months
JBoss-OSGI SVN: r91763 - projects/jboss-osgi/projects/parent/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-29 08:16:11 -0400 (Wed, 29 Jul 2009)
New Revision: 91763
Modified:
projects/jboss-osgi/projects/parent/trunk/pom.xml
Log:
version=1.0.2-SNAPSHOT
Modified: projects/jboss-osgi/projects/parent/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/parent/trunk/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
+++ projects/jboss-osgi/projects/parent/trunk/pom.xml 2009-07-29 12:16:11 UTC (rev 91763)
@@ -10,7 +10,7 @@
<url>http://www.jboss.org/community/wiki/JBossOSGi</url>
<description>JBossOSGi</description>
- <version>1.0.1</version>
+ <version>1.0.2-SNAPSHOT</version>
<!-- Properties -->
<properties>
14 years, 9 months
JBoss-OSGI SVN: r91762 - in projects/jboss-osgi: projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal and 22 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-29 08:14:37 -0400 (Wed, 29 Jul 2009)
New Revision: 91762
Removed:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LogEntryImpl.java
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryFilter.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkLoader.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/NamedInstanceProvider.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiFramework.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryCache.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryFilter.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/internal/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log/
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java
projects/jboss-osgi/projects/spi/trunk/pom.xml
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrapProvider.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/OSGiConstantsHelper.java
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/impl/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
projects/jboss-osgi/trunk/reactor/bundles/
projects/jboss-osgi/trunk/reactor/pom.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java
projects/jboss-osgi/trunk/testsuite/pom.xml
projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-bundles.xml
Log:
Update to r4v42
Modified: projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -21,7 +21,7 @@
<artifactId>jboss-osgi-common</artifactId>
<packaging>bundle</packaging>
- <version>1.0.0</version>
+ <version>1.0.1-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -97,6 +97,29 @@
</instructions>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <!-- For some reason the distribution javadoc module needs this -->
+ <file>target/${artifactId}-${version}-sources.jar</file>
+ <classifier>sources</classifier>
+ <type>jar</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Deleted: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LogEntryImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LogEntryImpl.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LogEntryImpl.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,137 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.common.internal;
-
-// $Id$
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogService;
-
-/**
- * A unified implementation of a LogEntry.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 09-Apr-2009
- */
-public class LogEntryImpl implements LogEntry
-{
- private long time;
- private int level;
- private Bundle bundle;
- private ServiceReference sref;
- private String message;
- private Throwable exception;
-
- private String bndStr;
- private String srefStr;
-
- public LogEntryImpl(LogEntry le)
- {
- this(le.getTime(), le.getBundle(), le.getServiceReference(), le.getLevel(), le.getMessage(), le.getException());
- }
-
- public LogEntryImpl(long time, Bundle bundle, ServiceReference sref, int level, String message, Throwable exception)
- {
- this.time = time;
- this.bundle = bundle;
- this.sref = sref;
- this.level = level;
- this.message = message;
- this.exception = exception;
-
- if (bundle != null)
- bndStr = bundle.getSymbolicName();
-
- if (sref != null && sref.getBundle() != null)
- srefStr = sref.getBundle().getSymbolicName();
- }
-
- public Bundle getBundle()
- {
- return bundle;
- }
-
- public Throwable getException()
- {
- return exception;
- }
-
- public int getLevel()
- {
- return level;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- public ServiceReference getServiceReference()
- {
- return sref;
- }
-
- public long getTime()
- {
- return time;
- }
-
- private String logLevel(int level)
- {
- String logLevel;
- switch (level)
- {
- case LogService.LOG_DEBUG:
- logLevel = "DEBUG";
- break;
- case LogService.LOG_INFO:
- logLevel = "INFO";
- break;
- case LogService.LOG_WARNING:
- logLevel = "WARN";
- break;
- case LogService.LOG_ERROR:
- logLevel = "ERROR";
- break;
- default:
- logLevel = "Level=" + level;
- }
- return logLevel;
- }
-
- @Override
- public String toString()
- {
- String t = new SimpleDateFormat("dd-MMM-yyyy HH:mm.ss.SSS").format(new Date(time));
- String l = " " + logLevel(level);
- String s = srefStr != null ? ",sref=" + srefStr : "";
- String b = ",bnd=" + bndStr;
- String m = ",msg=" + message;
- String e = exception != null ? ",ex=" + exception : "";
- return "[" + t + l + b + s + m + e + "]";
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,171 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.common.log;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.osgi.common.internal.LogEntryImpl;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogListener;
-
-/**
- * A LogListener that caches LogEntry objects for later retrieval.
- *
- * The entries can be filtered with a list of {@link LogEntryFilter} instances.
- * A log entry is cached if it matches at least one of the registered filters.
- * If there is no filter registered entries are cached unconditionally.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 09-Apr-2009
- */
-public class LogEntryCache implements LogListener
-{
- private List<LogEntry> entries = new ArrayList<LogEntry>();
- private List<LogEntryFilter> filters = new ArrayList<LogEntryFilter>();
-
- /**
- * Create a LogEntryCache with a single associated filter
- */
- public LogEntryCache(LogEntryFilter filter)
- {
- filters.add(filter);
- }
-
- /**
- * Create a LogEntryCache with no associated filters
- */
- public LogEntryCache()
- {
- }
-
- /**
- * Add a LogEntryFilter
- */
- public void addFilter(LogEntryFilter filter)
- {
- filters.add(filter);
- }
-
- /**
- * Clear the list of cached entries.
- */
- public void clear()
- {
- synchronized (entries)
- {
- entries.clear();
- }
- }
-
- /**
- * Clear the list of registered filters.
- */
- public void clearFilters()
- {
- // filters.clear() would need synchronization
- filters = new ArrayList<LogEntryFilter>();
- }
-
- /**
- * Get the list of cached entries.
- *
- * Note, that the LogService delivers LogEntries asynchronously.
- * Client should not rely on a certain LogEntry already beein delivered
- * when calling this method.
- */
- public List<LogEntry> getLog()
- {
- return getLog(false);
- }
-
- /**
- * Get the list of cached entries and optionally clears the list.
- *
- * Note, that the LogService delivers LogEntries asynchronously.
- * Client should not rely on a certain LogEntry already beein delivered
- * when calling this method.
- */
- public List<LogEntry> getLog(boolean clear)
- {
- synchronized (entries)
- {
- ArrayList<LogEntry> retList = new ArrayList<LogEntry>(entries);
- if (clear == true)
- entries.clear();
-
- return retList;
- }
- }
-
- /**
- * Listener method called for each LogEntry object created.
- */
- public void logged(LogEntry entry)
- {
- // Replace entry with a unified wrapper
- entry = new LogEntryImpl(entry);
-
- List<LogEntryFilter> snapshot = new ArrayList<LogEntryFilter>(filters);
- synchronized (entries)
- {
- if (snapshot.size() == 0)
- {
- entries.add(entry);
- return;
- }
-
- // Add the entry if if matches at least one filter
- for (LogEntryFilter filter : snapshot)
- {
- if (match(filter, entry))
- {
- entries.add(entry);
- break;
- }
- }
- }
- }
-
- private boolean match(LogEntryFilter filter, LogEntry entry)
- {
- boolean match = entry.getLevel() <= filter.getLevel();
-
- if (match && filter.getBundleRegex() != null)
- {
- String entryBnd = entry.getBundle().getSymbolicName();
- String filterRegex = filter.getBundleRegex();
- match = entryBnd.matches(filterRegex);
- }
-
- if (match && filter.getMessageRegex() != null)
- {
- String entryMsg = entry.getMessage();
- String filterRegex = filter.getMessageRegex();
- match = entryMsg.matches(filterRegex);
- }
-
- return match;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryFilter.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryFilter.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryFilter.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.common.log;
-
-//$Id$
-
-
-/**
- * A LogEntry filter that can be used with the LogEntryCache
- *
- * @author thomas.diesler(a)jboss.com
- * @since 09-Apr-2009
- */
-public class LogEntryFilter
-{
- private int level;
- private String bndRegex;
- private String msgRegex;
-
- /**
- * Create a LogEntryFilter with the associated criteria.
- *
- * @param bndRegex A regex that matches a Bundle's SymbolicName
- * @param level The maximum log level accepted by this filter
- * @param msgRegex A regex that matches the log message
- */
- public LogEntryFilter(String bndRegex, int level, String msgRegex)
- {
- this.bndRegex = bndRegex;
- this.msgRegex = msgRegex;
- this.level = level < 1 ? Integer.MAX_VALUE : level;
- }
-
- /**
- * Create a LogEntryFilter with the associated criteria.
- *
- * @param bndRegex A regex that matches a Bundle's SymbolicName
- * @param level The maximum log level accepted by this filter
- */
- public LogEntryFilter(String bndRegex, int level)
- {
- this(bndRegex, level, null);
- }
-
- /**
- * Create a LogEntryFilter with the associated criteria.
- *
- * @param bndRegex A regex that matches a Bundle's SymbolicName
- */
- public LogEntryFilter(String bndRegex)
- {
- this(bndRegex, Integer.MAX_VALUE, null);
- }
-
- /**
- * Get the Bundle Symbolic-Name regex.
- */
- public String getBundleRegex()
- {
- return bndRegex;
- }
-
- /**
- * Get the log message regex.
- */
- public String getMessageRegex()
- {
- return msgRegex;
- }
-
- /**
- * Get the log entry maximum log level.
- */
- public int getLevel()
- {
- return level;
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -25,9 +25,10 @@
import static org.junit.Assert.assertEquals;
-import org.jboss.osgi.spi.framework.FrameworkLoader;
+import org.jboss.osgi.spi.util.ServiceLoader;
import org.junit.Test;
import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
/**
* Test OSGi System bundle access
@@ -40,7 +41,8 @@
@Test
public void testFrameworkLaunch()
{
- Framework framework = FrameworkLoader.newFramework(null);
+ FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
+ Framework framework = factory.newFramework(null);
assertEquals("BundleId == 0", 0, framework.getBundleId());
assertEquals("SymbolicName", "org.eclipse.osgi", framework.getSymbolicName());
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -29,14 +29,15 @@
import java.util.List;
import java.util.Map;
-import org.apache.felix.framework.Felix;
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.FrameworkException;
-import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.logging.ExportedPackageHelper;
+import org.jboss.osgi.spi.util.ServiceLoader;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
/**
* An abstraction of an OSGi Framework
@@ -44,7 +45,7 @@
* @author thomas.diesler(a)jboss.com
* @since 23-Jan-2009
*/
-public class FelixIntegration implements OSGiFramework
+public class FelixIntegration
{
// Provide logging
final Logger log = Logger.getLogger(FelixIntegration.class);
@@ -53,7 +54,7 @@
private List<URL> autoInstall = new ArrayList<URL>();
private List<URL> autoStart = new ArrayList<URL>();
- private Felix framework;
+ private Framework framework;
public Map<String, Object> getProperties()
{
@@ -108,8 +109,9 @@
// An instance of Logger that the framework uses as its default logger
properties.put("felix.log.logger", new FelixLogger());
- // Init the System Bundle
- framework = new Felix(properties);
+ // Load the framework instance
+ FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
+ framework = factory.newFramework(properties);
}
public void start()
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -25,9 +25,10 @@
import static org.junit.Assert.assertEquals;
-import org.jboss.osgi.spi.framework.FrameworkLoader;
+import org.jboss.osgi.spi.util.ServiceLoader;
import org.junit.Test;
import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
/**
* Test OSGi System bundle access
@@ -40,7 +41,8 @@
@Test
public void testFrameworkLaunch()
{
- Framework framework = FrameworkLoader.newFramework(null);
+ FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
+ Framework framework = factory.newFramework(null);
assertEquals("BundleId == 0", 0, framework.getBundleId());
assertEquals("SymbolicName", "org.apache.felix.framework", framework.getSymbolicName());
Deleted: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,53 +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.felix;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-
-import org.jboss.osgi.felix.FelixIntegration;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-
-/**
- * Test OSGi System bundle access
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public class SystemBundleTestCase extends OSGiTest
-{
- @Test
- public void testFelixIntegration()
- {
- FelixIntegration framework = new FelixIntegration();
- framework.create();
- framework.start();
-
- Bundle bundle = framework.getBundle();
-
- assertEquals("BundleId == 0", 0, bundle.getBundleId());
- assertEquals("SymbolicName", "org.apache.felix.framework", bundle.getSymbolicName());
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -80,6 +80,29 @@
<!-- Build -->
<build>
<plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <!-- For some reason the distribution javadoc module needs this -->
+ <file>target/${artifactId}-${version}-sources.jar</file>
+ <classifier>sources</classifier>
+ <type>jar</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkLoader.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkLoader.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkLoader.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.framework;
-
-//$Id$
-
-import java.util.Map;
-
-import org.jboss.osgi.spi.util.ServiceLoader;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.launch.Framework;
-import org.osgi.framework.launch.FrameworkFactory;
-
-/**
- * The FrameworkLoader uses the {@link org.osgi.framework.launch} API to load a new
- * instance on a {@link Framework}.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 28-Jul-2009
- */
-public abstract class FrameworkLoader
-{
- /**
- * Create a new {@link Framework} instance.
- *
- * @param configuration The framework properties to configure the new
- * framework instance. If framework properties are not provided by
- * the configuration argument, the created framework instance must
- * use some reasonable default configuration appropriate for the
- * current VM. For example, the system packages for the current
- * execution environment should be properly exported. The specified
- * configuration argument may be <code>null</code>. The created
- * framework instance must copy any information needed from the
- * specified configuration argument since the configuration argument
- * can be changed after the framework instance has been created.
- * @return A new, configured {@link Framework} instance. The framework
- * instance must be in the {@link Bundle#INSTALLED} state.
- * @throws SecurityException If the caller does not have
- * <code>AllPermission</code>, and the Java Runtime Environment
- * supports permissions.
- */
- @SuppressWarnings("unchecked")
- public static Framework newFramework(Map configuration)
- {
- FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
- if (factory == null)
- throw new IllegalStateException("Cannot load FrameworkFactory");
-
- return factory.newFramework(configuration);
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/NamedInstanceProvider.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/NamedInstanceProvider.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/NamedInstanceProvider.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.framework;
-
-// $Id$
-
-/**
- * Provide a named instance from the configuration.
- *
- * @author ales.justin(a)jboss.com
- * @author thomas.diesler(a)jboss.com
- */
-public interface NamedInstanceProvider
-{
- /**
- * Get a named instance
- *
- * @param name the attribute name
- * @return attribute
- */
- Object getInstance(String name);
-
- /**
- * Get a named instance for a given type
- *
- * @param <T> exact attribute type
- * @param name the attribute name
- * @param expectedType the expected type
- * @return attribute
- */
- <T> T getInstance(String name, Class<T> expectedType);
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -44,7 +44,9 @@
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
+import org.osgi.framework.launch.Framework;
/**
* The OSGiBootstrap provides an {@link OSGiFramework} through a {@link OSGiBootstrapProvider}.
@@ -102,7 +104,7 @@
initBootstrap();
OSGiBootstrapProvider bootProvider = getBootstrapProvider();
- OSGiFramework framework = bootProvider.getFramework();
+ Framework framework = bootProvider.getFramework();
Runtime runtime = Runtime.getRuntime();
runtime.addShutdownHook(new ShutdownThread(framework));
@@ -206,7 +208,7 @@
{
try
{
- return file.toURL();
+ return file.toURI().toURL();
}
catch (MalformedURLException e)
{
@@ -216,9 +218,9 @@
class StartupThread extends Thread
{
- private OSGiFramework framework;
+ private Framework framework;
- public StartupThread(OSGiFramework framework)
+ public StartupThread(Framework framework)
{
this.framework = framework;
}
@@ -227,7 +229,14 @@
{
// Start the framework
final long beforeStart = System.currentTimeMillis();
- framework.start();
+ try
+ {
+ framework.start();
+ }
+ catch (BundleException ex)
+ {
+ throw new IllegalStateException("Cannot start framework", ex);
+ }
final long afterStart = System.currentTimeMillis();
// Report how long it took to boot and do the first scan
@@ -278,9 +287,9 @@
class ShutdownThread extends Thread
{
- private OSGiFramework framework;
+ private Framework framework;
- public ShutdownThread(OSGiFramework framework)
+ public ShutdownThread(Framework framework)
{
this.framework = framework;
}
@@ -288,7 +297,14 @@
public void run()
{
log.info("Initiating shutdown ...");
- framework.stop();
+ try
+ {
+ framework.stop();
+ }
+ catch (BundleException ex)
+ {
+ log.error("Cannot stop framework", ex);
+ }
log.info("Shutdown complete");
}
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrapProvider.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrapProvider.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -26,38 +26,26 @@
import java.io.InputStream;
import java.net.URL;
+import org.osgi.framework.launch.Framework;
+
/**
- * An OSGiBootstrapProvider provides an OSGiFramework
+ * An OSGiBootstrapProvider provides an OSGi Framework
* <p/>
- * Implementations would configure the OSGiFramework through some form of descriptor.
- * <p/>
- * Natively, the SPI provides an OSGiBootstrapProvider that is based on the Microkernel.
+ * Implementations would configure the OSGi Framework through some form of descriptor.
*
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
*/
-public interface OSGiBootstrapProvider extends NamedInstanceProvider
+public interface OSGiBootstrapProvider
{
- /** The Framework bean name - jboss.osgi:service=Framework */
- public static final String DEFAULT_FRAMEWORK_NAME = "jboss.osgi:service=Framework";
-
/**
- * Get the OSGiFramework that registerd with the default name
+ * Get the configured OSGi Framework
*
* @return The configured instance of a Framework
- * @throws IllegalArgumentException if this is not AttributeProvider instance
*/
- OSGiFramework getFramework();
+ Framework getFramework();
/**
- * Get an OSGiFramework with a given name from this OSGiBootstrapProvider
- *
- * @param name the framework name
- * @return The configured instance of a Framework, or null
- */
- OSGiFramework getFramework(String name);
-
- /**
* Configure this provider with the default configuration
*/
void configure();
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiFramework.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiFramework.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiFramework.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.framework;
-
-//$Id$
-
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * An abstraction of an OSGi Framework
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public interface OSGiFramework
-{
- /*
- * * Get the Framework properties
- */
- Map<String, Object> getProperties();
-
- /*
- * * Set the Framework properties. This can only be done before the Framework is started.
- */
- void setProperties(Map<String, Object> props);
-
- /*
- * * Get the list of bundles that get installed automatically
- */
- List<URL> getAutoInstall();
-
- /*
- * * Set the list of bundles that get installed automatically. This can only be done before the Framework is started.
- */
- void setAutoInstall(List<URL> autoInstall);
-
- /*
- * * Get the list of bundles that get installed and started automatically
- */
- List<URL> getAutoStart();
-
- /*
- * * Set the list of bundles that get installed and started automatically. This can only be done before the Framework is started.
- */
- void setAutoStart(List<URL> autoStart);
-
- /*
- * * Start the Framework
- */
- void start();
-
- /*
- * * Stop the Framework
- */
- void stop();
-
- /*
- * * Get the System Bundle associated with this Framework
- */
- Bundle getBundle();
-
- /*
- * * Get the System Bundle Context associated with this Framework
- */
- BundleContext getBundleContext();
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -29,6 +29,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Dictionary;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
@@ -37,8 +38,20 @@
import java.util.Properties;
import java.util.Set;
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.FrameworkException;
import org.jboss.osgi.spi.NotImplementedException;
import org.jboss.osgi.spi.internal.StringPropertyReplacer;
+import org.jboss.osgi.spi.logging.ExportedPackageHelper;
+import org.jboss.osgi.spi.util.ServiceLoader;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.FrameworkEvent;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
/**
* A simple properties based bootstrap provider
@@ -82,13 +95,14 @@
*/
public class PropertiesBootstrapProvider implements OSGiBootstrapProvider
{
+ // Provide logging
+ final Logger log = Logger.getLogger(PropertiesBootstrapProvider.class);
+
/** The default framework property: jboss.osgi.framework.properties */
public static final String OSGI_FRAMEWORK_CONFIG = "jboss.osgi.framework.properties";
/** The default framework config: jboss-osgi-framework.properties */
public static final String DEFAULT_OSGI_FRAMEWORK_PROPERTIES = "jboss-osgi-framework.properties";
- /** The OSGi framework integration class: org.jboss.osgi.spi.framework.impl */
- public static final String PROP_OSGI_FRAMEWORK_IMPL = "org.jboss.osgi.spi.framework.impl";
/** Optional list of bundles that get installed automatically: org.jboss.osgi.spi.framework.autoInstall */
public static final String PROP_OSGI_FRAMEWORK_AUTO_INSTALL = "org.jboss.osgi.spi.framework.autoInstall";
/** Optional list of bundles that get started automatically: org.jboss.osgi.spi.framework.autoStart */
@@ -99,13 +113,12 @@
private static Set<String> internalProps = new HashSet<String>();
static
{
- internalProps.add(PROP_OSGI_FRAMEWORK_IMPL);
internalProps.add(PROP_OSGI_FRAMEWORK_AUTO_INSTALL);
internalProps.add(PROP_OSGI_FRAMEWORK_AUTO_START);
internalProps.add(PROP_OSGI_FRAMEWORK_EXTRA);
}
- private OSGiFramework framework;
+ private Framework framework;
private boolean configured;
public void configure()
@@ -116,28 +129,87 @@
public void configure(URL urlConfig)
{
// Read the configuration properties
- Properties props = getBootstrapProperties(urlConfig);
+ final Map<String, Object> props = getBootstrapProperties(urlConfig);
// Load the framework instance
- framework = loadFrameworkImpl(urlConfig, props);
+ FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
+ final Framework frameworkImpl = factory.newFramework(props);
+ framework = new FrameworkDelegate(frameworkImpl)
+ {
+ @Override
+ public void start() throws BundleException
+ {
+ super.start();
+
+ // Get system bundle context
+ BundleContext context = framework.getBundleContext();
+ if (context == null)
+ throw new FrameworkException("Cannot obtain system context");
- // Process Framework props
- initFrameworkProperties(props);
+ // Log the the framework packages
+ ExportedPackageHelper packageHelper = new ExportedPackageHelper(context);
+ packageHelper.logExportedPackages(frameworkImpl);
+
+ // Init the the autoInstall URLs
+ List<URL> autoInstall = getBundleURLs(props, PROP_OSGI_FRAMEWORK_AUTO_INSTALL);
- // Init the the autoInstall URLs
- List<URL> installURLs = getBundleURLs(props, PROP_OSGI_FRAMEWORK_AUTO_INSTALL);
- framework.setAutoInstall(installURLs);
+ // Init the the autoStart URLs
+ List<URL> autoStart = getBundleURLs(props, PROP_OSGI_FRAMEWORK_AUTO_START);
- // Init the the autoStart URLs
- List<URL> startURLs = getBundleURLs(props, PROP_OSGI_FRAMEWORK_AUTO_START);
- framework.setAutoStart(startURLs);
+ Map<URL, Bundle> autoBundles = new HashMap<URL, Bundle>();
+ // Add the autoStart bundles to autoInstall
+ for (URL bundleURL : autoStart)
+ {
+ autoInstall.add(bundleURL);
+ }
+
+ // Install autoInstall bundles
+ for (URL bundleURL : autoInstall)
+ {
+ try
+ {
+ Bundle bundle = context.installBundle(bundleURL.toString());
+ long bundleId = bundle.getBundleId();
+ log.info("Installed bundle [" + bundleId + "]: " + bundle.getSymbolicName());
+ autoBundles.put(bundleURL, bundle);
+ }
+ catch (BundleException ex)
+ {
+ //framework.stop();
+ throw new IllegalStateException("Cannot install bundle: " + bundleURL, ex);
+ }
+ }
+
+ // Start autoStart bundles
+ for (URL bundleURL : autoStart)
+ {
+ try
+ {
+ Bundle bundle = autoBundles.get(bundleURL);
+ if (bundle != null)
+ {
+ bundle.start();
+ packageHelper.logExportedPackages(bundle);
+ log.info("Started bundle: " + bundle.getSymbolicName());
+ }
+ }
+ catch (BundleException ex)
+ {
+ //framework.stop();
+ throw new IllegalStateException("Cannot start bundle: " + bundleURL, ex);
+ }
+ }
+ }
+ };
+
+
configured = true;
}
- private List<URL> getBundleURLs(Properties props, String key)
+ private List<URL> getBundleURLs(Map<String, Object> props, String key)
{
- String bundleList = props.getProperty(key);
+ String bundleList = (String)props.get(key);
if (bundleList == null)
bundleList = "";
@@ -181,7 +253,7 @@
throw new NotImplementedException();
}
- public OSGiFramework getFramework()
+ public Framework getFramework()
{
if (configured == false)
{
@@ -191,59 +263,8 @@
return framework;
}
- public OSGiFramework getFramework(String name)
- {
- throw new NotImplementedException();
- }
-
- public Object getInstance(String name)
- {
- throw new NotImplementedException();
- }
-
- public <T> T getInstance(String name, Class<T> expectedType)
- {
- throw new NotImplementedException();
- }
-
- private void initFrameworkProperties(Properties props)
- {
- Map<String, Object> frameworkProps = new HashMap<String, Object>();
- Enumeration<?> keys = props.propertyNames();
- while (keys.hasMoreElements())
- {
- String key = (String)keys.nextElement();
- if (internalProps.contains(key) == false)
- {
- String value = props.getProperty(key);
- frameworkProps.put(key, value);
- }
- }
- framework.setProperties(frameworkProps);
- }
-
- private OSGiFramework loadFrameworkImpl(URL urlConfig, Properties props)
- {
- String frameworkImpl = props.getProperty(PROP_OSGI_FRAMEWORK_IMPL);
- if (frameworkImpl == null)
- throw new IllegalStateException("Cannot get : " + urlConfig);
-
- OSGiFramework framework;
- try
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- Class<?> frameworkClass = ctxLoader.loadClass(frameworkImpl);
- framework = (OSGiFramework)frameworkClass.newInstance();
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot load framework: " + frameworkImpl, ex);
- }
- return framework;
- }
-
@SuppressWarnings("unchecked")
- private Properties getBootstrapProperties(URL urlConfig)
+ private Map<String, Object> getBootstrapProperties(URL urlConfig)
{
Properties props = new Properties();
try
@@ -257,13 +278,31 @@
throw new IllegalStateException("Cannot load properties from: " + urlConfig, ex);
}
- // Replace system properties
+ Map<String, Object> propMap = new HashMap<String, Object>();
+
+ // Process property list
Enumeration<String> keys = (Enumeration<String>)props.propertyNames();
while (keys.hasMoreElements())
{
String key = keys.nextElement();
String value = props.getProperty(key);
- props.setProperty(key, StringPropertyReplacer.replaceProperties(value));
+
+ // Replace property variables
+ propMap.put(key, StringPropertyReplacer.replaceProperties(value));
+
+ if (key.endsWith(".instance"))
+ {
+ try
+ {
+ String subkey = key.substring(0, key.lastIndexOf(".instance"));
+ Object instance = Class.forName(value).newInstance();
+ propMap.put(subkey, instance);
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot load " + key + "=" + value, ex);
+ }
+ }
}
// Merge optional extra properties
@@ -284,7 +323,7 @@
File propsFile = new File(extraPropsValue);
try
{
- extraPropsURL = propsFile.toURL();
+ extraPropsURL = propsFile.toURI().toURL();
}
catch (MalformedURLException e)
{
@@ -295,12 +334,169 @@
if (extraPropsURL == null)
throw new IllegalStateException("Invalid properties URL: " + extraPropsValue);
- props.remove(PROP_OSGI_FRAMEWORK_EXTRA);
- Properties extraProps = getBootstrapProperties(extraPropsURL);
- props.putAll(extraProps);
+ propMap.remove(PROP_OSGI_FRAMEWORK_EXTRA);
+ Map<String, Object> extraProps = getBootstrapProperties(extraPropsURL);
+ propMap.putAll(extraProps);
}
- return props;
+ return propMap;
}
+ class FrameworkDelegate implements Framework
+ {
+ private Framework framework;
+
+ FrameworkDelegate(Framework framework)
+ {
+ this.framework = framework;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration findEntries(String path, String filePattern, boolean recurse)
+ {
+ return framework.findEntries(path, filePattern, recurse);
+ }
+
+ public BundleContext getBundleContext()
+ {
+ return framework.getBundleContext();
+ }
+
+ public long getBundleId()
+ {
+ return framework.getBundleId();
+ }
+
+ public URL getEntry(String path)
+ {
+ return framework.getEntry(path);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration getEntryPaths(String path)
+ {
+ return framework.getEntryPaths(path);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Dictionary getHeaders()
+ {
+ return framework.getHeaders();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Dictionary getHeaders(String locale)
+ {
+ return framework.getHeaders(locale);
+ }
+
+ public long getLastModified()
+ {
+ return framework.getLastModified();
+ }
+
+ public String getLocation()
+ {
+ return framework.getLocation();
+ }
+
+ public ServiceReference[] getRegisteredServices()
+ {
+ return framework.getRegisteredServices();
+ }
+
+ public URL getResource(String name)
+ {
+ return framework.getResource(name);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration getResources(String name) throws IOException
+ {
+ return framework.getResources(name);
+ }
+
+ public ServiceReference[] getServicesInUse()
+ {
+ return framework.getServicesInUse();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map getSignerCertificates(int signersType)
+ {
+ return framework.getSignerCertificates(signersType);
+ }
+
+ public int getState()
+ {
+ return framework.getState();
+ }
+
+ public String getSymbolicName()
+ {
+ return framework.getSymbolicName();
+ }
+
+ public Version getVersion()
+ {
+ return framework.getVersion();
+ }
+
+ public boolean hasPermission(Object permission)
+ {
+ return framework.hasPermission(permission);
+ }
+
+ public void init() throws BundleException
+ {
+ framework.init();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Class loadClass(String name) throws ClassNotFoundException
+ {
+ return framework.loadClass(name);
+ }
+
+ public void start() throws BundleException
+ {
+ framework.start();
+ }
+
+ public void start(int options) throws BundleException
+ {
+ framework.start(options);
+ }
+
+ public void stop() throws BundleException
+ {
+ framework.stop();
+ }
+
+ public void stop(int options) throws BundleException
+ {
+ framework.stop(options);
+ }
+
+ public void uninstall() throws BundleException
+ {
+ framework.uninstall();
+ }
+
+ public void update() throws BundleException
+ {
+ framework.update();
+ }
+
+ public void update(InputStream in) throws BundleException
+ {
+ framework.update(in);
+ }
+
+ public FrameworkEvent waitForStop(long timeout) throws InterruptedException
+ {
+ return framework.waitForStop(timeout);
+ }
+
+ }
}
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryCache.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryCache.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryCache.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,171 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.logging;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.osgi.spi.logging.internal.LogEntryImpl;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogListener;
-
-/**
- * A LogListener that caches LogEntry objects for later retrieval.
- *
- * The entries can be filtered with a list of {@link LogEntryFilter} instances.
- * A log entry is cached if it matches at least one of the registered filters.
- * If there is no filter registered entries are cached unconditionally.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 09-Apr-2009
- */
-public class LogEntryCache implements LogListener
-{
- private List<LogEntry> entries = new ArrayList<LogEntry>();
- private List<LogEntryFilter> filters = new ArrayList<LogEntryFilter>();
-
- /**
- * Create a LogEntryCache with a single associated filter
- */
- public LogEntryCache(LogEntryFilter filter)
- {
- filters.add(filter);
- }
-
- /**
- * Create a LogEntryCache with no associated filters
- */
- public LogEntryCache()
- {
- }
-
- /**
- * Add a LogEntryFilter
- */
- public void addFilter(LogEntryFilter filter)
- {
- filters.add(filter);
- }
-
- /**
- * Clear the list of cached entries.
- */
- public void clear()
- {
- synchronized (entries)
- {
- entries.clear();
- }
- }
-
- /**
- * Clear the list of registered filters.
- */
- public void clearFilters()
- {
- // filters.clear() would need synchronization
- filters = new ArrayList<LogEntryFilter>();
- }
-
- /**
- * Get the list of cached entries.
- *
- * Note, that the LogService delivers LogEntries asynchronously.
- * Client should not rely on a certain LogEntry already beein delivered
- * when calling this method.
- */
- public List<LogEntry> getLog()
- {
- return getLog(false);
- }
-
- /**
- * Get the list of cached entries and optionally clears the list.
- *
- * Note, that the LogService delivers LogEntries asynchronously.
- * Client should not rely on a certain LogEntry already beein delivered
- * when calling this method.
- */
- public List<LogEntry> getLog(boolean clear)
- {
- synchronized (entries)
- {
- ArrayList<LogEntry> retList = new ArrayList<LogEntry>(entries);
- if (clear == true)
- entries.clear();
-
- return retList;
- }
- }
-
- /**
- * Listener method called for each LogEntry object created.
- */
- public void logged(LogEntry entry)
- {
- // Replace entry with a unified wrapper
- entry = new LogEntryImpl(entry);
-
- List<LogEntryFilter> snapshot = new ArrayList<LogEntryFilter>(filters);
- synchronized (entries)
- {
- if (snapshot.size() == 0)
- {
- entries.add(entry);
- return;
- }
-
- // Add the entry if if matches at least one filter
- for (LogEntryFilter filter : snapshot)
- {
- if (match(filter, entry))
- {
- entries.add(entry);
- break;
- }
- }
- }
- }
-
- private boolean match(LogEntryFilter filter, LogEntry entry)
- {
- boolean match = entry.getLevel() <= filter.getLevel();
-
- if (match && filter.getBundleRegex() != null)
- {
- String entryBnd = entry.getBundle().getSymbolicName();
- String filterRegex = filter.getBundleRegex();
- match = entryBnd.matches(filterRegex);
- }
-
- if (match && filter.getMessageRegex() != null)
- {
- String entryMsg = entry.getMessage();
- String filterRegex = filter.getMessageRegex();
- match = entryMsg.matches(filterRegex);
- }
-
- return match;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryFilter.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryFilter.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryFilter.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.logging;
-
-//$Id$
-
-
-/**
- * A LogEntry filter that can be used with the LogEntryCache
- *
- * @author thomas.diesler(a)jboss.com
- * @since 09-Apr-2009
- */
-public class LogEntryFilter
-{
- private int level;
- private String bndRegex;
- private String msgRegex;
-
- /**
- * Create a LogEntryFilter with the associated criteria.
- *
- * @param bndRegex A regex that matches a Bundle's SymbolicName
- * @param level The maximum log level accepted by this filter
- * @param msgRegex A regex that matches the log message
- */
- public LogEntryFilter(String bndRegex, int level, String msgRegex)
- {
- this.bndRegex = bndRegex;
- this.msgRegex = msgRegex;
- this.level = level < 1 ? Integer.MAX_VALUE : level;
- }
-
- /**
- * Create a LogEntryFilter with the associated criteria.
- *
- * @param bndRegex A regex that matches a Bundle's SymbolicName
- * @param level The maximum log level accepted by this filter
- */
- public LogEntryFilter(String bndRegex, int level)
- {
- this(bndRegex, level, null);
- }
-
- /**
- * Create a LogEntryFilter with the associated criteria.
- *
- * @param bndRegex A regex that matches a Bundle's SymbolicName
- */
- public LogEntryFilter(String bndRegex)
- {
- this(bndRegex, Integer.MAX_VALUE, null);
- }
-
- /**
- * Get the Bundle Symbolic-Name regex.
- */
- public String getBundleRegex()
- {
- return bndRegex;
- }
-
- /**
- * Get the log message regex.
- */
- public String getMessageRegex()
- {
- return msgRegex;
- }
-
- /**
- * Get the log entry maximum log level.
- */
- public int getLevel()
- {
- return level;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.logging;
-
-//$Id$
-
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogReaderService;
-
-/**
- * An extension of the {@link LogReaderService} that can be setup
- * to receive remote {@link LogEntry} objects.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 12-Apr-2009
- */
-public interface RemoteLogReaderService extends LogReaderService
-{
- /** Property to set to 'true' on the sending side: 'org.jboss.osgi.service.remote.log.sender' */
- String REMOTE_LOG_SENDER = "org.jboss.osgi.service.remote.log.sender";
-
- /** Property to set to 'true' on the receiving side: 'org.jboss.osgi.service.remote.log.reader' */
- String REMOTE_LOG_READER = "org.jboss.osgi.service.remote.log.reader";
-
- /** Property to set the receiving host: 'org.jboss.osgi.service.remote.log.host' */
- String REMOTE_LOG_HOST = "org.jboss.osgi.service.remote.log.host";
-
- /** Property to set the receiving port: 'org.jboss.osgi.service.remote.log.port' */
- String REMOTE_LOG_PORT = "org.jboss.osgi.service.remote.log.port";
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -26,7 +26,6 @@
import javax.naming.NamingException;
import org.jboss.osgi.spi.capability.Capability;
-import org.jboss.osgi.spi.logging.LogEntryCache;
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.service.packageadmin.PackageAdmin;
@@ -96,16 +95,6 @@
OSGiServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException;
/**
- * Start log entry tracking for this {@link OSGiRuntime}
- */
- void startLogEntryTracking(LogEntryCache logEntryCache);
-
- /**
- * Stop log entry tracking for this {@link OSGiRuntime}
- */
- void stopLogEntryTracking();
-
- /**
* Get the initial naming context for this {@link OSGiRuntime}
*/
InitialContext getInitialContext() throws NamingException;
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -35,8 +35,6 @@
import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.spi.framework.OSGiFramework;
-import org.jboss.osgi.spi.logging.LogEntryCache;
import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
@@ -48,9 +46,8 @@
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogReaderService;
+import org.osgi.framework.launch.Framework;
import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.util.tracker.ServiceTracker;
/**
* An embedded implementation of the {@link OSGiRuntime}
@@ -125,37 +122,36 @@
super.addCapability(capability);
}
- public void startLogEntryTracking(final LogEntryCache logEntryCache)
- {
- super.startLogEntryTracking(logEntryCache);
-
- // Track the LogReaderService to add the LogEntryCache as LogListener
- ServiceTracker tracker = new ServiceTracker(getBundleContext(), LogReaderService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference sref)
- {
- LogReaderService logReaderService = (LogReaderService)super.addingService(sref);
- logReaderService.addLogListener(logEntryCache);
- setLogReaderService(logReaderService);
- return logReaderService;
- }
- };
- tracker.open();
- }
-
@Override
public void shutdown()
{
super.shutdown();
OSGiBootstrapProvider bootProvider = getTestHelper().getBootstrapProvider();
- bootProvider.getFramework().stop();
+ try
+ {
+ bootProvider.getFramework().stop();
+ }
+ catch (BundleException ex)
+ {
+ log.error("Cannot stop the framework", ex);
+ }
}
public BundleContext getBundleContext()
{
OSGiBootstrapProvider bootProvider = getTestHelper().getBootstrapProvider();
- OSGiFramework framework = bootProvider.getFramework();
+ Framework framework = bootProvider.getFramework();
+ if (framework.getState() != Bundle.ACTIVE)
+ {
+ try
+ {
+ framework.start();
+ }
+ catch (BundleException ex)
+ {
+ throw new IllegalStateException("Cannot start framework", ex);
+ }
+ }
return framework.getBundleContext();
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -41,7 +41,6 @@
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.capability.Capability;
-import org.jboss.osgi.spi.logging.LogEntryCache;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiServiceReference;
@@ -49,7 +48,6 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
-import org.osgi.service.log.LogReaderService;
/**
* An abstract implementation of the {@link OSGiRuntime}
@@ -65,10 +63,7 @@
private OSGiTestHelper helper;
private Map<String, OSGiBundle> bundles = new LinkedHashMap<String, OSGiBundle>();
private List<Capability> capabilities = new ArrayList<Capability>();
- private LogReaderService logReaderService;
- private LogEntryCache logEntryCache;
-
public OSGiRuntimeImpl(OSGiTestHelper helper)
{
this.helper = helper;
@@ -79,16 +74,6 @@
return helper;
}
- protected void setLogReaderService(LogReaderService logReaderService)
- {
- this.logReaderService = logReaderService;
- }
-
- protected LogReaderService getLogReaderService()
- {
- return logReaderService;
- }
-
public void addCapability(Capability capability) throws BundleException
{
// Add dependent capabilies
@@ -143,27 +128,10 @@
removeCapability(dependency);
}
- public void startLogEntryTracking(LogEntryCache logEntryCache)
- {
- this.logEntryCache = logEntryCache;
- }
-
- public void stopLogEntryTracking()
- {
- if (logReaderService != null && logEntryCache != null)
- {
- logReaderService.removeLogListener(logEntryCache);
- logReaderService = null;
- logEntryCache = null;
- }
- }
-
public void shutdown()
{
log.debug("Start Shutdown");
- stopLogEntryTracking();
-
// Uninstall the registered bundles
ArrayList<String> locations = new ArrayList<String>(bundles.keySet());
Collections.reverse(locations);
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -35,8 +35,6 @@
import javax.naming.NamingException;
import org.jboss.osgi.spi.capability.Capability;
-import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.logging.RemoteLogReaderService;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
@@ -48,12 +46,8 @@
import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.osgi.spi.util.BundleDeploymentFactory;
-import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogReaderService;
-import org.osgi.util.tracker.ServiceTracker;
/**
* A remote implementation of the {@link OSGiRuntime}
@@ -66,10 +60,6 @@
private MBeanServerConnection mbeanServer;
private ManagedFrameworkMBean managedFramework;
- // Needed for remote logging
- private EmbeddedRuntime embeddedRuntime;
- private RemoteLogCapability remoteLogCapability;
-
public RemoteRuntime(OSGiTestHelper helper)
{
super(helper);
@@ -180,57 +170,6 @@
return srefs;
}
- public void startLogEntryTracking(final LogEntryCache logEntryCache)
- {
- super.startLogEntryTracking(logEntryCache);
-
- try
- {
- remoteLogCapability = new RemoteLogCapability();
- addCapability(remoteLogCapability);
-
- embeddedRuntime = (EmbeddedRuntime)getTestHelper().getEmbeddedRuntime();
- embeddedRuntime.addCapability(remoteLogCapability);
-
- // Track the RemoteLogReaderService to add the LogEntryCache as LogListener
- BundleContext context = embeddedRuntime.getBundleContext();
- ServiceTracker tracker = new ServiceTracker(context, RemoteLogReaderService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference sref)
- {
- LogReaderService logReaderService = (LogReaderService)super.addingService(sref);
- logReaderService.addLogListener(logEntryCache);
- setLogReaderService(logReaderService);
- return logReaderService;
- }
- };
- tracker.open();
- }
- catch (BundleException ex)
- {
- throw new IllegalStateException("Cannot start log entry tracking", ex);
- }
- }
-
- @Override
- public void stopLogEntryTracking()
- {
- if (remoteLogCapability != null)
- {
- removeCapability(remoteLogCapability);
- remoteLogCapability = null;
- }
-
- if (embeddedRuntime != null)
- {
- embeddedRuntime.shutdown();
- embeddedRuntime = null;
- }
-
- super.stopLogEntryTracking();
- }
-
public MBeanServerConnection getMBeanServer()
{
if (mbeanServer == null)
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/OSGiConstantsHelper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/OSGiConstantsHelper.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/OSGiConstantsHelper.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -25,7 +25,6 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleEvent;
-import org.osgi.service.log.LogService;
/**
* String representation for common OSGi Constants
@@ -86,23 +85,27 @@
}
/**
- * Return the string representation of a {@link LogService} level
+ * Return the string representation of a LogService level
*/
public static String logLevel(int level)
{
String logLevel = "[" + level + "]";
switch (level)
{
- case LogService.LOG_DEBUG:
+ // LogService.LOG_DEBUG:
+ case 0x4:
logLevel = "DEBUG";
break;
- case LogService.LOG_INFO:
+ // LogService.LOG_INFO:
+ case 0x3:
logLevel = "INFO";
break;
- case LogService.LOG_WARNING:
+ // LogService.LOG_WARNING:
+ case 0x2:
logLevel = "WARN";
break;
- case LogService.LOG_ERROR:
+ // LogService.LOG_ERROR
+ case 0x1:
logLevel = "ERROR";
break;
}
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -37,14 +37,14 @@
<!-- Properties -->
<properties>
<version.apache.felix.configadmin>1.0.10</version.apache.felix.configadmin>
- <version.apache.felix.core>1.2.0</version.apache.felix.core>
+ <version.apache.felix.core>1.3.0-SNAPSHOT</version.apache.felix.core>
<version.apache.felix.http.jetty>1.0.1</version.apache.felix.http.jetty>
<version.apache.felix.log>1.0.0</version.apache.felix.log>
<version.apache.felix.metatype>1.0.2</version.apache.felix.metatype>
<version.izpack>4.3.1</version.izpack>
<version.jboss.osgi.apache.xerces>2.9.1.SP1</version.jboss.osgi.apache.xerces>
<version.jboss.osgi.blueprint>1.0.0.Beta1</version.jboss.osgi.blueprint>
- <version.jboss.osgi.common>1.0.0</version.jboss.osgi.common>
+ <version.jboss.osgi.common>1.0.1-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.11.SP1</version.jboss.osgi.common.core>
<version.jboss.osgi.hotdeploy>1.0.0</version.jboss.osgi.hotdeploy>
<version.jboss.osgi.husky>1.0.0</version.jboss.osgi.husky>
@@ -52,16 +52,15 @@
<version.jboss.osgi.jmx>1.0.0</version.jboss.osgi.jmx>
<version.jboss.osgi.jndi>1.0.0</version.jboss.osgi.jndi>
<version.jboss.osgi.microcontainer>1.0.0</version.jboss.osgi.microcontainer>
- <version.jboss.osgi.remotelog>1.0.0</version.jboss.osgi.remotelog>
<version.jboss.osgi.runtime.deployers>1.0.0</version.jboss.osgi.runtime.deployers>
- <version.jboss.osgi.runtime.equinox>1.0.0</version.jboss.osgi.runtime.equinox>
- <version.jboss.osgi.runtime.felix>1.0.0</version.jboss.osgi.runtime.felix>
+ <version.jboss.osgi.runtime.equinox>3.5-SNAPSHOT</version.jboss.osgi.runtime.equinox>
+ <version.jboss.osgi.runtime.felix>1.9.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.runtime.jbossas>1.0.0</version.jboss.osgi.runtime.jbossas>
<version.jboss.osgi.runtime.knopflerfish>1.0.0</version.jboss.osgi.runtime.knopflerfish>
- <version.jboss.osgi.spi>1.0.0</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.1-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.webconsole>1.0.0</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.1</version.jboss.osgi.xml.binding>
- <version.osgi>r4v41</version.osgi>
+ <version.osgi>r4v42-20090728</version.osgi>
</properties>
<!-- Repositories -->
Modified: projects/jboss-osgi/trunk/reactor/blueprint/impl/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/impl/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/reactor/blueprint/impl/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -45,7 +45,6 @@
<artifactId>org.osgi.compendium</artifactId>
<scope>provided</scope>
</dependency>
-
</dependencies>
<!-- Build -->
@@ -103,7 +102,7 @@
<artifacts>
<artifact>
<!-- For some reason the distribution javadoc module needs this -->
- <file>target/jboss-osgi-blueprint-${version}-sources.jar</file>
+ <file>target/${artifactId}-${version}-sources.jar</file>
<classifier>sources</classifier>
<type>jar</type>
</artifact>
@@ -125,16 +124,6 @@
<excludePackageNames>org.jboss.osgi.*</excludePackageNames>
</configuration>
</plugin>
- <!--
- <plugin>
- <groupId>xsddoc</groupId>
- <artifactId>maven-xsddoc-plugin</artifactId>
- <configuration>
- <maven.xsddoc.src>src/main/resources/schema</maven.xsddoc.src>
- <maven.xsddoc.include>blueprint.xsd</maven.xsddoc.include>
- </configuration>
- </plugin>
- -->
</plugins>
</reporting>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -35,8 +35,8 @@
<version.jboss.osgi.common.core>2.2.11.SP1</version.jboss.osgi.common.core>
<version.jboss.osgi.husky>1.0.0</version.jboss.osgi.husky>
<version.jboss.osgi.microcontainer>1.0.0</version.jboss.osgi.microcontainer>
- <version.jboss.osgi.runtime.felix>1.0.0</version.jboss.osgi.runtime.felix>
- <version.osgi>r4v41</version.osgi>
+ <version.jboss.osgi.runtime.felix>1.9.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
+ <version.osgi>r4v42-20090728</version.osgi>
</properties>
<!-- Modules -->
Property changes on: projects/jboss-osgi/trunk/reactor/bundles
___________________________________________________________________
Name: svn:externals
+ common https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -14,30 +14,47 @@
<!--
The reactor is used to pull in external subprojects and build them as part of this maven reactor build. It is a one-stop entry point to build, test and deploy
- dependent SNAPSHOTs. To pull in a particular subproject, set one or more of these svn:external definitions spi
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/spi/trunk bundles/apache-xerces
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/... bundles/common
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/... bundles/hotdeploy
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/... bundles/husky
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/... bundles/jaxb
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/... bundles/jmx
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/... bundles/jndi
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/... bundles/jboss-common-core
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/... bundles/jboss-xml-binding
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/... bundles/microcontainer
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/... bundles/remotelog
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/... bundles/webconsole
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/... runtime/deployers
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/... runtime/equinox
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/... runtime/felix
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/... runtime/jbossas
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/... runtime/knopflerfish
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/... and enable the associated maven module <module>spi</module>
- <module>runtime/equinox</module> <module>runtime/felix</module> <module>runtime/knopflerfish</module> <module>runtime/deployers</module>
- <module>bundles/common</module> <module>bundles/jboss-common-core</module> <module>bundles/apache-xerces</module> <module>bundles/jaxb</module>
- <module>bundles/jboss-xml-binding</module> <module>bundles/jndi</module> <module>bundles/jmx</module> <module>bundles/remotelog</module>
- <module>bundles/webconsole</module> <module>bundles/hotdeploy</module> <module>bundles/microcontainer</module> <module>bundles/husky</module>
- <module>runtime/jbossas</module> A release MUST NOT contain any svn:external definitions.
+ dependent SNAPSHOTs. To pull in a particular subproject, set one or more of these svn:external definitions
+
+ spi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/spi/trunk
+ bundles/apache-xerces https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
+ bundles/common https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
+ bundles/hotdeploy https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
+ bundles/husky https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
+ bundles/jaxb https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
+ bundles/jmx https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
+ bundles/jndi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
+ bundles/jboss-common-core https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
+ bundles/jboss-xml-binding https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
+ bundles/microcontainer https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
+ bundles/remotelog https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
+ bundles/webconsole https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
+ runtime/deployers https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
+ runtime/equinox https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
+ runtime/felix https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
+ runtime/jbossas https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
+ runtime/knopflerfish https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/... and enable the associated maven module
+
+ <module>spi</module>
+ <module>runtime/equinox</module>
+ <module>runtime/felix</module>
+ <module>runtime/knopflerfish</module>
+ <module>runtime/deployers</module>
+ <module>bundles/common</module>
+ <module>bundles/jboss-common-core</module>
+ <module>bundles/apache-xerces</module>
+ <module>bundles/jaxb</module>
+ <module>bundles/jboss-xml-binding</module>
+ <module>bundles/jndi</module>
+ <module>bundles/jmx</module>
+ <module>bundles/remotelog</module>
+ <module>bundles/webconsole</module>
+ <module>bundles/hotdeploy</module>
+ <module>bundles/microcontainer</module>
+ <module>bundles/husky</module>
+ <module>runtime/jbossas</module>
+
+ A release MUST NOT contain any svn:external definitions.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -59,6 +76,7 @@
<module>spi</module>
<module>runtime/equinox</module>
<module>runtime/felix</module>
+ <module>bundles/common</module>
<module>blueprint</module>
</modules>
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -54,9 +54,6 @@
<!-- jndi -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-jndi.jar" files="${tests.resources.dir}/jndi/example-jndi.bnd" />
- <!-- log -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-log.jar" files="${tests.resources.dir}/log/example-log.bnd" />
-
<!-- mcservice -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-mcservice-bundleA.jar" files="${tests.resources.dir}/mcservice/example-mcservice-bundleA.bnd" />
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-mcservice-bundleB.jar" files="${tests.resources.dir}/mcservice/example-mcservice-bundleB.bnd" />
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -24,13 +24,12 @@
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
- <include>*:jboss-osgi-remotelog:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
<include>*:org.apache.felix.configadmin:jar</include>
<include>*:org.apache.felix.http.jetty:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.apache.felix.metatype:jar</include>
- <include>org.osgi:org.osgi.compendium:jar</include>
+ <include>*:org.osgi.compendium:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
<scope>provided</scope>
Deleted: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,90 +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.example.log;
-
-//$Id: LogServiceTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler(a)jboss.com $
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.List;
-
-import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.logging.LogEntryFilter;
-import org.jboss.osgi.spi.testing.OSGiBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.OSGiTestHelper;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogService;
-
-/**
- * This example demonstrates the usage of the {@link LogService}
- *
- * @author thomas.diesler(a)jboss.com
- * @since 09-Apr-2009
- */
-public class LogServiceTestCase extends OSGiTest
-{
- private static LogEntryCache logEntryCache;
- private static OSGiRuntime runtime;
-
- @BeforeClass
- public static void setUpClass() throws Exception
- {
- runtime = new OSGiTestHelper().getDefaultRuntime();
- logEntryCache = new LogEntryCache(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
- runtime.startLogEntryTracking(logEntryCache);
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception
- {
- logEntryCache.clear();
- runtime.shutdown();
- }
-
- @Test
- public void testLogEntryFilter() throws Exception
- {
- // Install and start the test bundle
- OSGiBundle bundleA = runtime.installBundle("example-log.jar");
- bundleA.start();
-
- // Verify that the bundle is active
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundleA.getState());
-
- // Wait a little for the asynchronous log entry to arrive
- Thread.sleep(200);
-
- // Uninstall the test bundle
- bundleA.uninstall();
-
- // Verify the received log entries
- List<LogEntry> entries = logEntryCache.getLog();
- assertEquals("Number of entries", 1, entries.size());
- assertEquals("[ServiceA] new Service", entries.get(0).getMessage());
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-07-29 12:14:37 UTC (rev 91762)
@@ -4,15 +4,15 @@
# $Id$
#
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
-
# Properties to configure the Framework
org.osgi.framework.storage=${basedir}/target/osgi-store
org.osgi.framework.storage.clean=onFirstInit
+# An instance of Logger that the framework uses as its default logger
+felix.log.logger.instance=org.jboss.osgi.felix.FelixLogger
+
# Framework bootdelegation
-org.osgi.framework.bootdelegation=org.osgi.service.log
+# org.osgi.framework.bootdelegation=org.osgi.service.log
# Extra System Packages
org.osgi.framework.system.packages.extra=\
@@ -31,7 +31,7 @@
org.jboss.virtual.plugins.context.jar, \
org.jboss.virtual.plugins.vfs.helpers, \
org.jboss.virtual.protocol, \
- org.osgi.framework;version=1.4
+ org.osgi.framework;version=1.5
# Bundles that need to be installed with the Framework automatically
org.jboss.osgi.spi.framework.autoInstall=\
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -23,13 +23,12 @@
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
- <include>*:jboss-osgi-remotelog:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
<include>*:org.apache.felix.configadmin:jar</include>
<include>*:org.apache.felix.http.jetty:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.apache.felix.metatype:jar</include>
- <include>org.osgi:org.osgi.compendium:jar</include>
+ <include>*:org.osgi.compendium:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -29,10 +29,9 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.junit.Test;
-import org.osgi.framework.Bundle;
+import org.osgi.framework.launch.Framework;
/**
* Test the embedded bootstrap of the framework
@@ -46,13 +45,11 @@
public void testFrameworkBootstrap() throws Exception
{
OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
- OSGiFramework framework = bootProvider.getFramework();
+ Framework framework = bootProvider.getFramework();
assertNotNull("Framework not null", framework);
- Bundle bundle = framework.getBundle();
-
- assertEquals("BundleId == 0", 0, bundle.getBundleId());
- assertNotNull("SymbolicName not null", bundle.getSymbolicName());
+ assertEquals("BundleId == 0", 0, framework.getBundleId());
+ assertNotNull("SymbolicName not null", framework.getSymbolicName());
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -96,25 +96,11 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-remotelog</artifactId>
- <version>${version.jboss.osgi.remotelog}</version>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version.jboss.osgi.common}</version>
<scope>provided</scope>
</dependency>
- <!-- OSGi Dependencies -->
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>${version.osgi}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <version>${version.osgi}</version>
- <scope>provided</scope>
- </dependency>
-
<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
@@ -160,8 +146,9 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>org.osgi.compendium</artifactId>
<version>${version.apache.felix.core}</version>
+ <scope>provided</scope>
</dependency>
</dependencies>
</profile>
@@ -186,8 +173,9 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>org.osgi.compendium</artifactId>
<version>${version.apache.felix.core}</version>
+ <scope>provided</scope>
</dependency>
</dependencies>
</profile>
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-bundles.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-bundles.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -23,13 +23,12 @@
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
- <include>*:jboss-osgi-remotelog:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
<include>*:org.apache.felix.configadmin:jar</include>
<include>*:org.apache.felix.http.jetty:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.apache.felix.metatype:jar</include>
- <include>org.osgi:org.osgi.compendium:jar</include>
+ <include>*:org.osgi.compendium:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
<scope>provided</scope>
14 years, 9 months
JBoss-OSGI SVN: r91724 - in projects/jboss-osgi: projects/runtime/equinox/trunk/src/test/resources and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-28 12:40:30 -0400 (Tue, 28 Jul 2009)
New Revision: 91724
Removed:
projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/framework/
projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/jboss-osgi-beans.xml
projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/jndi.properties
projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/tst.policy
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jboss-osgi-beans.xml
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jndi.properties
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/tst.policy
Modified:
projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml
projects/jboss-osgi/projects/spi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/pom.xml
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
More on framework launch API
Deleted: projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/jboss-osgi-beans.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/jboss-osgi-beans.xml 2009-07-28 16:13:48 UTC (rev 91723)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/jboss-osgi-beans.xml 2009-07-28 16:40:30 UTC (rev 91724)
@@ -1,15 +0,0 @@
-<!--
- $Id$
--->
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
-
- <!-- The OSGiFramework -->
- <bean name="jboss.osgi:service=Framework" class="org.jboss.osgi.equinox.framework.EquinoxIntegration">
- <property name="properties">
- <map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
- </map>
- </property>
- </bean>
-
-</deployment>
Deleted: projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/jndi.properties
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/jndi.properties 2009-07-28 16:13:48 UTC (rev 91723)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/jndi.properties 2009-07-28 16:40:30 UTC (rev 91724)
@@ -1,3 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
-java.naming.provider.url=jnp://@jboss.bind.address@:1099
Deleted: projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-07-28 16:13:48 UTC (rev 91723)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-07-28 16:40:30 UTC (rev 91724)
@@ -1 +0,0 @@
-org.jboss.osgi.spi.framework.MicrocontainerBootstrapProvider
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/tst.policy
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/tst.policy 2009-07-28 16:13:48 UTC (rev 91723)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/resources/tst.policy 2009-07-28 16:40:30 UTC (rev 91724)
@@ -1,4 +0,0 @@
-grant {
- permission java.security.AllPermission;
-};
-
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml 2009-07-28 16:13:48 UTC (rev 91723)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml 2009-07-28 16:40:30 UTC (rev 91724)
@@ -20,7 +20,7 @@
<artifactId>jboss-osgi-runtime-felix</artifactId>
<packaging>jar</packaging>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -31,7 +31,6 @@
<properties>
<version.felix.framework>1.9.0-SNAPSHOT</version.felix.framework>
- <version.jboss.microcontainer>2.0.5.GA</version.jboss.microcontainer>
<version.jboss.osgi.spi>1.0.1-SNAPSHOT</version.jboss.osgi.spi>
</properties>
@@ -47,26 +46,10 @@
<artifactId>org.apache.felix.framework</artifactId>
<version>${version.felix.framework}</version>
</dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- <version>${version.jboss.microcontainer}</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<!-- Build -->
<build>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- </testResource>
- </testResources>
- <plugins>
- </plugins>
</build>
<!-- Profiles -->
Deleted: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jboss-osgi-beans.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jboss-osgi-beans.xml 2009-07-28 16:13:48 UTC (rev 91723)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jboss-osgi-beans.xml 2009-07-28 16:40:30 UTC (rev 91724)
@@ -1,15 +0,0 @@
-<!--
- $Id$
--->
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
-
- <!-- The OSGiFramework -->
- <bean name="jboss.osgi:service=Framework" class="org.jboss.osgi.felix.framework.FelixIntegration">
- <property name="properties">
- <map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
- </map>
- </property>
- </bean>
-
-</deployment>
Deleted: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jndi.properties
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jndi.properties 2009-07-28 16:13:48 UTC (rev 91723)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jndi.properties 2009-07-28 16:40:30 UTC (rev 91724)
@@ -1,3 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
-java.naming.provider.url=jnp://@jboss.bind.address@:1099
Deleted: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-07-28 16:13:48 UTC (rev 91723)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-07-28 16:40:30 UTC (rev 91724)
@@ -1 +0,0 @@
-org.jboss.osgi.spi.framework.MicrocontainerBootstrapProvider
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/tst.policy
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/tst.policy 2009-07-28 16:13:48 UTC (rev 91723)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/tst.policy 2009-07-28 16:40:30 UTC (rev 91724)
@@ -1,4 +0,0 @@
-grant {
- permission java.security.AllPermission;
-};
-
Modified: projects/jboss-osgi/projects/spi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-07-28 16:13:48 UTC (rev 91723)
+++ projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-07-28 16:40:30 UTC (rev 91724)
@@ -34,7 +34,7 @@
<version.args4j>2.0.12</version.args4j>
<version.jboss.logging>2.0.5.GA</version.jboss.logging>
<version.jboss.vfs>2.1.0.GA</version.jboss.vfs>
- <version.osgi>r4v42</version.osgi>
+ <version.osgi>r4v42-20090728</version.osgi>
</properties>
<!-- Dependencies -->
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-28 16:13:48 UTC (rev 91723)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-28 16:40:30 UTC (rev 91724)
@@ -57,6 +57,7 @@
<modules>
<module>spi</module>
+ <module>runtime/equinox</module>
<module>runtime/felix</module>
<module>blueprint</module>
</modules>
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-07-28 16:13:48 UTC (rev 91723)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-07-28 16:40:30 UTC (rev 91724)
@@ -100,8 +100,16 @@
<version>${version.jboss.osgi.remotelog}</version>
<scope>provided</scope>
</dependency>
+
+ <!-- OSGi Dependencies -->
<dependency>
<groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>${version.osgi}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>${version.osgi}</version>
<scope>provided</scope>
14 years, 9 months
JBoss-OSGI SVN: r91719 - in projects/jboss-osgi/projects/runtime/equinox/trunk: src/main/java/org/jboss/osgi/equinox/framework and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-28 11:49:59 -0400 (Tue, 28 Jul 2009)
New Revision: 91719
Added:
projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java
Removed:
projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java
Modified:
projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml
projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/framework/EquinoxIntegration.java
Log:
Update to equinox 3.5
Add FrameworkLaunch test
Modified: projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml 2009-07-28 15:48:33 UTC (rev 91718)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml 2009-07-28 15:49:59 UTC (rev 91719)
@@ -20,7 +20,7 @@
<artifactId>jboss-osgi-runtime-equinox</artifactId>
<packaging>jar</packaging>
- <version>1.0.0</version>
+ <version>3.5-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -31,9 +31,8 @@
<!-- Properties -->
<properties>
- <version.eclipse.equinox>3.4.2</version.eclipse.equinox>
- <version.jboss.microcontainer>2.0.5.GA</version.jboss.microcontainer>
- <version.jboss.osgi.spi>1.0.0</version.jboss.osgi.spi>
+ <version.eclipse.equinox>3.5</version.eclipse.equinox>
+ <version.jboss.osgi.spi>1.0.1-SNAPSHOT</version.jboss.osgi.spi>
</properties>
<!-- Dependencies -->
@@ -48,19 +47,13 @@
<artifactId>org.eclipse.osgi</artifactId>
<version>${version.eclipse.equinox}</version>
</dependency>
+ <!--
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
<version>${version.eclipse.equinox}</version>
</dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- <version>${version.jboss.microcontainer}</version>
- <scope>test</scope>
- </dependency>
+ -->
</dependencies>
<!-- Build -->
Modified: projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/framework/EquinoxIntegration.java
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/framework/EquinoxIntegration.java 2009-07-28 15:48:33 UTC (rev 91718)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/framework/EquinoxIntegration.java 2009-07-28 15:49:59 UTC (rev 91719)
@@ -201,7 +201,7 @@
{
if (framework != null)
{
- framework.shutdown();
+ framework.shutdown(0);
}
}
Added: projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java 2009-07-28 15:49:59 UTC (rev 91719)
@@ -0,0 +1,48 @@
+/*
+ * 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.equinox;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+
+import org.jboss.osgi.spi.framework.FrameworkLoader;
+import org.junit.Test;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * Test OSGi System bundle access
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-Jul-2009
+ */
+public class FrameworkLaunchTestCase
+{
+ @Test
+ public void testFrameworkLaunch()
+ {
+ Framework framework = FrameworkLoader.newFramework(null);
+
+ assertEquals("BundleId == 0", 0, framework.getBundleId());
+ assertEquals("SymbolicName", "org.eclipse.osgi", framework.getSymbolicName());
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java 2009-07-28 15:48:33 UTC (rev 91718)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java 2009-07-28 15:49:59 UTC (rev 91719)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.equinox;
-
-//$Id$
-
-import static org.junit.Assert.*;
-
-import org.jboss.osgi.equinox.framework.EquinoxIntegration;
-import org.jboss.osgi.spi.framework.OSGiBootstrap;
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.spi.framework.OSGiFramework;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-
-/**
- * Test OSGi System bundle access
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public class SystemBundleTestCase extends OSGiTest
-{
- @Test
- public void testEquinoxIntegration()
- {
- EquinoxIntegration framework = new EquinoxIntegration();
- framework.create();
- framework.start();
-
- Bundle bundle = framework.getBundle();
-
- assertEquals("BundleId == 0", 0, bundle.getBundleId());
- assertEquals("SymbolicName", "org.eclipse.osgi", bundle.getSymbolicName());
- }
-
- @Test
- public void testSystemBundle()
- {
- OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
- OSGiFramework framework = configProvider.getFramework();
- Bundle bundle = framework.getBundle();
-
- assertEquals("BundleId == 0", 0, bundle.getBundleId());
- assertEquals("SymbolicName", "org.eclipse.osgi", bundle.getSymbolicName());
- }
-}
\ No newline at end of file
14 years, 9 months