JBoss-OSGI SVN: r89527 - in projects/jboss-osgi/trunk: distribution and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-29 07:53:48 -0400 (Fri, 29 May 2009)
New Revision: 89527
Modified:
projects/jboss-osgi/trunk/distribution/pom.xml
projects/jboss-osgi/trunk/distribution/runtime/bin/run.sh
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/distribution/runtime/conf/log4j.xml
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/spi/pom.xml
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
Log:
Add args4j command line option handling
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2009-05-29 11:14:38 UTC (rev 89526)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2009-05-29 11:53:48 UTC (rev 89527)
@@ -29,6 +29,10 @@
<!-- Dependencies -->
<dependencies>
<dependency>
+ <groupId>args4j</groupId>
+ <artifactId>args4j</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-deployers</artifactId>
</dependency>
Modified: projects/jboss-osgi/trunk/distribution/runtime/bin/run.sh
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/bin/run.sh 2009-05-29 11:14:38 UTC (rev 89526)
+++ projects/jboss-osgi/trunk/distribution/runtime/bin/run.sh 2009-05-29 11:53:48 UTC (rev 89527)
@@ -142,7 +142,7 @@
# Execute the JVM in the foreground
"$JAVA" $JAVA_OPTS \
-classpath "$OSGI_CLASSPATH" \
- org.jboss.osgi.spi.framework.OSGiBootstrap "$@" &
+ -Dmainclass=org.jboss.osgi.spi.framework.OSGiBootstrap org.kohsuke.args4j.Starter "$@" &
OSGI_PID=$!
echo $OSGI_PID > $OSGI_HOME/bin/pid.txt
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-05-29 11:14:38 UTC (rev 89526)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-05-29 11:53:48 UTC (rev 89527)
@@ -8,17 +8,17 @@
org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
# Properties to configure the Framework
-org.osgi.framework.storage=${osgi.home}/data/osgi-store
+org.osgi.framework.storage=${osgi.home}/server/${jboss.server.name}/data/osgi-store
org.osgi.framework.storage.clean=onFirstInit
# Hot Deployement
-org.jboss.osgi.hotdeploy.scandir=${osgi.home}/bundles
+org.jboss.osgi.hotdeploy.scandir=${osgi.home}/server/${jboss.server.name}/bundles
# HTTP Service Port
org.osgi.service.http.port=8090
# Config Admin Service
-felix.cm.dir=${osgi.home}/data/osgi-configadmin
+felix.cm.dir=${osgi.home}/server/${jboss.server.name}/data/osgi-configadmin
# JMX bundle properties
org.jboss.osgi.jmx.host=${jboss.bind.address}
@@ -67,16 +67,10 @@
# Bundles that need to be installed with the Framework automatically
org.jboss.osgi.spi.framework.autoInstall=\
- file://${osgi.home}/bundles/org.osgi.compendium.jar
+ file://${osgi.home}/server/minimal/bundles/org.osgi.compendium.jar
# Bundles that need to be started automatically
org.jboss.osgi.spi.framework.autoStart=\
- file://${osgi.home}/bundles/org.apache.felix.log.jar \
- file://${osgi.home}/bundles/jboss-osgi-common.jar \
- file://${osgi.home}/bundles/jboss-osgi-common-core.jar \
- file://${osgi.home}/bundles/jboss-osgi-jmx.jar \
- file://${osgi.home}/bundles/jboss-osgi-jaxb.jar \
- file://${osgi.home}/bundles/jboss-osgi-apache-xerces.jar \
- file://${osgi.home}/bundles/jboss-osgi-xml-binding.jar \
- file://${osgi.home}/bundles/jboss-osgi-microcontainer.jar \
- file://${osgi.home}/bundles/jboss-osgi-hotdeploy.jar
\ No newline at end of file
+ file://${osgi.home}/server/minimal/bundles/org.apache.felix.log.jar \
+ file://${osgi.home}/server/minimal/bundles/jboss-osgi-common.jar \
+ file://${osgi.home}/server/minimal/bundles/jboss-osgi-hotdeploy.jar
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/log4j.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/log4j.xml 2009-05-29 11:14:38 UTC (rev 89526)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/log4j.xml 2009-05-29 11:53:48 UTC (rev 89527)
@@ -8,7 +8,7 @@
<!-- ================================= -->
<appender name="FILE" class="org.apache.log4j.FileAppender">
- <param name="File" value="${osgi.home}/log/server.log"/>
+ <param name="File" value="${osgi.home}/server/${jboss.server.name}/log/server.log"/>
<param name="Append" value="false"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-29 11:14:38 UTC (rev 89526)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-29 11:53:48 UTC (rev 89527)
@@ -166,6 +166,7 @@
<!-- JBossOSGi Lib -->
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/lib" override="true">
+ <include name="args4j.jar" />
<include name="jboss-common-core.jar" />
<include name="jboss-logging-spi.jar" />
<include name="jboss-logging-log4j.jar" />
@@ -174,13 +175,24 @@
<include name="log4j.jar" />
</fileset>
- <!-- JBossOSGi Bundles -->
- <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/bundles" override="true">
+ <!-- JBossOSGi Minimal -->
+ <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/minimal/bundles" override="true">
+ <include name="org.apache.felix.log.jar" />
+ <include name="jboss-osgi-common.jar" />
+ <include name="jboss-osgi-hotdeploy.jar" />
+ </fileset>
+
+ <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/default/bundles" override="true">
+ <include name="jboss-osgi-webconsole.jar" />
+ <include name="org.apache.felix.configadmin.jar" />
+ <include name="org.apache.felix.http.jetty.jar" />
+ <include name="org.apache.felix.metatype.jar" />
+ </fileset>
+
+ <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/all/bundles" override="true">
<include name="jboss-osgi-apache-xerces.jar" />
<include name="jboss-osgi-jaxb.jar" />
<include name="jboss-osgi-common-core.jar" />
- <include name="jboss-osgi-common.jar" />
- <include name="jboss-osgi-hotdeploy.jar" />
<include name="jboss-osgi-jndi.jar" />
<include name="jboss-osgi-jmx.jar" />
<include name="jboss-osgi-microcontainer.jar" />
@@ -188,7 +200,6 @@
<include name="jboss-osgi-xml-binding.jar" />
<include name="org.apache.felix.configadmin.jar" />
<include name="org.apache.felix.http.jetty.jar" />
- <include name="org.apache.felix.log.jar" />
<include name="org.apache.felix.metatype.jar" />
</fileset>
@@ -200,7 +211,7 @@
<include name="jboss-osgi-runtime-felix.jar" />
<include name="org.apache.felix.framework.jar" />
</fileset>
- <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/bundles" override="true">
+ <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/minimal/bundles" override="true">
<include name="org.osgi.compendium.jar" />
</fileset>
@@ -211,7 +222,7 @@
<include name="jboss-osgi-runtime-equinox.jar" />
<include name="org.eclipse.osgi.jar" />
</fileset>
- <fileset condition="isEquinox" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/bundles" override="true">
+ <fileset condition="isEquinox" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/minimal/bundles" override="true">
<include name="org.eclipse.osgi.services.jar" />
</fileset>
-->
@@ -223,7 +234,7 @@
<include name="jboss-osgi-runtime-knopflerfish.jar" />
<include name="org.knopflerfish.framework.jar" />
</fileset>
- <fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/bundles" override="true">
+ <fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/minimal/bundles" override="true">
<include name="org.osgi.compendium.jar" />
</fileset>
-->
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-05-29 11:14:38 UTC (rev 89526)
+++ projects/jboss-osgi/trunk/pom.xml 2009-05-29 11:53:48 UTC (rev 89527)
@@ -34,7 +34,8 @@
<!-- Properties -->
<properties>
<surefire.security.args>-Djava.security.manager -Djava.security.policy=src/test/resources/tst.policy</surefire.security.args>
-
+
+ <version.args4j>2.0.12</version.args4j>
<version.aqute.bnd>0.0.323</version.aqute.bnd>
<version.equinox>3.4.2</version.equinox>
<version.felix.bundlerepository>1.0.3</version.felix.bundlerepository>
@@ -173,6 +174,11 @@
<!-- 3rd Party Dependencies -->
<dependency>
+ <groupId>args4j</groupId>
+ <artifactId>args4j</artifactId>
+ <version>${version.args4j}</version>
+ </dependency>
+ <dependency>
<groupId>biz.aQute</groupId>
<artifactId>bnd</artifactId>
<version>${version.aqute.bnd}</version>
Modified: projects/jboss-osgi/trunk/spi/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/spi/pom.xml 2009-05-29 11:14:38 UTC (rev 89526)
+++ projects/jboss-osgi/trunk/spi/pom.xml 2009-05-29 11:53:48 UTC (rev 89527)
@@ -22,6 +22,10 @@
<!-- Compile Dependencies -->
<dependency>
+ <groupId>args4j</groupId>
+ <artifactId>args4j</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-spi</artifactId>
</dependency>
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-05-29 11:14:38 UTC (rev 89526)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-05-29 11:53:48 UTC (rev 89527)
@@ -32,6 +32,9 @@
import java.util.Properties;
import org.jboss.logging.Logger;
+import org.kohsuke.args4j.CmdLineException;
+import org.kohsuke.args4j.CmdLineParser;
+import org.kohsuke.args4j.Option;
/**
* The OSGiBootstrap provides an {@link OSGiFramework} through a {@link OSGiBootstrapProvider}.
@@ -48,18 +51,88 @@
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
*/
-public final class OSGiBootstrap
+public class OSGiBootstrap
{
- // Provide logging
- final static Logger log = Logger.getLogger(OSGiBootstrap.class);
-
- // Hide the ctor
- private OSGiBootstrap()
+ private static Logger log;
+
+ private static final String JAVA_PROTOCOL_HANDLERS = "java.protocol.handler.pkgs";
+ private static final String JBOSS_BIND_ADDRESS = "jboss.bind.address";
+ private static final String JBOSS_SERVER_NAME = "jboss.server.name";
+
+ @Option(name = "-c", usage = "Sets the server config (must )")
+ public String serverName = "default";
+
+ @Option(name = "-b", usage = "Sets the bind address")
+ public String bindAdress = "localhost";
+
+ /*
+ * The main entry point
+ */
+ public static void main(String[] args)
{
+ OSGiBootstrap bean = new OSGiBootstrap();
+ CmdLineParser parser = new CmdLineParser(bean);
+ try
+ {
+ parser.parseArgument(args);
+ bean.run();
+ }
+ catch (CmdLineException ex)
+ {
+ System.err.println("Invalid OSGiBootstrap options");
+ parser.printUsage(System.err);
+ }
}
- /**
- * Get an instance of an OSGiBootstrapProvider.
+ public void run()
+ {
+ initSystemProperties();
+
+ OSGiBootstrapProvider bootProvider = getBootstrapProvider();
+ OSGiFramework framework = bootProvider.getFramework();
+
+ Runtime runtime = Runtime.getRuntime();
+ runtime.addShutdownHook(new ShutdownThread(framework));
+
+ Thread thread = new StartupThread(framework);
+ thread.start();
+ }
+
+ private void initSystemProperties()
+ {
+ Properties defaults = new Properties();
+ defaults.setProperty(JBOSS_SERVER_NAME, serverName);
+ defaults.setProperty(JBOSS_BIND_ADDRESS, bindAdress);
+ defaults.setProperty(JAVA_PROTOCOL_HANDLERS, "org.jboss.net.protocol|org.jboss.virtual.protocol");
+
+ getLogger().info("JBoss OSGi System Properties");
+
+ Enumeration<?> defaultNames = defaults.propertyNames();
+ while (defaultNames.hasMoreElements())
+ {
+ String propName = (String)defaultNames.nextElement();
+ String sysValue = System.getProperty(propName);
+ if (sysValue == null)
+ {
+ String propValue = defaults.getProperty(propName);
+ System.setProperty(propName, propValue);
+ getLogger().info(" " + propName + "=" + propValue);
+ }
+ }
+ }
+
+ private Logger getLogger()
+ {
+ if (log == null)
+ {
+ System.setProperty(JBOSS_SERVER_NAME, serverName);
+ log = Logger.getLogger(OSGiBootstrap.class);
+ }
+ return log;
+ }
+
+ /*
+ * * Get an instance of an OSGiBootstrapProvider.
*/
public static OSGiBootstrapProvider getBootstrapProvider()
{
@@ -105,50 +178,8 @@
return provider;
}
- public static void main(String[] args)
+ class StartupThread extends Thread
{
- initSystemProperties(args);
-
- OSGiBootstrapProvider bootProvider = getBootstrapProvider();
- OSGiFramework framework = bootProvider.getFramework();
-
- Runtime runtime = Runtime.getRuntime();
- runtime.addShutdownHook(new ShutdownThread(framework));
-
- Thread thread = new StartupThread(framework);
- thread.start();
- }
-
- private static void initSystemProperties(String[] args)
- {
- log.debug("initSystemProperties");
-
- Properties defaults = new Properties();
- defaults.setProperty("jboss.bind.address", "localhost");
- defaults.setProperty("java.protocol.handler.pkgs", "org.jboss.net.protocol|org.jboss.virtual.protocol");
-
- // [TODO] use args4j
- if (args != null && args.length == 2 && args[0].equals("-b"))
- {
- defaults.setProperty("jboss.bind.address", args[1]);
- }
-
- Enumeration<?> defaultNames = defaults.propertyNames();
- while(defaultNames.hasMoreElements())
- {
- String propName = (String)defaultNames.nextElement();
- String sysValue = System.getProperty(propName);
- if (sysValue == null)
- {
- String propValue = defaults.getProperty(propName);
- System.setProperty(propName, propValue);
- log.debug(" " + propName + "=" + propValue);
- }
- }
- }
-
- static class StartupThread extends Thread
- {
private OSGiFramework framework;
public StartupThread(OSGiFramework framework)
@@ -162,9 +193,9 @@
long start = System.currentTimeMillis();
framework.start();
long end = System.currentTimeMillis();
-
+
float diff = (end - start) / 1000f;
- log.info("JBossOSGi Runtime started in " + diff + "sec");
+ getLogger().info("JBossOSGi Runtime started in " + diff + "sec");
Reader br = new InputStreamReader(System.in);
try
@@ -182,7 +213,7 @@
}
}
- static class ShutdownThread extends Thread
+ class ShutdownThread extends Thread
{
private OSGiFramework framework;
@@ -193,9 +224,9 @@
public void run()
{
- log.info("Initiating shutdown ...");
+ getLogger().info("Initiating shutdown ...");
framework.stop();
- log.info("Shutdown complete");
+ getLogger().info("Shutdown complete");
}
}
}
\ No newline at end of file
16 years, 6 months
JBoss-OSGI SVN: r89525 - projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-29 04:43:36 -0400 (Fri, 29 May 2009)
New Revision: 89525
Modified:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java
Log:
Ignore Disable MCCapability
Modified: 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-05-29 08:17:55 UTC (rev 89524)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java 2009-05-29 08:43:36 UTC (rev 89525)
@@ -46,6 +46,7 @@
import org.jboss.osgi.spi.testing.capability.MicrocontainerCapability;
import org.jboss.osgi.spi.testing.capability.XMLBindingCapability;
import org.jboss.osgi.spi.testing.capability.XMLParserCapability;
+import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.BundleException;
@@ -167,6 +168,7 @@
}
@Test
+ @Ignore ("Fails with AS520 in hudson")
public void testMicrocontainerCapability() throws Exception
{
OSGiRuntime runtime = getEmbeddedRuntime();
16 years, 6 months
JBoss-OSGI SVN: r89523 - projects/jboss-osgi/trunk/distribution.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-29 03:56:59 -0400 (Fri, 29 May 2009)
New Revision: 89523
Modified:
projects/jboss-osgi/trunk/distribution/pom.xml
Log:
Add ${jboss520.home}
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2009-05-29 07:39:59 UTC (rev 89522)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2009-05-29 07:56:59 UTC (rev 89523)
@@ -256,6 +256,7 @@
<property name="jboss.home" value="${jboss.home}" />
<property name="jboss501.home" value="${jboss501.home}" />
<property name="jboss510.home" value="${jboss510.home}" />
+ <property name="jboss520.home" value="${jboss520.home}" />
<property name="jboss600.home" value="${jboss600.home}" />
<property name="product.name" value="${project.name}" />
<property name="product.short.name" value="${artifactId}" />
16 years, 6 months
JBoss-OSGI SVN: r89521 - in projects/jboss-osgi/trunk: 3rdparty/jaxb/src/main/java and 15 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-29 03:28:27 -0400 (Fri, 29 May 2009)
New Revision: 89521
Added:
projects/jboss-osgi/trunk/3rdparty/jaxb/src/main/java/org/
projects/jboss-osgi/trunk/3rdparty/jaxb/src/main/java/org/jboss/
projects/jboss-osgi/trunk/3rdparty/jaxb/src/main/java/org/jboss/osgi/
projects/jboss-osgi/trunk/3rdparty/jaxb/src/main/java/org/jboss/osgi/jaxb/
projects/jboss-osgi/trunk/3rdparty/jaxb/src/main/java/org/jboss/osgi/jaxb/internal/
projects/jboss-osgi/trunk/3rdparty/jaxb/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceActivator.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/JAXBService.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/XMLBindingService.java
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix/
Removed:
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-container-matrix/
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-framework-matrix/
Modified:
projects/jboss-osgi/trunk/3rdparty/jaxb/pom.xml
projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/pom.xml
projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java
projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerServiceActivator.java
projects/jboss-osgi/trunk/hudson/build.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.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/jboss-osgi-felix.properties
Log:
Register marker services for JAXB and JBossXB
Modified: projects/jboss-osgi/trunk/3rdparty/jaxb/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jaxb/pom.xml 2009-05-29 06:15:21 UTC (rev 89520)
+++ projects/jboss-osgi/trunk/3rdparty/jaxb/pom.xml 2009-05-29 07:28:27 UTC (rev 89521)
@@ -25,6 +25,25 @@
<artifactId>jaxb-impl</artifactId>
<version>${version.xml.bind}</version>
</dependency>
+
+ <!-- OSGi Dependencies -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Bundles -->
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
@@ -35,7 +54,9 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+ <Bundle-Activator>org.jboss.osgi.jaxb.internal.JAXBServiceActivator</Bundle-Activator>
<Private-Package>
+ org.jboss.osgi.jaxb.internal
</Private-Package>
<Import-Package>
<!-- system -->
@@ -49,6 +70,10 @@
org.xml.sax*,
<!-- import -->
+ org.jboss.osgi.common.log;version=1.0,
+ org.jboss.osgi.common.service;version=1.0,
+ org.osgi.framework,
+ org.osgi.service.log,
<!-- ignore -->
!com.sun.xml.fastinfoset.*,
Added: projects/jboss-osgi/trunk/3rdparty/jaxb/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jaxb/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/3rdparty/jaxb/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceActivator.java 2009-05-29 07:28:27 UTC (rev 89521)
@@ -0,0 +1,54 @@
+/*
+ * 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.jaxb.internal;
+
+//$Id$
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.service.JAXBService;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+
+/**
+ * A BundleActivator for JAXB related services
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 29-May-2009
+ */
+public class JAXBServiceActivator implements BundleActivator
+{
+ private LogService log;
+
+ public void start(BundleContext context)
+ {
+ log = new LogServiceTracker(context);
+
+ JAXBService service = new JAXBService(){};
+ context.registerService(JAXBService.class.getName(), service, null);
+ log.log(LogService.LOG_INFO, "JAXBService registered");
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/3rdparty/jaxb/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceActivator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/pom.xml 2009-05-29 06:15:21 UTC (rev 89520)
+++ projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/pom.xml 2009-05-29 07:28:27 UTC (rev 89521)
@@ -79,6 +79,7 @@
org.apache.xerces.*,
org.jboss.logging,
org.jboss.osgi.common.log;version=1.0,
+ org.jboss.osgi.common.service;version=1.0,
org.jboss.util*,
org.osgi.framework,
org.osgi.service.log,
Modified: projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java 2009-05-29 06:15:21 UTC (rev 89520)
+++ projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java 2009-05-29 07:28:27 UTC (rev 89521)
@@ -27,6 +27,7 @@
import javax.xml.parsers.SAXParserFactory;
import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.service.XMLBindingService;
import org.jboss.xb.binding.parser.sax.SaxJBossXBParser;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
@@ -60,6 +61,10 @@
// SaxJBossXBParser initializes the SAXParserFactory in a static block
// using SAXParserFactory.newInstance(), which internally uses the TCCL
new SaxJBossXBParser();
+
+ XMLBindingService service = new XMLBindingService(){};
+ context.registerService(XMLBindingService.class.getName(), service, null);
+ log.log(LogService.LOG_INFO, "XMLBindingService registered");
}
finally
{
Added: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/JAXBService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/JAXBService.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/JAXBService.java 2009-05-29 07:28:27 UTC (rev 89521)
@@ -0,0 +1,34 @@
+/*
+ * 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.service;
+
+//$Id$
+
+/**
+ * A marker service that is registered by jboss-osgi-jaxb
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 29-May-2009
+ */
+public interface JAXBService
+{
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/JAXBService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/XMLBindingService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/XMLBindingService.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/XMLBindingService.java 2009-05-29 07:28:27 UTC (rev 89521)
@@ -0,0 +1,34 @@
+/*
+ * 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.service;
+
+//$Id$
+
+/**
+ * A marker service that is registered by jboss-osgi-xml-binding
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 29-May-2009
+ */
+public interface XMLBindingService
+{
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/XMLBindingService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerServiceActivator.java 2009-05-29 06:15:21 UTC (rev 89520)
+++ projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerServiceActivator.java 2009-05-29 07:28:27 UTC (rev 89521)
@@ -130,7 +130,7 @@
}
catch (NamingException ex)
{
- log.log(LogService.LOG_ERROR, "Cannot bind RMIAdoaptor", ex);
+ log.log(LogService.LOG_ERROR, "Cannot bind RMIAdaptor", ex);
}
return iniCtx;
@@ -153,7 +153,7 @@
}
catch (NamingException ex)
{
- log.log(LogService.LOG_ERROR, "Cannot unbind RMIAdoaptor", ex);
+ log.log(LogService.LOG_ERROR, "Cannot unbind RMIAdaptor", ex);
}
super.removedService(reference, service);
Modified: projects/jboss-osgi/trunk/hudson/build.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/build.xml 2009-05-29 06:15:21 UTC (rev 89520)
+++ projects/jboss-osgi/trunk/hudson/build.xml 2009-05-29 07:28:27 UTC (rev 89521)
@@ -27,8 +27,7 @@
<copyjob index="2" prefix="${hudson.job.prefix}" job="jbossosgi-embedded"/>
<copyjob index="3" prefix="${hudson.job.prefix}" job="jbossosgi-jdk15"/>
<copyjob index="4" prefix="${hudson.job.prefix}" job="jbossosgi-jdk16"/>
- <copyjob index="5" prefix="${hudson.job.prefix}" job="jbossosgi-container-matrix"/>
- <copyjob index="6" prefix="${hudson.job.prefix}" job="jbossosgi-framework-matrix"/>
+ <copyjob index="5" prefix="${hudson.job.prefix}" job="jbossosgi-matrix"/>
</sequential>
</macrodef>
Copied: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix (from rev 89519, projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-container-matrix)
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-container-matrix/config.xml 2009-05-29 06:14:09 UTC (rev 89519)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml 2009-05-29 07:28:27 UTC (rev 89521)
@@ -35,6 +35,8 @@
<name>framework</name>
<values>
<string>felix</string>
+ <string>equinox</string>
+ <string>knopflerfish</string>
</values>
</axis>
<axis>
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-05-29 06:15:21 UTC (rev 89520)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-05-29 07:28:27 UTC (rev 89521)
@@ -44,6 +44,7 @@
import org.osgi.framework.Bundle;
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.service.packageadmin.PackageAdmin;
@@ -83,14 +84,21 @@
public OSGiServiceReference getServiceReference(String clazz)
{
- // TODO Auto-generated method stub
- return null;
+ ServiceReference sref = getBundleContext().getServiceReference(clazz);
+ return (sref != null ? new EmbeddedServiceReference(sref) : null);
}
- public OSGiServiceReference[] getServiceReferences(String clazz, String filter)
+ public OSGiServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException
{
- // TODO Auto-generated method stub
- return null;
+ OSGiServiceReference[] retRefs = null;
+ ServiceReference[] srefs = getBundleContext().getServiceReferences(clazz, filter);
+ if (srefs != null)
+ {
+ retRefs = new OSGiServiceReference[srefs.length];
+ for(int i=0; i < srefs.length; i++)
+ retRefs[i] = new EmbeddedServiceReference(srefs[i]);
+ }
+ return retRefs;
}
@Override
Modified: 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-05-29 06:15:21 UTC (rev 89520)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java 2009-05-29 07:28:27 UTC (rev 89521)
@@ -25,18 +25,28 @@
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.common.service.JAXBService;
+import org.jboss.osgi.common.service.MicrocontainerService;
+import org.jboss.osgi.common.service.XMLBindingService;
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.spi.testing.capability.JAXBCapability;
import org.jboss.osgi.spi.testing.capability.JMXCapability;
import org.jboss.osgi.spi.testing.capability.JNDICapability;
+import org.jboss.osgi.spi.testing.capability.MicrocontainerCapability;
import org.jboss.osgi.spi.testing.capability.XMLBindingCapability;
import org.jboss.osgi.spi.testing.capability.XMLParserCapability;
import org.junit.Test;
-import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
/**
@@ -58,8 +68,17 @@
runtime.addCapability(new XMLParserCapability());
- bundle = runtime.getBundle("jboss-osgi-apache-xerces", null);
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ 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
{
@@ -78,8 +97,8 @@
runtime.addCapability(new JAXBCapability());
- bundle = runtime.getBundle("jboss-osgi-jaxb", null);
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ OSGiServiceReference saxRef = runtime.getServiceReference(JAXBService.class.getName());
+ assertNotNull("JAXBService registered", saxRef);
}
finally
{
@@ -98,8 +117,8 @@
runtime.addCapability(new XMLBindingCapability());
- bundle = runtime.getBundle("jboss-osgi-xml-binding", null);
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ OSGiServiceReference saxRef = runtime.getServiceReference(XMLBindingService.class.getName());
+ assertNotNull("XMLBindingService registered", saxRef);
}
finally
{
@@ -118,8 +137,8 @@
runtime.addCapability(new JNDICapability());
- bundle = runtime.getBundle("jboss-osgi-jndi", null);
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ OSGiServiceReference saxRef = runtime.getServiceReference(InitialContext.class.getName());
+ assertNotNull("InitialContext registered", saxRef);
}
finally
{
@@ -138,12 +157,32 @@
runtime.addCapability(new JMXCapability());
- bundle = runtime.getBundle("jboss-osgi-jmx", null);
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ OSGiServiceReference saxRef = runtime.getServiceReference(MBeanServer.class.getName());
+ assertNotNull("MBeanServer registered", saxRef);
}
finally
{
runtime.shutdown();
}
}
+
+ @Test
+ public void testMicrocontainerCapability() throws Exception
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-microcontainer", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new MicrocontainerCapability());
+
+ OSGiServiceReference saxRef = runtime.getServiceReference(MicrocontainerService.class.getName());
+ assertNotNull("MicrocontainerService registered", saxRef);
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2009-05-29 06:15:21 UTC (rev 89520)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2009-05-29 07:28:27 UTC (rev 89521)
@@ -18,9 +18,9 @@
org.osgi.framework.system.packages.extra=\
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.spi, \
- org.jboss.osgi.spi.logging, \
- org.jboss.osgi.spi.management, \
+ org.jboss.osgi.spi;version=1.0, \
+ org.jboss.osgi.spi.logging;version=1.0, \
+ org.jboss.osgi.spi.management;version=1.0, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
16 years, 6 months
JBoss-OSGI SVN: r89519 - in projects/jboss-osgi/trunk: hudson and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-29 02:14:09 -0400 (Fri, 29 May 2009)
New Revision: 89519
Added:
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-container-matrix/
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-framework-matrix/
Removed:
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-container/
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-framework/
Modified:
projects/jboss-osgi/trunk/hudson/build.xml
projects/jboss-osgi/trunk/profiles.xml.example
Log:
AS520 hudson support - WIP
Modified: projects/jboss-osgi/trunk/hudson/build.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/build.xml 2009-05-29 06:04:35 UTC (rev 89518)
+++ projects/jboss-osgi/trunk/hudson/build.xml 2009-05-29 06:14:09 UTC (rev 89519)
@@ -27,8 +27,8 @@
<copyjob index="2" prefix="${hudson.job.prefix}" job="jbossosgi-embedded"/>
<copyjob index="3" prefix="${hudson.job.prefix}" job="jbossosgi-jdk15"/>
<copyjob index="4" prefix="${hudson.job.prefix}" job="jbossosgi-jdk16"/>
- <copyjob index="5" prefix="${hudson.job.prefix}" job="jbossosgi-matrix-container"/>
- <copyjob index="6" prefix="${hudson.job.prefix}" job="jbossosgi-matrix-framework"/>
+ <copyjob index="5" prefix="${hudson.job.prefix}" job="jbossosgi-container-matrix"/>
+ <copyjob index="6" prefix="${hudson.job.prefix}" job="jbossosgi-framework-matrix"/>
</sequential>
</macrodef>
Copied: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-container-matrix (from rev 89518, projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-container)
Copied: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-framework-matrix (from rev 89518, projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-framework)
Modified: projects/jboss-osgi/trunk/profiles.xml.example
===================================================================
--- projects/jboss-osgi/trunk/profiles.xml.example 2009-05-29 06:04:35 UTC (rev 89518)
+++ projects/jboss-osgi/trunk/profiles.xml.example 2009-05-29 06:14:09 UTC (rev 89519)
@@ -12,7 +12,8 @@
</activation>
<properties>
<jboss501.home>/home/tdiesler/svn/jbossas/tags/JBoss_5_0_1_GA/build/output/jboss-5.0.1.GA</jboss501.home>
- <jboss510.home>/home/tdiesler/svn/jbossas/branches/Branch_5_1/build/output/jboss-5.1.0.Beta1</jboss510.home>
+ <jboss510.home>/home/tdiesler/svn/jbossas/tags/JBoss_5_1_0_GA/build/output/jboss-5.1.0.GA</jboss510.home>
+ <jboss520.home>/home/tdiesler/svn/jbossas/branches/Branch_5_x/build/output/jboss-5.2.0.Beta</jboss520.home>
<jboss600.home>/home/tdiesler/svn/jbossas/trunk/build/output/jboss-6.0.0.Alpha1</jboss600.home>
</properties>
</profile>
16 years, 6 months
JBoss-OSGI SVN: r89518 - in projects/jboss-osgi/trunk: distribution/src/main/resources/installer and 6 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-29 02:04:35 -0400 (Fri, 29 May 2009)
New Revision: 89518
Added:
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-5.2.0/
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-container/
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-framework/
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-framework/config.xml
Removed:
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-5.1.0/
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix/
Modified:
projects/jboss-osgi/trunk/distribution/scripts/antrun-installer.xml
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/user-input-spec.xml
projects/jboss-osgi/trunk/hudson/ant.properties.example
projects/jboss-osgi/trunk/hudson/build.xml
projects/jboss-osgi/trunk/hudson/hudson-home/command.sh
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-5.2.0/config.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-container/config.xml
Log:
Add initial support for jboss520
Modified: projects/jboss-osgi/trunk/distribution/scripts/antrun-installer.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/scripts/antrun-installer.xml 2009-05-29 05:52:39 UTC (rev 89517)
+++ projects/jboss-osgi/trunk/distribution/scripts/antrun-installer.xml 2009-05-29 06:04:35 UTC (rev 89518)
@@ -31,6 +31,7 @@
<echo message="jboss.home=${jboss.home}"/>
<echo message="jboss501.home=${jboss501.home}"/>
<echo message="jboss510.home=${jboss510.home}"/>
+ <echo message="jboss520.home=${jboss520.home}"/>
<echo message="jboss600.home=${jboss600.home}"/>
</target>
Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-29 05:52:39 UTC (rev 89517)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-29 06:04:35 UTC (rev 89518)
@@ -30,6 +30,7 @@
<variables>
<variable name="jboss501.home" value="@{jboss501.home}" />
<variable name="jboss510.home" value="@{jboss510.home}" />
+ <variable name="jboss520.home" value="@{jboss520.home}" />
<variable name="jboss600.home" value="@{jboss600.home}" />
</variables>
@@ -37,6 +38,7 @@
<dynamicvariables>
<variable name="jboss.home" value="${jboss501.home}" condition="isJBoss501" />
<variable name="jboss.home" value="${jboss510.home}" condition="isJBoss510" />
+ <variable name="jboss.home" value="${jboss520.home}" condition="isJBoss520" />
<variable name="jboss.home" value="${jboss600.home}" condition="isJBoss600" />
</dynamicvariables>
@@ -62,6 +64,10 @@
<name>jbossSelection</name>
<value>jboss510</value>
</condition>
+ <condition type="variable" id="isJBoss520">
+ <name>jbossSelection</name>
+ <value>jboss520</value>
+ </condition>
<condition type="variable" id="isJBoss600">
<name>jbossSelection</name>
<value>jboss600</value>
Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/user-input-spec.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/user-input-spec.xml 2009-05-29 05:52:39 UTC (rev 89517)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/user-input-spec.xml 2009-05-29 06:04:35 UTC (rev 89518)
@@ -16,6 +16,7 @@
<spec>
<choice txt="JBoss-5.0.1" value="jboss501" set="true"/>
<choice txt="JBoss-5.1.0" value="jboss510"/>
+ <choice txt="JBoss-5.2.0" value="jboss520"/>
<choice txt="JBoss-6.0.0" value="jboss600"/>
</spec>
</field>
Modified: projects/jboss-osgi/trunk/hudson/ant.properties.example
===================================================================
--- projects/jboss-osgi/trunk/hudson/ant.properties.example 2009-05-29 05:52:39 UTC (rev 89517)
+++ projects/jboss-osgi/trunk/hudson/ant.properties.example 2009-05-29 06:04:35 UTC (rev 89518)
@@ -15,7 +15,7 @@
hudson.username=changeme
hudson.password=changeme
-hudson.maven.path=/usr/java/apache-maven-2.0.9
+hudson.maven.path=/usr/java/apache-maven-2.1.0
hudson.root=/home/hudson/workspace/hudson/jboss-osgi
@@ -26,6 +26,7 @@
hudson.http.port=8280
#hudson.jboss501.zip=file:///home/hudson/download/java/jboss/jboss-5.0.1.GA.zip
+#hudson.jboss510.zip=file:///home/hudson/download/java/jboss/jboss-5.1.0.GA.zip
hudson.mail.recipients=
hudson.smtp.host=localhost
Modified: projects/jboss-osgi/trunk/hudson/build.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/build.xml 2009-05-29 05:52:39 UTC (rev 89517)
+++ projects/jboss-osgi/trunk/hudson/build.xml 2009-05-29 06:04:35 UTC (rev 89518)
@@ -15,19 +15,20 @@
<property name="hudson.dir" value="${basedir}"/>
<property name="hudson.target.dir" value="${hudson.dir}/target"/>
- <property name="project.root.dir" value="${basedir}/../.."/>
+ <property name="project.root.dir" value="${basedir}/.."/>
<!-- ================================================================== -->
<!-- Hudson Jobs -->
<!-- ================================================================== -->
<macrodef name="copyjobs">
<sequential>
- <copyjob index="0" prefix="" job="JBoss-5.1.0"/>
+ <copyjob index="0" prefix="" job="JBoss-5.2.0"/>
<copyjob index="1" prefix="" job="JBoss-6.0.0"/>
<copyjob index="2" prefix="${hudson.job.prefix}" job="jbossosgi-embedded"/>
<copyjob index="3" prefix="${hudson.job.prefix}" job="jbossosgi-jdk15"/>
<copyjob index="4" prefix="${hudson.job.prefix}" job="jbossosgi-jdk16"/>
- <copyjob index="5" prefix="${hudson.job.prefix}" job="jbossosgi-matrix"/>
+ <copyjob index="5" prefix="${hudson.job.prefix}" job="jbossosgi-matrix-container"/>
+ <copyjob index="6" prefix="${hudson.job.prefix}" job="jbossosgi-matrix-framework"/>
</sequential>
</macrodef>
@@ -75,12 +76,13 @@
<available property="apache.tomcat.available" file="${thirdparty.dir}/apache-tomcat.zip"/>
<available property="sun.hudson.available" file="${thirdparty.dir}/hudson.war"/>
<available property="jboss501.available" file="${thirdparty.dir}/jboss-5.0.1.GA.zip"/>
+ <available property="jboss510.available" file="${thirdparty.dir}/jboss-5.1.0.GA.zip"/>
</target>
<!--
Get thirdparty dependencies
-->
- <target name="thirdparty" depends="init-thirdparty,get-tomcat,get-hudson,get-jboss501">
+ <target name="thirdparty" depends="init-thirdparty,get-tomcat,get-hudson,get-jboss501,get-jboss510">
<copy todir="${hudson.root}/jboss" file="${thirdparty.dir}/jboss-5.0.1.GA.zip"/>
</target>
<target name="get-tomcat" depends="init-thirdparty" unless="apache.tomcat.available">
@@ -93,6 +95,10 @@
<property name="hudson.jboss501.zip" value="http://downloads.sourceforge.net/jboss/jboss-5.0.1.GA.zip"/>
<get src="${hudson.jboss501.zip}" dest="${thirdparty.dir}/jboss-5.0.1.GA.zip" usetimestamp="true" verbose="true"/>
</target>
+ <target name="get-jboss510" depends="init-thirdparty" unless="jboss510.available">
+ <property name="hudson.jboss501.zip" value="http://downloads.sourceforge.net/jboss/jboss-5.1.0.GA.zip"/>
+ <get src="${hudson.jboss501.zip}" dest="${thirdparty.dir}/jboss-5.1.0.GA.zip" usetimestamp="true" verbose="true"/>
+ </target>
<!--
Setup the Hudson Tomcat instance
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/command.sh
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/command.sh 2009-05-29 05:52:39 UTC (rev 89517)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/command.sh 2009-05-29 06:04:35 UTC (rev 89518)
@@ -31,6 +31,15 @@
cp $RUNTIME_HOME/bin/run.sh $RUNTIME_HOME/bin/run.sh.org
cp $HUDSONBIN/run-with-pid.sh $RUNTIME_HOME/bin/run.sh
;;
+ 'jboss520')
+ JBOSS_BUILD=jboss-5.2.0.Beta
+ JBOSS_ZIP=$HUDSON_HOME/../jboss/$JBOSS_BUILD.zip
+ RUNTIME_HOME=$WORKSPACE/$JBOSS_BUILD
+ RUNTIME_LOG=$RUNTIME_HOME/server/$JBOSS_SERVER/log/server.log
+ rm -rf $RUNTIME_HOME; unzip -q $JBOSS_ZIP -d $WORKSPACE
+ cp $RUNTIME_HOME/bin/run.sh $RUNTIME_HOME/bin/run.sh.org
+ cp $HUDSONBIN/run-with-pid.sh $RUNTIME_HOME/bin/run.sh
+ ;;
'jboss600')
JBOSS_BUILD=jboss-6.0.0.Alpha1
JBOSS_ZIP=$HUDSON_HOME/../jboss/$JBOSS_BUILD.zip
Copied: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-5.2.0 (from rev 89516, projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-5.1.0)
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-5.2.0/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-5.1.0/config.xml 2009-05-29 05:27:08 UTC (rev 89516)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-5.2.0/config.xml 2009-05-29 06:04:35 UTC (rev 89518)
@@ -33,7 +33,7 @@
HUDSONDIR=$OSGIDIR/hudson
HUDSONBIN=$HUDSONDIR/hudson-home/bin
-JBOSS_VERSION=jboss-5.1.0.GA
+JBOSS_VERSION=jboss-5.2.0.Beta
JBOSS_HOME=$WORKSPACE/jbossas/build/output/$JBOSS_VERSION
JBOSS_ZIP=$HUDSON_HOME/../jboss/$JBOSS_VERSION.zip
Copied: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-container (from rev 89516, projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix)
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-container/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml 2009-05-29 05:27:08 UTC (rev 89516)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-container/config.xml 2009-05-29 06:04:35 UTC (rev 89518)
@@ -35,8 +35,6 @@
<name>framework</name>
<values>
<string>felix</string>
- <string>equinox</string>
- <string>knopflerfish</string>
</values>
</axis>
<axis>
@@ -44,6 +42,7 @@
<values>
<string>jboss501</string>
<string>jboss510</string>
+ <string>jboss520</string>
<string>jboss600</string>
<string>runtime</string>
</values>
Added: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-framework/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-framework/config.xml (rev 0)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-framework/config.xml 2009-05-29 06:04:35 UTC (rev 89518)
@@ -0,0 +1,89 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<matrix-project>
+ <actions class="java.util.concurrent.CopyOnWriteArrayList"/>
+ <description>Build and test the JBossOSGi @version.id@ Matrix</description>
+ <logRotator>
+ <daysToKeep>60</daysToKeep>
+ <numToKeep>-1</numToKeep>
+ </logRotator>
+ <keepDependencies>false</keepDependencies>
+ <properties>
+ <hudson.security.AuthorizationMatrixProperty/>
+ </properties>
+ <scm class="hudson.scm.SubversionSCM">
+ <locations>
+ <hudson.scm.SubversionSCM_-ModuleLocation>
+ <remote>@hudson.osgi.url@</remote>
+ <local>jboss-osgi</local>
+ </hudson.scm.SubversionSCM_-ModuleLocation>
+ </locations>
+ <useUpdate>true</useUpdate>
+ <browser class="hudson.scm.browsers.FishEyeSVN">
+ <url>http://fisheye.jboss.com/browse/JBossOSGi</url>
+ <rootModule></rootModule>
+ </browser>
+ </scm>
+ <canRoam>true</canRoam>
+ <disabled>false</disabled>
+ <triggers class="vector">
+ <hudson.triggers.TimerTrigger>
+ <spec>0 20 * * *</spec>
+ </hudson.triggers.TimerTrigger>
+ </triggers>
+ <axes>
+ <axis>
+ <name>framework</name>
+ <values>
+ <string>felix</string>
+ <string>equinox</string>
+ <string>knopflerfish</string>
+ </values>
+ </axis>
+ <axis>
+ <name>container</name>
+ <values>
+ <string>jboss510</string>
+ <string>runtime</string>
+ </values>
+ </axis>
+ <axis>
+ <name>jdk</name>
+ <values>
+ <string>jdk1.5</string>
+ <string>jdk1.6</string>
+ </values>
+ </axis>
+ </axes>
+ <builders>
+ <hudson.tasks.Shell>
+ <command>
+OSGIDIR=$WORKSPACE/jboss-osgi
+HUDSONDIR=$OSGIDIR/hudson
+
+export FRAMEWORK=$framework
+export CONTAINER=$container
+
+export JBOSS_BINDADDR=(a)jboss.bind.address@
+
+# copy the maven profile
+cp @hudson.maven.profile@ $OSGIDIR/profiles.xml
+
+#
+# call command.sh
+#
+/bin/sh $HUDSONDIR/hudson-home/command.sh
+ </command>
+ </hudson.tasks.Shell>
+ </builders>
+ <publishers class="vector">
+ <hudson.tasks.junit.JUnitResultArchiver>
+ <testResults>jboss-osgi/**/target/surefire-reports/TEST-*.xml</testResults>
+ </hudson.tasks.junit.JUnitResultArchiver>
+ <hudson.tasks.Mailer>
+ <recipients>@hudson.mail.recipients@</recipients>
+ <dontNotifyEveryUnstableBuild>true</dontNotifyEveryUnstableBuild>
+ <sendToIndividuals>true</sendToIndividuals>
+ </hudson.tasks.Mailer>
+ </publishers>
+ <buildWrappers/>
+</matrix-project>
Property changes on: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-framework/config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 6 months
JBoss-OSGI SVN: r89507 - projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-28 18:59:27 -0400 (Thu, 28 May 2009)
New Revision: 89507
Modified:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java
Log:
Copy bundle headers to Serializable Dictionary
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java 2009-05-28 22:50:01 UTC (rev 89506)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java 2009-05-28 22:59:27 UTC (rev 89507)
@@ -24,6 +24,8 @@
//$Id$
import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Hashtable;
import javax.management.ObjectName;
@@ -76,7 +78,16 @@
@SuppressWarnings("unchecked")
public Dictionary<String, String> getHeaders()
{
- return bundle.getHeaders();
+ Hashtable<String, String> retHeaders = new Hashtable<String, String>();
+ Dictionary bundleHeaders = bundle.getHeaders();
+ Enumeration keys = bundleHeaders.keys();
+ while(keys.hasMoreElements())
+ {
+ String key = (String)keys.nextElement();
+ String value = (String)bundleHeaders.get(key);
+ retHeaders.put(key, value);
+ }
+ return retHeaders;
}
public void start() throws BundleException
16 years, 6 months
JBoss-OSGI SVN: r89506 - in projects/jboss-osgi/trunk/runtime: felix/src/main/resources and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-28 18:50:01 -0400 (Thu, 28 May 2009)
New Revision: 89506
Modified:
projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml
Log:
Add org.jboss.osgi.spi.testing.capability to AS system packages
Modified: projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-28 22:46:29 UTC (rev 89505)
+++ projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-28 22:50:01 UTC (rev 89506)
@@ -32,6 +32,7 @@
org.jboss.osgi.spi.service,
org.jboss.osgi.spi.management,
org.jboss.osgi.spi.testing,
+ org.jboss.osgi.spi.testing.capability,
org.osgi.framework; version=1.4,
org.osgi.service.packageadmin; version=1.2,
org.osgi.service.startlevel; version=1.1,
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-28 22:46:29 UTC (rev 89505)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-28 22:50:01 UTC (rev 89506)
@@ -34,6 +34,7 @@
org.jboss.osgi.spi.logging,
org.jboss.osgi.spi.management,
org.jboss.osgi.spi.testing,
+ org.jboss.osgi.spi.testing.capability,
org.jboss.xb.binding;version=2.0,
org.jboss.xb.binding.sunday.unmarshalling;version=2.0,
Modified: projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-28 22:46:29 UTC (rev 89505)
+++ projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-28 22:50:01 UTC (rev 89506)
@@ -31,6 +31,7 @@
org.jboss.osgi.spi.service,
org.jboss.osgi.spi.management,
org.jboss.osgi.spi.testing,
+ org.jboss.osgi.spi.testing.capability,
org.osgi.framework; version=1.4,
org.osgi.service.packageadmin; version=1.2,
org.osgi.service.startlevel; version=1.1,
16 years, 6 months
JBoss-OSGI SVN: r89505 - in projects/jboss-osgi/trunk: spi/src/main/java/org/jboss/osgi/spi/testing and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-28 18:46:29 -0400 (Thu, 28 May 2009)
New Revision: 89505
Added:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedServiceReference.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiServiceReference.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedServiceReference.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteServiceReference.java
Modified:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFramework.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
Log:
Add test support for ServiceReferences
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java 2009-05-28 22:38:40 UTC (rev 89504)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -23,9 +23,12 @@
//$Id$
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import javax.management.MBeanServer;
@@ -36,6 +39,7 @@
import org.jboss.osgi.spi.Constants;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.service.packageadmin.PackageAdmin;
@@ -90,6 +94,44 @@
return names;
}
+ public ManagedServiceReference getServiceReference(String clazz)
+ {
+ ManagedServiceReference manref = null;
+ ServiceReference sref = systemContext.getServiceReference(clazz);
+ if (sref != null)
+ {
+ Map<String, Object> props = new HashMap<String, Object>();
+ for (String key : sref.getPropertyKeys())
+ props.put(key, sref.getProperty(key));
+
+ manref = new ManagedServiceReference(clazz, props);
+ }
+ return manref;
+ }
+
+ public ManagedServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ {
+ List<ManagedServiceReference> foundRefs = new ArrayList<ManagedServiceReference>();
+ ServiceReference[] srefs = systemContext.getServiceReferences(clazz, filter);
+ if (srefs != null)
+ {
+ for (ServiceReference sref : srefs)
+ {
+ Map<String, Object> props = new HashMap<String, Object>();
+ for (String key : sref.getPropertyKeys())
+ props.put(key, sref.getProperty(key));
+
+ foundRefs.add(new ManagedServiceReference(clazz, props));
+ }
+ }
+
+ ManagedServiceReference[] manrefs = null;
+ if (foundRefs.size() > 0)
+ manrefs = foundRefs.toArray(new ManagedServiceReference[foundRefs.size()]);
+
+ return manrefs;
+ }
+
public void refreshPackages(String[] symbolicNames)
{
ServiceReference sref = systemContext.getServiceReference(PackageAdmin.class.getName());
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java 2009-05-28 22:38:40 UTC (rev 89504)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -27,6 +27,8 @@
import javax.management.ObjectName;
+import org.osgi.framework.InvalidSyntaxException;
+
/**
* The managed view of an OSGi Framework
*
@@ -49,6 +51,20 @@
ObjectName getBundle(String symbolicName);
/**
+ * Returns a ServiceReference object for a service that implements and was registered
+ * under the specified class.
+ */
+ ManagedServiceReference getServiceReference(String clazz);
+
+ /**
+ * Returns an array of ManagedServiceReference objects.
+ * The returned array of ManagedServiceReference objects contains services
+ * that were registered under the specified class, match the specified filter criteria,
+ * and the packages for the class names under which the services were registered.
+ */
+ ManagedServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException;
+
+ /**
* Refresh packages through the PackageAdmin service
*/
void refreshPackages(String[] symbolicNames);
Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedServiceReference.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedServiceReference.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedServiceReference.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -0,0 +1,53 @@
+/*
+ * 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.management;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class ManagedServiceReference
+{
+ private String className;
+ private Map<String, Object> props;
+
+ public ManagedServiceReference(String className, Map<String, Object> props)
+ {
+ this.className = className;
+ }
+
+ public Object getProperty(String key)
+ {
+ return props.get(key);
+ }
+
+ public String[] getPropertyKeys()
+ {
+ Set<String> keySet = props.keySet();
+ return keySet.toArray(new String[keySet.size()]);
+ }
+}
Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedServiceReference.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-05-28 22:38:40 UTC (rev 89504)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -22,14 +22,13 @@
package org.jboss.osgi.spi.testing;
import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.testing.capability.Capability;
import org.osgi.framework.BundleException;
+import org.osgi.framework.InvalidSyntaxException;
/**
* [TODO]
@@ -50,23 +49,25 @@
OSGiBundle installBundle(String location) throws BundleException;
OSGiBundle[] getBundles();
-
+
OSGiBundle getBundle(String symbolicName, String version);
-
+
OSGiPackageAdmin getPackageAdmin();
+
+ OSGiServiceReference getServiceReference(String clazz);
+ OSGiServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException;
+
InitialContext getInitialContext() throws NamingException;
-
- <T> T getMBeanProxy(Class<T> mbeanInterface, ObjectName objectName) throws MBeanProxyException;
-
+
MBeanServerConnection getMBeanServer();
-
+
void deploy(String location) throws Exception;
-
+
void undeploy(String location) throws Exception;
-
+
String getServerHost();
-
+
void shutdown();
}
Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiServiceReference.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiServiceReference.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiServiceReference.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -0,0 +1,36 @@
+/*
+ * 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.testing;
+
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public interface OSGiServiceReference
+{
+ Object getProperty(String key);
+
+ String[] getPropertyKeys();
+}
Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiServiceReference.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-05-28 22:38:40 UTC (rev 89504)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -38,6 +38,7 @@
import org.jboss.osgi.spi.logging.LogEntryCache;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
+import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.osgi.spi.testing.capability.Capability;
import org.osgi.framework.Bundle;
@@ -80,6 +81,18 @@
return bundleArr;
}
+ public OSGiServiceReference getServiceReference(String clazz)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public OSGiServiceReference[] getServiceReferences(String clazz, String filter)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
@Override
public void addCapability(Capability capability) throws BundleException
{
Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedServiceReference.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedServiceReference.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedServiceReference.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -0,0 +1,52 @@
+/*
+ * 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.testing.internal;
+
+import org.jboss.osgi.spi.testing.OSGiServiceReference;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class EmbeddedServiceReference implements OSGiServiceReference
+{
+ private ServiceReference sref;
+
+ public EmbeddedServiceReference(ServiceReference sref)
+ {
+ this.sref = sref;
+ }
+
+ public Object getProperty(String key)
+ {
+ return sref.getProperty(key);
+ }
+
+ public String[] getPropertyKeys()
+ {
+ return sref.getPropertyKeys();
+ }
+
+}
Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedServiceReference.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-05-28 22:38:40 UTC (rev 89504)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -34,8 +34,6 @@
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
@@ -172,11 +170,6 @@
getMBeanServer().invoke(oname, method, new Object[] { archiveURL }, new String[] { "java.net.URL" });
}
- public <T> T getMBeanProxy(Class<T> mbeanInterface, ObjectName objectName) throws MBeanProxyException
- {
- return MBeanProxy.get(mbeanInterface, objectName, getMBeanServer());
- }
-
public InitialContext getInitialContext() throws NamingException
{
return helper.getInitialContext();
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFramework.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFramework.java 2009-05-28 22:38:40 UTC (rev 89504)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFramework.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -26,6 +26,8 @@
import java.util.Set;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
+import org.jboss.osgi.spi.management.ManagedServiceReference;
+import org.osgi.framework.InvalidSyntaxException;
/**
* The supported functionality of a remote OSGi Framework
@@ -44,4 +46,18 @@
* Get the installed bundle
*/
ManagedBundleMBean getBundle(String symbolicName);
+
+ /**
+ * Returns a ServiceReference object for a service that implements and was registered
+ * under the specified class.
+ */
+ ManagedServiceReference getServiceReference(String clazz);
+
+ /**
+ * Returns an array of ManagedServiceReference objects.
+ * The returned array of ManagedServiceReference objects contains services
+ * that were registered under the specified class, match the specified filter criteria,
+ * and the packages for the class names under which the services were registered.
+ */
+ ManagedServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException;
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java 2009-05-28 22:38:40 UTC (rev 89504)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -21,6 +21,7 @@
*/
package org.jboss.osgi.spi.testing.internal;
+import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
import org.jboss.osgi.spi.testing.OSGiBundle;
@@ -54,7 +55,7 @@
}
try
{
- ManagedFrameworkMBean mbeanProxy = runtime.getMBeanProxy(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
+ ManagedFrameworkMBean mbeanProxy = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
mbeanProxy.refreshPackages(bundleArr);
}
catch (MBeanProxyException ex)
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-05-28 22:38:40 UTC (rev 89504)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -42,8 +42,10 @@
import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
+import org.jboss.osgi.spi.management.ManagedServiceReference;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
+import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.osgi.spi.testing.capability.Capability;
import org.jboss.osgi.spi.testing.capability.ConfigAdminCapability;
@@ -55,6 +57,7 @@
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogReaderService;
import org.osgi.util.tracker.ServiceTracker;
@@ -150,6 +153,27 @@
}
}
+ public OSGiServiceReference getServiceReference(String clazz)
+ {
+ ManagedServiceReference manref = getRemoteFramework().getServiceReference(clazz);
+ return manref != null ? new RemoteServiceReference(manref) : null;
+ }
+
+ public OSGiServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ {
+ OSGiServiceReference[] srefs = null;
+
+ ManagedServiceReference[] manrefs = getRemoteFramework().getServiceReferences(clazz, filter);
+ if (manrefs != null)
+ {
+ srefs = new OSGiServiceReference[manrefs.length];
+ for(int i=0; i < manrefs.length; i++)
+ srefs[i] = new RemoteServiceReference(manrefs[i]);
+ }
+
+ return srefs;
+ }
+
public void startLogEntryTracking(final LogEntryCache logEntryCache)
{
super.startLogEntryTracking(logEntryCache);
@@ -223,10 +247,17 @@
return new RemotePackageAdmin(this);
}
- private RemoteFramework getRemoteFramework() throws Exception
+ private RemoteFramework getRemoteFramework()
{
- if (managedFramework == null)
- managedFramework = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, getMBeanServer());
+ try
+ {
+ if (managedFramework == null)
+ managedFramework = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, getMBeanServer());
+ }
+ catch (MBeanProxyException ex)
+ {
+ throw new RemoteFrameworkException(ex);
+ }
return new RemoteFramework()
{
@@ -263,6 +294,16 @@
}
return remBundles;
}
+
+ public ManagedServiceReference getServiceReference(String clazz)
+ {
+ return managedFramework.getServiceReference(clazz);
+ }
+
+ public ManagedServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ {
+ return managedFramework.getServiceReferences(clazz, filter);
+ }
};
}
}
Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteServiceReference.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteServiceReference.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteServiceReference.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -0,0 +1,52 @@
+/*
+ * 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.testing.internal;
+
+import org.jboss.osgi.spi.management.ManagedServiceReference;
+import org.jboss.osgi.spi.testing.OSGiServiceReference;
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class RemoteServiceReference implements OSGiServiceReference
+{
+ private ManagedServiceReference sref;
+
+ public RemoteServiceReference(ManagedServiceReference sref)
+ {
+ this.sref = sref;
+ }
+
+ public Object getProperty(String key)
+ {
+ return sref.getProperty(key);
+ }
+
+ public String[] getPropertyKeys()
+ {
+ return sref.getPropertyKeys();
+ }
+
+}
Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteServiceReference.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-05-28 22:38:40 UTC (rev 89504)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-05-28 22:46:29 UTC (rev 89505)
@@ -37,6 +37,7 @@
import javax.management.ObjectName;
import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
+import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
@@ -76,7 +77,7 @@
@Test
public void testServiceAccess() throws Exception
{
- MicrocontainerServiceMBean mcService = runtime.getMBeanProxy(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE);
+ MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, runtime.getMBeanServer());
List<String> registeredBeans = mcService.getRegisteredBeans();
assertTrue("BundleContext registered with MC", registeredBeans.contains(BEAN_SYSTEM_BUNDLE_CONTEXT));
assertTrue("MBeanServer registered with MC", registeredBeans.contains(BEAN_MBEAN_SERVER));
@@ -89,10 +90,10 @@
@Test
public void testBundleDeployment() throws Exception
{
- MicrocontainerServiceMBean mcService = runtime.getMBeanProxy(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE);
+ MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, runtime.getMBeanServer());
mcService.deploy(getTestArchiveURL("example-mcservice-bundleA.jar"));
- ManagedFrameworkMBean frameworkMBean = runtime.getMBeanProxy(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK);
+ ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
Set<ObjectName> bundles = frameworkMBean.getBundles();
assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=example-mcservice-bundleA") > 0);
@@ -102,10 +103,10 @@
@Test
public void testBeansDeployment() throws Exception
{
- MicrocontainerServiceMBean mcService = runtime.getMBeanProxy(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE);
+ MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, runtime.getMBeanServer());
mcService.deploy(getTestArchiveURL("example-mcservice-bundleB.jar"));
- ManagedFrameworkMBean frameworkMBean = runtime.getMBeanProxy(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK);
+ ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
Set<ObjectName> bundles = frameworkMBean.getBundles();
assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=example-mcservice-bundleB") > 0);
16 years, 6 months
JBoss-OSGI SVN: r89503 - in projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing: internal and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-28 17:36:58 -0400 (Thu, 28 May 2009)
New Revision: 89503
Modified:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiPackageAdmin.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java
Log:
Implement toString, hashCode, equals
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiBundle.java 2009-05-28 21:25:40 UTC (rev 89502)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiBundle.java 2009-05-28 21:36:58 UTC (rev 89503)
@@ -50,4 +50,28 @@
public abstract void stop() throws BundleException;
public abstract void uninstall() throws BundleException;
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if ((obj instanceof OSGiBundle) == false)
+ return false;
+
+ OSGiBundle other = (OSGiBundle)obj;
+
+ boolean isEqual = getSymbolicName().equals(other.getSymbolicName());
+ isEqual = isEqual && getVersion().equals(other.getVersion());
+ return isEqual;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ public String toString()
+ {
+ return "[" + getSymbolicName() + "," + getVersion() + "]";
+ }
}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiPackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiPackageAdmin.java 2009-05-28 21:25:40 UTC (rev 89502)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiPackageAdmin.java 2009-05-28 21:36:58 UTC (rev 89503)
@@ -28,7 +28,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
-public abstract class OSGiPackageAdmin
+public interface OSGiPackageAdmin
{
- public abstract void refreshPackages(OSGiBundle[] bundles);
+ void refreshPackages(OSGiBundle[] bundles);
}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java 2009-05-28 21:25:40 UTC (rev 89502)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java 2009-05-28 21:36:58 UTC (rev 89503)
@@ -32,7 +32,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
-public class EmbeddedPackageAdmin extends OSGiPackageAdmin
+public class EmbeddedPackageAdmin implements OSGiPackageAdmin
{
private PackageAdmin packAdmin;
@@ -41,7 +41,6 @@
this.packAdmin = packAdmin;
}
- @Override
public void refreshPackages(OSGiBundle[] bundles)
{
Bundle[] bundleArr = null;
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java 2009-05-28 21:25:40 UTC (rev 89502)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java 2009-05-28 21:36:58 UTC (rev 89503)
@@ -32,7 +32,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
-public class RemotePackageAdmin extends OSGiPackageAdmin
+public class RemotePackageAdmin implements OSGiPackageAdmin
{
private RemoteRuntime runtime;
@@ -41,7 +41,6 @@
this.runtime = runtime;
}
- @Override
public void refreshPackages(OSGiBundle[] bundles)
{
String[] bundleArr = null;
16 years, 6 months