[jboss-cvs] JBossAS SVN: r95301 - in projects/jboss-osgi: projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 21 10:20:37 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-10-21 10:20:36 -0400 (Wed, 21 Oct 2009)
New Revision: 95301
Modified:
projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml
projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/EquinoxIntegration.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java
projects/jboss-osgi/trunk/pom.xml
Log:
Upgrade equinox integration
Modified: projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml 2009-10-21 14:17:01 UTC (rev 95300)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml 2009-10-21 14:20:36 UTC (rev 95301)
@@ -20,19 +20,26 @@
<artifactId>jboss-osgi-runtime-equinox</artifactId>
<packaging>jar</packaging>
- <version>3.6-SNAPSHOT</version>
+ <version>3.5-SNAPSHOT</version>
<!-- Parent -->
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.2</version>
+ <version>1.0.4-SNAPSHOT</version>
</parent>
+ <!-- Subversion -->
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/equinox/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/equinox/trunk</developerConnection>
+ <url>http://fisheye.jboss.com/qsearch/JBossOSGi</url>
+ </scm>
+
<!-- Properties -->
<properties>
<version.eclipse.equinox>3.5</version.eclipse.equinox>
- <version.jboss.osgi.spi>1.0.1</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
</properties>
<!-- Dependencies -->
@@ -52,25 +59,28 @@
<artifactId>org.eclipse.osgi.services</artifactId>
<version>${version.eclipse.equinox}</version>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<!-- Build -->
<build>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- </testResource>
- </testResources>
<plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>log4j.output.dir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
</plugins>
</build>
- <!-- Subversion -->
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/equinox/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/equinox/trunk</developerConnection>
- <url>http://fisheye.jboss.com/qsearch/JBossOSGi/projects/runtime/equinox/trunk</url>
- </scm>
-
</project>
Modified: projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/EquinoxIntegration.java
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/EquinoxIntegration.java 2009-10-21 14:17:01 UTC (rev 95300)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/EquinoxIntegration.java 2009-10-21 14:20:36 UTC (rev 95301)
@@ -23,9 +23,12 @@
//$Id: FelixIntegration.java 91762 2009-07-29 12:14:37Z thomas.diesler at jboss.com $
+import java.util.Map;
+
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.framework.FrameworkIntegration;
import org.jboss.osgi.spi.util.ServiceLoader;
+import org.osgi.framework.launch.Framework;
import org.osgi.framework.launch.FrameworkFactory;
/**
@@ -38,15 +41,17 @@
{
// Provide logging
final Logger log = Logger.getLogger(EquinoxIntegration.class);
-
- public void create()
+
+ @Override
+ protected Framework createFramework(Map<String, Object> properties)
{
// Log INFO about this implementation
- log.info(getClass().getPackage().getImplementationTitle());
- log.info(getClass().getPackage().getImplementationVersion());
+ String implTitle = getClass().getPackage().getImplementationTitle();
+ String impVersion = getClass().getPackage().getImplementationVersion();
+ log.info(implTitle + " - " + impVersion);
// Load the framework instance
FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
- framework = factory.newFramework(properties);
+ return factory.newFramework(properties);
}
}
\ No newline at end of file
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-10-21 14:17:01 UTC (rev 95300)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java 2009-10-21 14:20:36 UTC (rev 95301)
@@ -43,14 +43,13 @@
// Provide logging
final Logger log = Logger.getLogger(FelixIntegration.class);
- private Framework framework;
-
@Override
- protected void createFramework(Map<String, Object> properties)
+ protected Framework createFramework(Map<String, Object> properties)
{
// Log INFO about this implementation
- log.info(getClass().getPackage().getImplementationTitle());
- log.info(getClass().getPackage().getImplementationVersion());
+ String implTitle = getClass().getPackage().getImplementationTitle();
+ String impVersion = getClass().getPackage().getImplementationVersion();
+ log.info(implTitle + " - " + impVersion);
// When a Felix instance is embedded in a host application,
// the host application must inform the Felix instance that it is embedded
@@ -61,18 +60,12 @@
// Load the framework instance
FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
- framework = factory.newFramework(properties);
+ return factory.newFramework(properties);
}
- @Override
- protected Framework getFramework()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
public void stop()
{
+ final Framework framework = getFramework();
if (framework != null)
{
// Running the Felix shutdown in a separate thread that gets
@@ -88,7 +81,6 @@
{
framework.stop();
framework.waitForStop(5000);
- framework = null;
log.debug("SystemBundle STOPPED");
}
catch (BundleException ex)
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java 2009-10-21 14:17:01 UTC (rev 95300)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java 2009-10-21 14:20:36 UTC (rev 95301)
@@ -56,6 +56,8 @@
private List<URL> autoInstall = new ArrayList<URL>();
private List<URL> autoStart = new ArrayList<URL>();
+ private Framework framework;
+
public Map<String, Object> getProperties()
{
return properties;
@@ -86,12 +88,6 @@
this.autoStart = autoStart;
}
- /** Overwrite to create the framework */
- protected abstract void createFramework(Map<String, Object> properties);
-
- /** Overwrite to provide the framework */
- protected abstract Framework getFramework();
-
public Bundle getBundle()
{
assertFrameworkStart();
@@ -104,11 +100,23 @@
return getFramework().getBundleContext();
}
+ public Framework getFramework()
+ {
+ if (framework == null)
+ framework = createFramework(properties);
+
+ return framework;
+ }
+
public void create()
{
- createFramework(properties);
+ if (framework == null)
+ framework = createFramework(properties);
}
+ /** Overwrite to create the framework */
+ protected abstract Framework createFramework(Map<String, Object> properties);
+
public void start()
{
// Create the Framework instance
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-10-21 14:17:01 UTC (rev 95300)
+++ projects/jboss-osgi/trunk/pom.xml 2009-10-21 14:20:36 UTC (rev 95301)
@@ -63,7 +63,7 @@
<version.jboss.osgi.jndi>1.0.1</version.jboss.osgi.jndi>
<version.jboss.osgi.microcontainer>1.0.3-SNAPSHOT</version.jboss.osgi.microcontainer>
<version.jboss.osgi.runtime.deployers>1.0.2</version.jboss.osgi.runtime.deployers>
- <version.jboss.osgi.runtime.equinox>3.5</version.jboss.osgi.runtime.equinox>
+ <version.jboss.osgi.runtime.equinox>3.5-SNAPSHOT</version.jboss.osgi.runtime.equinox>
<version.jboss.osgi.runtime.felix>2.0.1-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.runtime.jbossas>1.0.2-SNAPSHOT</version.jboss.osgi.runtime.jbossas>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
More information about the jboss-cvs-commits
mailing list