[jboss-osgi-commits] JBoss-OSGI SVN: r91762 - in projects/jboss-osgi: projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal and 22 other directories.
jboss-osgi-commits at lists.jboss.org
jboss-osgi-commits at lists.jboss.org
Wed Jul 29 08:14:40 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-07-29 08:14:37 -0400 (Wed, 29 Jul 2009)
New Revision: 91762
Removed:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LogEntryImpl.java
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryFilter.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkLoader.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/NamedInstanceProvider.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiFramework.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryCache.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryFilter.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/internal/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log/
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java
projects/jboss-osgi/projects/spi/trunk/pom.xml
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrapProvider.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/OSGiConstantsHelper.java
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/impl/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
projects/jboss-osgi/trunk/reactor/bundles/
projects/jboss-osgi/trunk/reactor/pom.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java
projects/jboss-osgi/trunk/testsuite/pom.xml
projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-bundles.xml
Log:
Update to r4v42
Modified: projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -21,7 +21,7 @@
<artifactId>jboss-osgi-common</artifactId>
<packaging>bundle</packaging>
- <version>1.0.0</version>
+ <version>1.0.1-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -97,6 +97,29 @@
</instructions>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <!-- For some reason the distribution javadoc module needs this -->
+ <file>target/${artifactId}-${version}-sources.jar</file>
+ <classifier>sources</classifier>
+ <type>jar</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Deleted: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LogEntryImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LogEntryImpl.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LogEntryImpl.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,137 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.common.internal;
-
-// $Id$
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogService;
-
-/**
- * A unified implementation of a LogEntry.
- *
- * @author thomas.diesler at jboss.com
- * @since 09-Apr-2009
- */
-public class LogEntryImpl implements LogEntry
-{
- private long time;
- private int level;
- private Bundle bundle;
- private ServiceReference sref;
- private String message;
- private Throwable exception;
-
- private String bndStr;
- private String srefStr;
-
- public LogEntryImpl(LogEntry le)
- {
- this(le.getTime(), le.getBundle(), le.getServiceReference(), le.getLevel(), le.getMessage(), le.getException());
- }
-
- public LogEntryImpl(long time, Bundle bundle, ServiceReference sref, int level, String message, Throwable exception)
- {
- this.time = time;
- this.bundle = bundle;
- this.sref = sref;
- this.level = level;
- this.message = message;
- this.exception = exception;
-
- if (bundle != null)
- bndStr = bundle.getSymbolicName();
-
- if (sref != null && sref.getBundle() != null)
- srefStr = sref.getBundle().getSymbolicName();
- }
-
- public Bundle getBundle()
- {
- return bundle;
- }
-
- public Throwable getException()
- {
- return exception;
- }
-
- public int getLevel()
- {
- return level;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- public ServiceReference getServiceReference()
- {
- return sref;
- }
-
- public long getTime()
- {
- return time;
- }
-
- private String logLevel(int level)
- {
- String logLevel;
- switch (level)
- {
- case LogService.LOG_DEBUG:
- logLevel = "DEBUG";
- break;
- case LogService.LOG_INFO:
- logLevel = "INFO";
- break;
- case LogService.LOG_WARNING:
- logLevel = "WARN";
- break;
- case LogService.LOG_ERROR:
- logLevel = "ERROR";
- break;
- default:
- logLevel = "Level=" + level;
- }
- return logLevel;
- }
-
- @Override
- public String toString()
- {
- String t = new SimpleDateFormat("dd-MMM-yyyy HH:mm.ss.SSS").format(new Date(time));
- String l = " " + logLevel(level);
- String s = srefStr != null ? ",sref=" + srefStr : "";
- String b = ",bnd=" + bndStr;
- String m = ",msg=" + message;
- String e = exception != null ? ",ex=" + exception : "";
- return "[" + t + l + b + s + m + e + "]";
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,171 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.common.log;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.osgi.common.internal.LogEntryImpl;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogListener;
-
-/**
- * A LogListener that caches LogEntry objects for later retrieval.
- *
- * The entries can be filtered with a list of {@link LogEntryFilter} instances.
- * A log entry is cached if it matches at least one of the registered filters.
- * If there is no filter registered entries are cached unconditionally.
- *
- * @author thomas.diesler at jboss.com
- * @since 09-Apr-2009
- */
-public class LogEntryCache implements LogListener
-{
- private List<LogEntry> entries = new ArrayList<LogEntry>();
- private List<LogEntryFilter> filters = new ArrayList<LogEntryFilter>();
-
- /**
- * Create a LogEntryCache with a single associated filter
- */
- public LogEntryCache(LogEntryFilter filter)
- {
- filters.add(filter);
- }
-
- /**
- * Create a LogEntryCache with no associated filters
- */
- public LogEntryCache()
- {
- }
-
- /**
- * Add a LogEntryFilter
- */
- public void addFilter(LogEntryFilter filter)
- {
- filters.add(filter);
- }
-
- /**
- * Clear the list of cached entries.
- */
- public void clear()
- {
- synchronized (entries)
- {
- entries.clear();
- }
- }
-
- /**
- * Clear the list of registered filters.
- */
- public void clearFilters()
- {
- // filters.clear() would need synchronization
- filters = new ArrayList<LogEntryFilter>();
- }
-
- /**
- * Get the list of cached entries.
- *
- * Note, that the LogService delivers LogEntries asynchronously.
- * Client should not rely on a certain LogEntry already beein delivered
- * when calling this method.
- */
- public List<LogEntry> getLog()
- {
- return getLog(false);
- }
-
- /**
- * Get the list of cached entries and optionally clears the list.
- *
- * Note, that the LogService delivers LogEntries asynchronously.
- * Client should not rely on a certain LogEntry already beein delivered
- * when calling this method.
- */
- public List<LogEntry> getLog(boolean clear)
- {
- synchronized (entries)
- {
- ArrayList<LogEntry> retList = new ArrayList<LogEntry>(entries);
- if (clear == true)
- entries.clear();
-
- return retList;
- }
- }
-
- /**
- * Listener method called for each LogEntry object created.
- */
- public void logged(LogEntry entry)
- {
- // Replace entry with a unified wrapper
- entry = new LogEntryImpl(entry);
-
- List<LogEntryFilter> snapshot = new ArrayList<LogEntryFilter>(filters);
- synchronized (entries)
- {
- if (snapshot.size() == 0)
- {
- entries.add(entry);
- return;
- }
-
- // Add the entry if if matches at least one filter
- for (LogEntryFilter filter : snapshot)
- {
- if (match(filter, entry))
- {
- entries.add(entry);
- break;
- }
- }
- }
- }
-
- private boolean match(LogEntryFilter filter, LogEntry entry)
- {
- boolean match = entry.getLevel() <= filter.getLevel();
-
- if (match && filter.getBundleRegex() != null)
- {
- String entryBnd = entry.getBundle().getSymbolicName();
- String filterRegex = filter.getBundleRegex();
- match = entryBnd.matches(filterRegex);
- }
-
- if (match && filter.getMessageRegex() != null)
- {
- String entryMsg = entry.getMessage();
- String filterRegex = filter.getMessageRegex();
- match = entryMsg.matches(filterRegex);
- }
-
- return match;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryFilter.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryFilter.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LogEntryFilter.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.common.log;
-
-//$Id$
-
-
-/**
- * A LogEntry filter that can be used with the LogEntryCache
- *
- * @author thomas.diesler at jboss.com
- * @since 09-Apr-2009
- */
-public class LogEntryFilter
-{
- private int level;
- private String bndRegex;
- private String msgRegex;
-
- /**
- * Create a LogEntryFilter with the associated criteria.
- *
- * @param bndRegex A regex that matches a Bundle's SymbolicName
- * @param level The maximum log level accepted by this filter
- * @param msgRegex A regex that matches the log message
- */
- public LogEntryFilter(String bndRegex, int level, String msgRegex)
- {
- this.bndRegex = bndRegex;
- this.msgRegex = msgRegex;
- this.level = level < 1 ? Integer.MAX_VALUE : level;
- }
-
- /**
- * Create a LogEntryFilter with the associated criteria.
- *
- * @param bndRegex A regex that matches a Bundle's SymbolicName
- * @param level The maximum log level accepted by this filter
- */
- public LogEntryFilter(String bndRegex, int level)
- {
- this(bndRegex, level, null);
- }
-
- /**
- * Create a LogEntryFilter with the associated criteria.
- *
- * @param bndRegex A regex that matches a Bundle's SymbolicName
- */
- public LogEntryFilter(String bndRegex)
- {
- this(bndRegex, Integer.MAX_VALUE, null);
- }
-
- /**
- * Get the Bundle Symbolic-Name regex.
- */
- public String getBundleRegex()
- {
- return bndRegex;
- }
-
- /**
- * Get the log message regex.
- */
- public String getMessageRegex()
- {
- return msgRegex;
- }
-
- /**
- * Get the log entry maximum log level.
- */
- public int getLevel()
- {
- return level;
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/FrameworkLaunchTestCase.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -25,9 +25,10 @@
import static org.junit.Assert.assertEquals;
-import org.jboss.osgi.spi.framework.FrameworkLoader;
+import org.jboss.osgi.spi.util.ServiceLoader;
import org.junit.Test;
import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
/**
* Test OSGi System bundle access
@@ -40,7 +41,8 @@
@Test
public void testFrameworkLaunch()
{
- Framework framework = FrameworkLoader.newFramework(null);
+ FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
+ Framework framework = factory.newFramework(null);
assertEquals("BundleId == 0", 0, framework.getBundleId());
assertEquals("SymbolicName", "org.eclipse.osgi", framework.getSymbolicName());
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -29,14 +29,15 @@
import java.util.List;
import java.util.Map;
-import org.apache.felix.framework.Felix;
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.FrameworkException;
-import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.logging.ExportedPackageHelper;
+import org.jboss.osgi.spi.util.ServiceLoader;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
/**
* An abstraction of an OSGi Framework
@@ -44,7 +45,7 @@
* @author thomas.diesler at jboss.com
* @since 23-Jan-2009
*/
-public class FelixIntegration implements OSGiFramework
+public class FelixIntegration
{
// Provide logging
final Logger log = Logger.getLogger(FelixIntegration.class);
@@ -53,7 +54,7 @@
private List<URL> autoInstall = new ArrayList<URL>();
private List<URL> autoStart = new ArrayList<URL>();
- private Felix framework;
+ private Framework framework;
public Map<String, Object> getProperties()
{
@@ -108,8 +109,9 @@
// An instance of Logger that the framework uses as its default logger
properties.put("felix.log.logger", new FelixLogger());
- // Init the System Bundle
- framework = new Felix(properties);
+ // Load the framework instance
+ FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
+ framework = factory.newFramework(properties);
}
public void start()
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -25,9 +25,10 @@
import static org.junit.Assert.assertEquals;
-import org.jboss.osgi.spi.framework.FrameworkLoader;
+import org.jboss.osgi.spi.util.ServiceLoader;
import org.junit.Test;
import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
/**
* Test OSGi System bundle access
@@ -40,7 +41,8 @@
@Test
public void testFrameworkLaunch()
{
- Framework framework = FrameworkLoader.newFramework(null);
+ FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
+ Framework framework = factory.newFramework(null);
assertEquals("BundleId == 0", 0, framework.getBundleId());
assertEquals("SymbolicName", "org.apache.felix.framework", framework.getSymbolicName());
Deleted: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.felix;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-
-import org.jboss.osgi.felix.FelixIntegration;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-
-/**
- * Test OSGi System bundle access
- *
- * @author thomas.diesler at jboss.com
- * @since 23-Jan-2009
- */
-public class SystemBundleTestCase extends OSGiTest
-{
- @Test
- public void testFelixIntegration()
- {
- FelixIntegration framework = new FelixIntegration();
- framework.create();
- framework.start();
-
- Bundle bundle = framework.getBundle();
-
- assertEquals("BundleId == 0", 0, bundle.getBundleId());
- assertEquals("SymbolicName", "org.apache.felix.framework", bundle.getSymbolicName());
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -80,6 +80,29 @@
<!-- Build -->
<build>
<plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <!-- For some reason the distribution javadoc module needs this -->
+ <file>target/${artifactId}-${version}-sources.jar</file>
+ <classifier>sources</classifier>
+ <type>jar</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkLoader.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkLoader.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkLoader.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.framework;
-
-//$Id$
-
-import java.util.Map;
-
-import org.jboss.osgi.spi.util.ServiceLoader;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.launch.Framework;
-import org.osgi.framework.launch.FrameworkFactory;
-
-/**
- * The FrameworkLoader uses the {@link org.osgi.framework.launch} API to load a new
- * instance on a {@link Framework}.
- *
- * @author thomas.diesler at jboss.com
- * @since 28-Jul-2009
- */
-public abstract class FrameworkLoader
-{
- /**
- * Create a new {@link Framework} instance.
- *
- * @param configuration The framework properties to configure the new
- * framework instance. If framework properties are not provided by
- * the configuration argument, the created framework instance must
- * use some reasonable default configuration appropriate for the
- * current VM. For example, the system packages for the current
- * execution environment should be properly exported. The specified
- * configuration argument may be <code>null</code>. The created
- * framework instance must copy any information needed from the
- * specified configuration argument since the configuration argument
- * can be changed after the framework instance has been created.
- * @return A new, configured {@link Framework} instance. The framework
- * instance must be in the {@link Bundle#INSTALLED} state.
- * @throws SecurityException If the caller does not have
- * <code>AllPermission</code>, and the Java Runtime Environment
- * supports permissions.
- */
- @SuppressWarnings("unchecked")
- public static Framework newFramework(Map configuration)
- {
- FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
- if (factory == null)
- throw new IllegalStateException("Cannot load FrameworkFactory");
-
- return factory.newFramework(configuration);
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/NamedInstanceProvider.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/NamedInstanceProvider.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/NamedInstanceProvider.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.framework;
-
-// $Id$
-
-/**
- * Provide a named instance from the configuration.
- *
- * @author ales.justin at jboss.com
- * @author thomas.diesler at jboss.com
- */
-public interface NamedInstanceProvider
-{
- /**
- * Get a named instance
- *
- * @param name the attribute name
- * @return attribute
- */
- Object getInstance(String name);
-
- /**
- * Get a named instance for a given type
- *
- * @param <T> exact attribute type
- * @param name the attribute name
- * @param expectedType the expected type
- * @return attribute
- */
- <T> T getInstance(String name, Class<T> expectedType);
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -44,7 +44,9 @@
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
+import org.osgi.framework.launch.Framework;
/**
* The OSGiBootstrap provides an {@link OSGiFramework} through a {@link OSGiBootstrapProvider}.
@@ -102,7 +104,7 @@
initBootstrap();
OSGiBootstrapProvider bootProvider = getBootstrapProvider();
- OSGiFramework framework = bootProvider.getFramework();
+ Framework framework = bootProvider.getFramework();
Runtime runtime = Runtime.getRuntime();
runtime.addShutdownHook(new ShutdownThread(framework));
@@ -206,7 +208,7 @@
{
try
{
- return file.toURL();
+ return file.toURI().toURL();
}
catch (MalformedURLException e)
{
@@ -216,9 +218,9 @@
class StartupThread extends Thread
{
- private OSGiFramework framework;
+ private Framework framework;
- public StartupThread(OSGiFramework framework)
+ public StartupThread(Framework framework)
{
this.framework = framework;
}
@@ -227,7 +229,14 @@
{
// Start the framework
final long beforeStart = System.currentTimeMillis();
- framework.start();
+ try
+ {
+ framework.start();
+ }
+ catch (BundleException ex)
+ {
+ throw new IllegalStateException("Cannot start framework", ex);
+ }
final long afterStart = System.currentTimeMillis();
// Report how long it took to boot and do the first scan
@@ -278,9 +287,9 @@
class ShutdownThread extends Thread
{
- private OSGiFramework framework;
+ private Framework framework;
- public ShutdownThread(OSGiFramework framework)
+ public ShutdownThread(Framework framework)
{
this.framework = framework;
}
@@ -288,7 +297,14 @@
public void run()
{
log.info("Initiating shutdown ...");
- framework.stop();
+ try
+ {
+ framework.stop();
+ }
+ catch (BundleException ex)
+ {
+ log.error("Cannot stop framework", ex);
+ }
log.info("Shutdown complete");
}
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrapProvider.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrapProvider.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -26,38 +26,26 @@
import java.io.InputStream;
import java.net.URL;
+import org.osgi.framework.launch.Framework;
+
/**
- * An OSGiBootstrapProvider provides an OSGiFramework
+ * An OSGiBootstrapProvider provides an OSGi Framework
* <p/>
- * Implementations would configure the OSGiFramework through some form of descriptor.
- * <p/>
- * Natively, the SPI provides an OSGiBootstrapProvider that is based on the Microkernel.
+ * Implementations would configure the OSGi Framework through some form of descriptor.
*
* @author thomas.diesler at jboss.com
* @since 18-Jun-2008
*/
-public interface OSGiBootstrapProvider extends NamedInstanceProvider
+public interface OSGiBootstrapProvider
{
- /** The Framework bean name - jboss.osgi:service=Framework */
- public static final String DEFAULT_FRAMEWORK_NAME = "jboss.osgi:service=Framework";
-
/**
- * Get the OSGiFramework that registerd with the default name
+ * Get the configured OSGi Framework
*
* @return The configured instance of a Framework
- * @throws IllegalArgumentException if this is not AttributeProvider instance
*/
- OSGiFramework getFramework();
+ Framework getFramework();
/**
- * Get an OSGiFramework with a given name from this OSGiBootstrapProvider
- *
- * @param name the framework name
- * @return The configured instance of a Framework, or null
- */
- OSGiFramework getFramework(String name);
-
- /**
* Configure this provider with the default configuration
*/
void configure();
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiFramework.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiFramework.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiFramework.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.framework;
-
-//$Id$
-
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * An abstraction of an OSGi Framework
- *
- * @author thomas.diesler at jboss.com
- * @since 23-Jan-2009
- */
-public interface OSGiFramework
-{
- /*
- * * Get the Framework properties
- */
- Map<String, Object> getProperties();
-
- /*
- * * Set the Framework properties. This can only be done before the Framework is started.
- */
- void setProperties(Map<String, Object> props);
-
- /*
- * * Get the list of bundles that get installed automatically
- */
- List<URL> getAutoInstall();
-
- /*
- * * Set the list of bundles that get installed automatically. This can only be done before the Framework is started.
- */
- void setAutoInstall(List<URL> autoInstall);
-
- /*
- * * Get the list of bundles that get installed and started automatically
- */
- List<URL> getAutoStart();
-
- /*
- * * Set the list of bundles that get installed and started automatically. This can only be done before the Framework is started.
- */
- void setAutoStart(List<URL> autoStart);
-
- /*
- * * Start the Framework
- */
- void start();
-
- /*
- * * Stop the Framework
- */
- void stop();
-
- /*
- * * Get the System Bundle associated with this Framework
- */
- Bundle getBundle();
-
- /*
- * * Get the System Bundle Context associated with this Framework
- */
- BundleContext getBundleContext();
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -29,6 +29,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Dictionary;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
@@ -37,8 +38,20 @@
import java.util.Properties;
import java.util.Set;
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.FrameworkException;
import org.jboss.osgi.spi.NotImplementedException;
import org.jboss.osgi.spi.internal.StringPropertyReplacer;
+import org.jboss.osgi.spi.logging.ExportedPackageHelper;
+import org.jboss.osgi.spi.util.ServiceLoader;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.FrameworkEvent;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
/**
* A simple properties based bootstrap provider
@@ -82,13 +95,14 @@
*/
public class PropertiesBootstrapProvider implements OSGiBootstrapProvider
{
+ // Provide logging
+ final Logger log = Logger.getLogger(PropertiesBootstrapProvider.class);
+
/** The default framework property: jboss.osgi.framework.properties */
public static final String OSGI_FRAMEWORK_CONFIG = "jboss.osgi.framework.properties";
/** The default framework config: jboss-osgi-framework.properties */
public static final String DEFAULT_OSGI_FRAMEWORK_PROPERTIES = "jboss-osgi-framework.properties";
- /** The OSGi framework integration class: org.jboss.osgi.spi.framework.impl */
- public static final String PROP_OSGI_FRAMEWORK_IMPL = "org.jboss.osgi.spi.framework.impl";
/** Optional list of bundles that get installed automatically: org.jboss.osgi.spi.framework.autoInstall */
public static final String PROP_OSGI_FRAMEWORK_AUTO_INSTALL = "org.jboss.osgi.spi.framework.autoInstall";
/** Optional list of bundles that get started automatically: org.jboss.osgi.spi.framework.autoStart */
@@ -99,13 +113,12 @@
private static Set<String> internalProps = new HashSet<String>();
static
{
- internalProps.add(PROP_OSGI_FRAMEWORK_IMPL);
internalProps.add(PROP_OSGI_FRAMEWORK_AUTO_INSTALL);
internalProps.add(PROP_OSGI_FRAMEWORK_AUTO_START);
internalProps.add(PROP_OSGI_FRAMEWORK_EXTRA);
}
- private OSGiFramework framework;
+ private Framework framework;
private boolean configured;
public void configure()
@@ -116,28 +129,87 @@
public void configure(URL urlConfig)
{
// Read the configuration properties
- Properties props = getBootstrapProperties(urlConfig);
+ final Map<String, Object> props = getBootstrapProperties(urlConfig);
// Load the framework instance
- framework = loadFrameworkImpl(urlConfig, props);
+ FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
+ final Framework frameworkImpl = factory.newFramework(props);
+ framework = new FrameworkDelegate(frameworkImpl)
+ {
+ @Override
+ public void start() throws BundleException
+ {
+ super.start();
+
+ // Get system bundle context
+ BundleContext context = framework.getBundleContext();
+ if (context == null)
+ throw new FrameworkException("Cannot obtain system context");
- // Process Framework props
- initFrameworkProperties(props);
+ // Log the the framework packages
+ ExportedPackageHelper packageHelper = new ExportedPackageHelper(context);
+ packageHelper.logExportedPackages(frameworkImpl);
+
+ // Init the the autoInstall URLs
+ List<URL> autoInstall = getBundleURLs(props, PROP_OSGI_FRAMEWORK_AUTO_INSTALL);
- // Init the the autoInstall URLs
- List<URL> installURLs = getBundleURLs(props, PROP_OSGI_FRAMEWORK_AUTO_INSTALL);
- framework.setAutoInstall(installURLs);
+ // Init the the autoStart URLs
+ List<URL> autoStart = getBundleURLs(props, PROP_OSGI_FRAMEWORK_AUTO_START);
- // Init the the autoStart URLs
- List<URL> startURLs = getBundleURLs(props, PROP_OSGI_FRAMEWORK_AUTO_START);
- framework.setAutoStart(startURLs);
+ Map<URL, Bundle> autoBundles = new HashMap<URL, Bundle>();
+ // Add the autoStart bundles to autoInstall
+ for (URL bundleURL : autoStart)
+ {
+ autoInstall.add(bundleURL);
+ }
+
+ // Install autoInstall bundles
+ for (URL bundleURL : autoInstall)
+ {
+ try
+ {
+ Bundle bundle = context.installBundle(bundleURL.toString());
+ long bundleId = bundle.getBundleId();
+ log.info("Installed bundle [" + bundleId + "]: " + bundle.getSymbolicName());
+ autoBundles.put(bundleURL, bundle);
+ }
+ catch (BundleException ex)
+ {
+ //framework.stop();
+ throw new IllegalStateException("Cannot install bundle: " + bundleURL, ex);
+ }
+ }
+
+ // Start autoStart bundles
+ for (URL bundleURL : autoStart)
+ {
+ try
+ {
+ Bundle bundle = autoBundles.get(bundleURL);
+ if (bundle != null)
+ {
+ bundle.start();
+ packageHelper.logExportedPackages(bundle);
+ log.info("Started bundle: " + bundle.getSymbolicName());
+ }
+ }
+ catch (BundleException ex)
+ {
+ //framework.stop();
+ throw new IllegalStateException("Cannot start bundle: " + bundleURL, ex);
+ }
+ }
+ }
+ };
+
+
configured = true;
}
- private List<URL> getBundleURLs(Properties props, String key)
+ private List<URL> getBundleURLs(Map<String, Object> props, String key)
{
- String bundleList = props.getProperty(key);
+ String bundleList = (String)props.get(key);
if (bundleList == null)
bundleList = "";
@@ -181,7 +253,7 @@
throw new NotImplementedException();
}
- public OSGiFramework getFramework()
+ public Framework getFramework()
{
if (configured == false)
{
@@ -191,59 +263,8 @@
return framework;
}
- public OSGiFramework getFramework(String name)
- {
- throw new NotImplementedException();
- }
-
- public Object getInstance(String name)
- {
- throw new NotImplementedException();
- }
-
- public <T> T getInstance(String name, Class<T> expectedType)
- {
- throw new NotImplementedException();
- }
-
- private void initFrameworkProperties(Properties props)
- {
- Map<String, Object> frameworkProps = new HashMap<String, Object>();
- Enumeration<?> keys = props.propertyNames();
- while (keys.hasMoreElements())
- {
- String key = (String)keys.nextElement();
- if (internalProps.contains(key) == false)
- {
- String value = props.getProperty(key);
- frameworkProps.put(key, value);
- }
- }
- framework.setProperties(frameworkProps);
- }
-
- private OSGiFramework loadFrameworkImpl(URL urlConfig, Properties props)
- {
- String frameworkImpl = props.getProperty(PROP_OSGI_FRAMEWORK_IMPL);
- if (frameworkImpl == null)
- throw new IllegalStateException("Cannot get : " + urlConfig);
-
- OSGiFramework framework;
- try
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- Class<?> frameworkClass = ctxLoader.loadClass(frameworkImpl);
- framework = (OSGiFramework)frameworkClass.newInstance();
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot load framework: " + frameworkImpl, ex);
- }
- return framework;
- }
-
@SuppressWarnings("unchecked")
- private Properties getBootstrapProperties(URL urlConfig)
+ private Map<String, Object> getBootstrapProperties(URL urlConfig)
{
Properties props = new Properties();
try
@@ -257,13 +278,31 @@
throw new IllegalStateException("Cannot load properties from: " + urlConfig, ex);
}
- // Replace system properties
+ Map<String, Object> propMap = new HashMap<String, Object>();
+
+ // Process property list
Enumeration<String> keys = (Enumeration<String>)props.propertyNames();
while (keys.hasMoreElements())
{
String key = keys.nextElement();
String value = props.getProperty(key);
- props.setProperty(key, StringPropertyReplacer.replaceProperties(value));
+
+ // Replace property variables
+ propMap.put(key, StringPropertyReplacer.replaceProperties(value));
+
+ if (key.endsWith(".instance"))
+ {
+ try
+ {
+ String subkey = key.substring(0, key.lastIndexOf(".instance"));
+ Object instance = Class.forName(value).newInstance();
+ propMap.put(subkey, instance);
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot load " + key + "=" + value, ex);
+ }
+ }
}
// Merge optional extra properties
@@ -284,7 +323,7 @@
File propsFile = new File(extraPropsValue);
try
{
- extraPropsURL = propsFile.toURL();
+ extraPropsURL = propsFile.toURI().toURL();
}
catch (MalformedURLException e)
{
@@ -295,12 +334,169 @@
if (extraPropsURL == null)
throw new IllegalStateException("Invalid properties URL: " + extraPropsValue);
- props.remove(PROP_OSGI_FRAMEWORK_EXTRA);
- Properties extraProps = getBootstrapProperties(extraPropsURL);
- props.putAll(extraProps);
+ propMap.remove(PROP_OSGI_FRAMEWORK_EXTRA);
+ Map<String, Object> extraProps = getBootstrapProperties(extraPropsURL);
+ propMap.putAll(extraProps);
}
- return props;
+ return propMap;
}
+ class FrameworkDelegate implements Framework
+ {
+ private Framework framework;
+
+ FrameworkDelegate(Framework framework)
+ {
+ this.framework = framework;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration findEntries(String path, String filePattern, boolean recurse)
+ {
+ return framework.findEntries(path, filePattern, recurse);
+ }
+
+ public BundleContext getBundleContext()
+ {
+ return framework.getBundleContext();
+ }
+
+ public long getBundleId()
+ {
+ return framework.getBundleId();
+ }
+
+ public URL getEntry(String path)
+ {
+ return framework.getEntry(path);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration getEntryPaths(String path)
+ {
+ return framework.getEntryPaths(path);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Dictionary getHeaders()
+ {
+ return framework.getHeaders();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Dictionary getHeaders(String locale)
+ {
+ return framework.getHeaders(locale);
+ }
+
+ public long getLastModified()
+ {
+ return framework.getLastModified();
+ }
+
+ public String getLocation()
+ {
+ return framework.getLocation();
+ }
+
+ public ServiceReference[] getRegisteredServices()
+ {
+ return framework.getRegisteredServices();
+ }
+
+ public URL getResource(String name)
+ {
+ return framework.getResource(name);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration getResources(String name) throws IOException
+ {
+ return framework.getResources(name);
+ }
+
+ public ServiceReference[] getServicesInUse()
+ {
+ return framework.getServicesInUse();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map getSignerCertificates(int signersType)
+ {
+ return framework.getSignerCertificates(signersType);
+ }
+
+ public int getState()
+ {
+ return framework.getState();
+ }
+
+ public String getSymbolicName()
+ {
+ return framework.getSymbolicName();
+ }
+
+ public Version getVersion()
+ {
+ return framework.getVersion();
+ }
+
+ public boolean hasPermission(Object permission)
+ {
+ return framework.hasPermission(permission);
+ }
+
+ public void init() throws BundleException
+ {
+ framework.init();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Class loadClass(String name) throws ClassNotFoundException
+ {
+ return framework.loadClass(name);
+ }
+
+ public void start() throws BundleException
+ {
+ framework.start();
+ }
+
+ public void start(int options) throws BundleException
+ {
+ framework.start(options);
+ }
+
+ public void stop() throws BundleException
+ {
+ framework.stop();
+ }
+
+ public void stop(int options) throws BundleException
+ {
+ framework.stop(options);
+ }
+
+ public void uninstall() throws BundleException
+ {
+ framework.uninstall();
+ }
+
+ public void update() throws BundleException
+ {
+ framework.update();
+ }
+
+ public void update(InputStream in) throws BundleException
+ {
+ framework.update(in);
+ }
+
+ public FrameworkEvent waitForStop(long timeout) throws InterruptedException
+ {
+ return framework.waitForStop(timeout);
+ }
+
+ }
}
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryCache.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryCache.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryCache.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,171 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.logging;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.osgi.spi.logging.internal.LogEntryImpl;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogListener;
-
-/**
- * A LogListener that caches LogEntry objects for later retrieval.
- *
- * The entries can be filtered with a list of {@link LogEntryFilter} instances.
- * A log entry is cached if it matches at least one of the registered filters.
- * If there is no filter registered entries are cached unconditionally.
- *
- * @author thomas.diesler at jboss.com
- * @since 09-Apr-2009
- */
-public class LogEntryCache implements LogListener
-{
- private List<LogEntry> entries = new ArrayList<LogEntry>();
- private List<LogEntryFilter> filters = new ArrayList<LogEntryFilter>();
-
- /**
- * Create a LogEntryCache with a single associated filter
- */
- public LogEntryCache(LogEntryFilter filter)
- {
- filters.add(filter);
- }
-
- /**
- * Create a LogEntryCache with no associated filters
- */
- public LogEntryCache()
- {
- }
-
- /**
- * Add a LogEntryFilter
- */
- public void addFilter(LogEntryFilter filter)
- {
- filters.add(filter);
- }
-
- /**
- * Clear the list of cached entries.
- */
- public void clear()
- {
- synchronized (entries)
- {
- entries.clear();
- }
- }
-
- /**
- * Clear the list of registered filters.
- */
- public void clearFilters()
- {
- // filters.clear() would need synchronization
- filters = new ArrayList<LogEntryFilter>();
- }
-
- /**
- * Get the list of cached entries.
- *
- * Note, that the LogService delivers LogEntries asynchronously.
- * Client should not rely on a certain LogEntry already beein delivered
- * when calling this method.
- */
- public List<LogEntry> getLog()
- {
- return getLog(false);
- }
-
- /**
- * Get the list of cached entries and optionally clears the list.
- *
- * Note, that the LogService delivers LogEntries asynchronously.
- * Client should not rely on a certain LogEntry already beein delivered
- * when calling this method.
- */
- public List<LogEntry> getLog(boolean clear)
- {
- synchronized (entries)
- {
- ArrayList<LogEntry> retList = new ArrayList<LogEntry>(entries);
- if (clear == true)
- entries.clear();
-
- return retList;
- }
- }
-
- /**
- * Listener method called for each LogEntry object created.
- */
- public void logged(LogEntry entry)
- {
- // Replace entry with a unified wrapper
- entry = new LogEntryImpl(entry);
-
- List<LogEntryFilter> snapshot = new ArrayList<LogEntryFilter>(filters);
- synchronized (entries)
- {
- if (snapshot.size() == 0)
- {
- entries.add(entry);
- return;
- }
-
- // Add the entry if if matches at least one filter
- for (LogEntryFilter filter : snapshot)
- {
- if (match(filter, entry))
- {
- entries.add(entry);
- break;
- }
- }
- }
- }
-
- private boolean match(LogEntryFilter filter, LogEntry entry)
- {
- boolean match = entry.getLevel() <= filter.getLevel();
-
- if (match && filter.getBundleRegex() != null)
- {
- String entryBnd = entry.getBundle().getSymbolicName();
- String filterRegex = filter.getBundleRegex();
- match = entryBnd.matches(filterRegex);
- }
-
- if (match && filter.getMessageRegex() != null)
- {
- String entryMsg = entry.getMessage();
- String filterRegex = filter.getMessageRegex();
- match = entryMsg.matches(filterRegex);
- }
-
- return match;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryFilter.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryFilter.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/LogEntryFilter.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.logging;
-
-//$Id$
-
-
-/**
- * A LogEntry filter that can be used with the LogEntryCache
- *
- * @author thomas.diesler at jboss.com
- * @since 09-Apr-2009
- */
-public class LogEntryFilter
-{
- private int level;
- private String bndRegex;
- private String msgRegex;
-
- /**
- * Create a LogEntryFilter with the associated criteria.
- *
- * @param bndRegex A regex that matches a Bundle's SymbolicName
- * @param level The maximum log level accepted by this filter
- * @param msgRegex A regex that matches the log message
- */
- public LogEntryFilter(String bndRegex, int level, String msgRegex)
- {
- this.bndRegex = bndRegex;
- this.msgRegex = msgRegex;
- this.level = level < 1 ? Integer.MAX_VALUE : level;
- }
-
- /**
- * Create a LogEntryFilter with the associated criteria.
- *
- * @param bndRegex A regex that matches a Bundle's SymbolicName
- * @param level The maximum log level accepted by this filter
- */
- public LogEntryFilter(String bndRegex, int level)
- {
- this(bndRegex, level, null);
- }
-
- /**
- * Create a LogEntryFilter with the associated criteria.
- *
- * @param bndRegex A regex that matches a Bundle's SymbolicName
- */
- public LogEntryFilter(String bndRegex)
- {
- this(bndRegex, Integer.MAX_VALUE, null);
- }
-
- /**
- * Get the Bundle Symbolic-Name regex.
- */
- public String getBundleRegex()
- {
- return bndRegex;
- }
-
- /**
- * Get the log message regex.
- */
- public String getMessageRegex()
- {
- return msgRegex;
- }
-
- /**
- * Get the log entry maximum log level.
- */
- public int getLevel()
- {
- return level;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.logging;
-
-//$Id$
-
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogReaderService;
-
-/**
- * An extension of the {@link LogReaderService} that can be setup
- * to receive remote {@link LogEntry} objects.
- *
- * @author thomas.diesler at jboss.com
- * @since 12-Apr-2009
- */
-public interface RemoteLogReaderService extends LogReaderService
-{
- /** Property to set to 'true' on the sending side: 'org.jboss.osgi.service.remote.log.sender' */
- String REMOTE_LOG_SENDER = "org.jboss.osgi.service.remote.log.sender";
-
- /** Property to set to 'true' on the receiving side: 'org.jboss.osgi.service.remote.log.reader' */
- String REMOTE_LOG_READER = "org.jboss.osgi.service.remote.log.reader";
-
- /** Property to set the receiving host: 'org.jboss.osgi.service.remote.log.host' */
- String REMOTE_LOG_HOST = "org.jboss.osgi.service.remote.log.host";
-
- /** Property to set the receiving port: 'org.jboss.osgi.service.remote.log.port' */
- String REMOTE_LOG_PORT = "org.jboss.osgi.service.remote.log.port";
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -26,7 +26,6 @@
import javax.naming.NamingException;
import org.jboss.osgi.spi.capability.Capability;
-import org.jboss.osgi.spi.logging.LogEntryCache;
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.service.packageadmin.PackageAdmin;
@@ -96,16 +95,6 @@
OSGiServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException;
/**
- * Start log entry tracking for this {@link OSGiRuntime}
- */
- void startLogEntryTracking(LogEntryCache logEntryCache);
-
- /**
- * Stop log entry tracking for this {@link OSGiRuntime}
- */
- void stopLogEntryTracking();
-
- /**
* Get the initial naming context for this {@link OSGiRuntime}
*/
InitialContext getInitialContext() throws NamingException;
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -35,8 +35,6 @@
import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.spi.framework.OSGiFramework;
-import org.jboss.osgi.spi.logging.LogEntryCache;
import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
@@ -48,9 +46,8 @@
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogReaderService;
+import org.osgi.framework.launch.Framework;
import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.util.tracker.ServiceTracker;
/**
* An embedded implementation of the {@link OSGiRuntime}
@@ -125,37 +122,36 @@
super.addCapability(capability);
}
- public void startLogEntryTracking(final LogEntryCache logEntryCache)
- {
- super.startLogEntryTracking(logEntryCache);
-
- // Track the LogReaderService to add the LogEntryCache as LogListener
- ServiceTracker tracker = new ServiceTracker(getBundleContext(), LogReaderService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference sref)
- {
- LogReaderService logReaderService = (LogReaderService)super.addingService(sref);
- logReaderService.addLogListener(logEntryCache);
- setLogReaderService(logReaderService);
- return logReaderService;
- }
- };
- tracker.open();
- }
-
@Override
public void shutdown()
{
super.shutdown();
OSGiBootstrapProvider bootProvider = getTestHelper().getBootstrapProvider();
- bootProvider.getFramework().stop();
+ try
+ {
+ bootProvider.getFramework().stop();
+ }
+ catch (BundleException ex)
+ {
+ log.error("Cannot stop the framework", ex);
+ }
}
public BundleContext getBundleContext()
{
OSGiBootstrapProvider bootProvider = getTestHelper().getBootstrapProvider();
- OSGiFramework framework = bootProvider.getFramework();
+ Framework framework = bootProvider.getFramework();
+ if (framework.getState() != Bundle.ACTIVE)
+ {
+ try
+ {
+ framework.start();
+ }
+ catch (BundleException ex)
+ {
+ throw new IllegalStateException("Cannot start framework", ex);
+ }
+ }
return framework.getBundleContext();
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -41,7 +41,6 @@
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.capability.Capability;
-import org.jboss.osgi.spi.logging.LogEntryCache;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiServiceReference;
@@ -49,7 +48,6 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
-import org.osgi.service.log.LogReaderService;
/**
* An abstract implementation of the {@link OSGiRuntime}
@@ -65,10 +63,7 @@
private OSGiTestHelper helper;
private Map<String, OSGiBundle> bundles = new LinkedHashMap<String, OSGiBundle>();
private List<Capability> capabilities = new ArrayList<Capability>();
- private LogReaderService logReaderService;
- private LogEntryCache logEntryCache;
-
public OSGiRuntimeImpl(OSGiTestHelper helper)
{
this.helper = helper;
@@ -79,16 +74,6 @@
return helper;
}
- protected void setLogReaderService(LogReaderService logReaderService)
- {
- this.logReaderService = logReaderService;
- }
-
- protected LogReaderService getLogReaderService()
- {
- return logReaderService;
- }
-
public void addCapability(Capability capability) throws BundleException
{
// Add dependent capabilies
@@ -143,27 +128,10 @@
removeCapability(dependency);
}
- public void startLogEntryTracking(LogEntryCache logEntryCache)
- {
- this.logEntryCache = logEntryCache;
- }
-
- public void stopLogEntryTracking()
- {
- if (logReaderService != null && logEntryCache != null)
- {
- logReaderService.removeLogListener(logEntryCache);
- logReaderService = null;
- logEntryCache = null;
- }
- }
-
public void shutdown()
{
log.debug("Start Shutdown");
- stopLogEntryTracking();
-
// Uninstall the registered bundles
ArrayList<String> locations = new ArrayList<String>(bundles.keySet());
Collections.reverse(locations);
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -35,8 +35,6 @@
import javax.naming.NamingException;
import org.jboss.osgi.spi.capability.Capability;
-import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.logging.RemoteLogReaderService;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
@@ -48,12 +46,8 @@
import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.osgi.spi.util.BundleDeploymentFactory;
-import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogReaderService;
-import org.osgi.util.tracker.ServiceTracker;
/**
* A remote implementation of the {@link OSGiRuntime}
@@ -66,10 +60,6 @@
private MBeanServerConnection mbeanServer;
private ManagedFrameworkMBean managedFramework;
- // Needed for remote logging
- private EmbeddedRuntime embeddedRuntime;
- private RemoteLogCapability remoteLogCapability;
-
public RemoteRuntime(OSGiTestHelper helper)
{
super(helper);
@@ -180,57 +170,6 @@
return srefs;
}
- public void startLogEntryTracking(final LogEntryCache logEntryCache)
- {
- super.startLogEntryTracking(logEntryCache);
-
- try
- {
- remoteLogCapability = new RemoteLogCapability();
- addCapability(remoteLogCapability);
-
- embeddedRuntime = (EmbeddedRuntime)getTestHelper().getEmbeddedRuntime();
- embeddedRuntime.addCapability(remoteLogCapability);
-
- // Track the RemoteLogReaderService to add the LogEntryCache as LogListener
- BundleContext context = embeddedRuntime.getBundleContext();
- ServiceTracker tracker = new ServiceTracker(context, RemoteLogReaderService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference sref)
- {
- LogReaderService logReaderService = (LogReaderService)super.addingService(sref);
- logReaderService.addLogListener(logEntryCache);
- setLogReaderService(logReaderService);
- return logReaderService;
- }
- };
- tracker.open();
- }
- catch (BundleException ex)
- {
- throw new IllegalStateException("Cannot start log entry tracking", ex);
- }
- }
-
- @Override
- public void stopLogEntryTracking()
- {
- if (remoteLogCapability != null)
- {
- removeCapability(remoteLogCapability);
- remoteLogCapability = null;
- }
-
- if (embeddedRuntime != null)
- {
- embeddedRuntime.shutdown();
- embeddedRuntime = null;
- }
-
- super.stopLogEntryTracking();
- }
-
public MBeanServerConnection getMBeanServer()
{
if (mbeanServer == null)
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/OSGiConstantsHelper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/OSGiConstantsHelper.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/OSGiConstantsHelper.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -25,7 +25,6 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleEvent;
-import org.osgi.service.log.LogService;
/**
* String representation for common OSGi Constants
@@ -86,23 +85,27 @@
}
/**
- * Return the string representation of a {@link LogService} level
+ * Return the string representation of a LogService level
*/
public static String logLevel(int level)
{
String logLevel = "[" + level + "]";
switch (level)
{
- case LogService.LOG_DEBUG:
+ // LogService.LOG_DEBUG:
+ case 0x4:
logLevel = "DEBUG";
break;
- case LogService.LOG_INFO:
+ // LogService.LOG_INFO:
+ case 0x3:
logLevel = "INFO";
break;
- case LogService.LOG_WARNING:
+ // LogService.LOG_WARNING:
+ case 0x2:
logLevel = "WARN";
break;
- case LogService.LOG_ERROR:
+ // LogService.LOG_ERROR
+ case 0x1:
logLevel = "ERROR";
break;
}
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -37,14 +37,14 @@
<!-- Properties -->
<properties>
<version.apache.felix.configadmin>1.0.10</version.apache.felix.configadmin>
- <version.apache.felix.core>1.2.0</version.apache.felix.core>
+ <version.apache.felix.core>1.3.0-SNAPSHOT</version.apache.felix.core>
<version.apache.felix.http.jetty>1.0.1</version.apache.felix.http.jetty>
<version.apache.felix.log>1.0.0</version.apache.felix.log>
<version.apache.felix.metatype>1.0.2</version.apache.felix.metatype>
<version.izpack>4.3.1</version.izpack>
<version.jboss.osgi.apache.xerces>2.9.1.SP1</version.jboss.osgi.apache.xerces>
<version.jboss.osgi.blueprint>1.0.0.Beta1</version.jboss.osgi.blueprint>
- <version.jboss.osgi.common>1.0.0</version.jboss.osgi.common>
+ <version.jboss.osgi.common>1.0.1-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.11.SP1</version.jboss.osgi.common.core>
<version.jboss.osgi.hotdeploy>1.0.0</version.jboss.osgi.hotdeploy>
<version.jboss.osgi.husky>1.0.0</version.jboss.osgi.husky>
@@ -52,16 +52,15 @@
<version.jboss.osgi.jmx>1.0.0</version.jboss.osgi.jmx>
<version.jboss.osgi.jndi>1.0.0</version.jboss.osgi.jndi>
<version.jboss.osgi.microcontainer>1.0.0</version.jboss.osgi.microcontainer>
- <version.jboss.osgi.remotelog>1.0.0</version.jboss.osgi.remotelog>
<version.jboss.osgi.runtime.deployers>1.0.0</version.jboss.osgi.runtime.deployers>
- <version.jboss.osgi.runtime.equinox>1.0.0</version.jboss.osgi.runtime.equinox>
- <version.jboss.osgi.runtime.felix>1.0.0</version.jboss.osgi.runtime.felix>
+ <version.jboss.osgi.runtime.equinox>3.5-SNAPSHOT</version.jboss.osgi.runtime.equinox>
+ <version.jboss.osgi.runtime.felix>1.9.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.runtime.jbossas>1.0.0</version.jboss.osgi.runtime.jbossas>
<version.jboss.osgi.runtime.knopflerfish>1.0.0</version.jboss.osgi.runtime.knopflerfish>
- <version.jboss.osgi.spi>1.0.0</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.1-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.webconsole>1.0.0</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.1</version.jboss.osgi.xml.binding>
- <version.osgi>r4v41</version.osgi>
+ <version.osgi>r4v42-20090728</version.osgi>
</properties>
<!-- Repositories -->
Modified: projects/jboss-osgi/trunk/reactor/blueprint/impl/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/impl/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/reactor/blueprint/impl/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -45,7 +45,6 @@
<artifactId>org.osgi.compendium</artifactId>
<scope>provided</scope>
</dependency>
-
</dependencies>
<!-- Build -->
@@ -103,7 +102,7 @@
<artifacts>
<artifact>
<!-- For some reason the distribution javadoc module needs this -->
- <file>target/jboss-osgi-blueprint-${version}-sources.jar</file>
+ <file>target/${artifactId}-${version}-sources.jar</file>
<classifier>sources</classifier>
<type>jar</type>
</artifact>
@@ -125,16 +124,6 @@
<excludePackageNames>org.jboss.osgi.*</excludePackageNames>
</configuration>
</plugin>
- <!--
- <plugin>
- <groupId>xsddoc</groupId>
- <artifactId>maven-xsddoc-plugin</artifactId>
- <configuration>
- <maven.xsddoc.src>src/main/resources/schema</maven.xsddoc.src>
- <maven.xsddoc.include>blueprint.xsd</maven.xsddoc.include>
- </configuration>
- </plugin>
- -->
</plugins>
</reporting>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -35,8 +35,8 @@
<version.jboss.osgi.common.core>2.2.11.SP1</version.jboss.osgi.common.core>
<version.jboss.osgi.husky>1.0.0</version.jboss.osgi.husky>
<version.jboss.osgi.microcontainer>1.0.0</version.jboss.osgi.microcontainer>
- <version.jboss.osgi.runtime.felix>1.0.0</version.jboss.osgi.runtime.felix>
- <version.osgi>r4v41</version.osgi>
+ <version.jboss.osgi.runtime.felix>1.9.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
+ <version.osgi>r4v42-20090728</version.osgi>
</properties>
<!-- Modules -->
Property changes on: projects/jboss-osgi/trunk/reactor/bundles
___________________________________________________________________
Name: svn:externals
+ common https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/common/trunk
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -14,30 +14,47 @@
<!--
The reactor is used to pull in external subprojects and build them as part of this maven reactor build. It is a one-stop entry point to build, test and deploy
- dependent SNAPSHOTs. To pull in a particular subproject, set one or more of these svn:external definitions spi
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/spi/trunk bundles/apache-xerces
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/apache-xerces/trunk bundles/common
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/common/trunk bundles/hotdeploy
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/hotdeploy/trunk bundles/husky
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/husky/trunk bundles/jaxb
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/jaxb/trunk bundles/jmx
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/jmx/trunk bundles/jndi
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/jndi/trunk bundles/jboss-common-core
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/jboss-common-core/trunk bundles/jboss-xml-binding
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk bundles/microcontainer
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/microcontainer/trunk bundles/remotelog
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/remotelog/trunk bundles/webconsole
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/webconsole/trunk runtime/deployers
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/deployers/trunk runtime/equinox
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/equinox/trunk runtime/felix
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/felix/trunk runtime/jbossas
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/jbossas/trunk runtime/knopflerfish
- https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/knopflerfish/trunk and enable the associated maven module <module>spi</module>
- <module>runtime/equinox</module> <module>runtime/felix</module> <module>runtime/knopflerfish</module> <module>runtime/deployers</module>
- <module>bundles/common</module> <module>bundles/jboss-common-core</module> <module>bundles/apache-xerces</module> <module>bundles/jaxb</module>
- <module>bundles/jboss-xml-binding</module> <module>bundles/jndi</module> <module>bundles/jmx</module> <module>bundles/remotelog</module>
- <module>bundles/webconsole</module> <module>bundles/hotdeploy</module> <module>bundles/microcontainer</module> <module>bundles/husky</module>
- <module>runtime/jbossas</module> A release MUST NOT contain any svn:external definitions.
+ dependent SNAPSHOTs. To pull in a particular subproject, set one or more of these svn:external definitions
+
+ spi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/spi/trunk
+ bundles/apache-xerces https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/apache-xerces/trunk
+ bundles/common https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/common/trunk
+ bundles/hotdeploy https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/hotdeploy/trunk
+ bundles/husky https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/husky/trunk
+ bundles/jaxb https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/jaxb/trunk
+ bundles/jmx https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/jmx/trunk
+ bundles/jndi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/jndi/trunk
+ bundles/jboss-common-core https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/jboss-common-core/trunk
+ bundles/jboss-xml-binding https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk
+ bundles/microcontainer https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/microcontainer/trunk
+ bundles/remotelog https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/remotelog/trunk
+ bundles/webconsole https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/webconsole/trunk
+ runtime/deployers https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/deployers/trunk
+ runtime/equinox https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/equinox/trunk
+ runtime/felix https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/felix/trunk
+ runtime/jbossas https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/jbossas/trunk
+ runtime/knopflerfish https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/knopflerfish/trunk and enable the associated maven module
+
+ <module>spi</module>
+ <module>runtime/equinox</module>
+ <module>runtime/felix</module>
+ <module>runtime/knopflerfish</module>
+ <module>runtime/deployers</module>
+ <module>bundles/common</module>
+ <module>bundles/jboss-common-core</module>
+ <module>bundles/apache-xerces</module>
+ <module>bundles/jaxb</module>
+ <module>bundles/jboss-xml-binding</module>
+ <module>bundles/jndi</module>
+ <module>bundles/jmx</module>
+ <module>bundles/remotelog</module>
+ <module>bundles/webconsole</module>
+ <module>bundles/hotdeploy</module>
+ <module>bundles/microcontainer</module>
+ <module>bundles/husky</module>
+ <module>runtime/jbossas</module>
+
+ A release MUST NOT contain any svn:external definitions.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -59,6 +76,7 @@
<module>spi</module>
<module>runtime/equinox</module>
<module>runtime/felix</module>
+ <module>bundles/common</module>
<module>blueprint</module>
</modules>
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -54,9 +54,6 @@
<!-- jndi -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-jndi.jar" files="${tests.resources.dir}/jndi/example-jndi.bnd" />
- <!-- log -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-log.jar" files="${tests.resources.dir}/log/example-log.bnd" />
-
<!-- mcservice -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-mcservice-bundleA.jar" files="${tests.resources.dir}/mcservice/example-mcservice-bundleA.bnd" />
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-mcservice-bundleB.jar" files="${tests.resources.dir}/mcservice/example-mcservice-bundleB.bnd" />
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -24,13 +24,12 @@
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
- <include>*:jboss-osgi-remotelog:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
<include>*:org.apache.felix.configadmin:jar</include>
<include>*:org.apache.felix.http.jetty:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.apache.felix.metatype:jar</include>
- <include>org.osgi:org.osgi.compendium:jar</include>
+ <include>*:org.osgi.compendium:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
<scope>provided</scope>
Deleted: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.example.log;
-
-//$Id: LogServiceTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler at jboss.com $
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.List;
-
-import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.logging.LogEntryFilter;
-import org.jboss.osgi.spi.testing.OSGiBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.OSGiTestHelper;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogService;
-
-/**
- * This example demonstrates the usage of the {@link LogService}
- *
- * @author thomas.diesler at jboss.com
- * @since 09-Apr-2009
- */
-public class LogServiceTestCase extends OSGiTest
-{
- private static LogEntryCache logEntryCache;
- private static OSGiRuntime runtime;
-
- @BeforeClass
- public static void setUpClass() throws Exception
- {
- runtime = new OSGiTestHelper().getDefaultRuntime();
- logEntryCache = new LogEntryCache(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
- runtime.startLogEntryTracking(logEntryCache);
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception
- {
- logEntryCache.clear();
- runtime.shutdown();
- }
-
- @Test
- public void testLogEntryFilter() throws Exception
- {
- // Install and start the test bundle
- OSGiBundle bundleA = runtime.installBundle("example-log.jar");
- bundleA.start();
-
- // Verify that the bundle is active
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundleA.getState());
-
- // Wait a little for the asynchronous log entry to arrive
- Thread.sleep(200);
-
- // Uninstall the test bundle
- bundleA.uninstall();
-
- // Verify the received log entries
- List<LogEntry> entries = logEntryCache.getLog();
- assertEquals("Number of entries", 1, entries.size());
- assertEquals("[ServiceA] new Service", entries.get(0).getMessage());
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-07-29 12:14:37 UTC (rev 91762)
@@ -4,15 +4,15 @@
# $Id$
#
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
-
# Properties to configure the Framework
org.osgi.framework.storage=${basedir}/target/osgi-store
org.osgi.framework.storage.clean=onFirstInit
+# An instance of Logger that the framework uses as its default logger
+felix.log.logger.instance=org.jboss.osgi.felix.FelixLogger
+
# Framework bootdelegation
-org.osgi.framework.bootdelegation=org.osgi.service.log
+# org.osgi.framework.bootdelegation=org.osgi.service.log
# Extra System Packages
org.osgi.framework.system.packages.extra=\
@@ -31,7 +31,7 @@
org.jboss.virtual.plugins.context.jar, \
org.jboss.virtual.plugins.vfs.helpers, \
org.jboss.virtual.protocol, \
- org.osgi.framework;version=1.4
+ org.osgi.framework;version=1.5
# Bundles that need to be installed with the Framework automatically
org.jboss.osgi.spi.framework.autoInstall=\
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -23,13 +23,12 @@
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
- <include>*:jboss-osgi-remotelog:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
<include>*:org.apache.felix.configadmin:jar</include>
<include>*:org.apache.felix.http.jetty:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.apache.felix.metatype:jar</include>
- <include>org.osgi:org.osgi.compendium:jar</include>
+ <include>*:org.osgi.compendium:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java 2009-07-29 12:14:37 UTC (rev 91762)
@@ -29,10 +29,9 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.junit.Test;
-import org.osgi.framework.Bundle;
+import org.osgi.framework.launch.Framework;
/**
* Test the embedded bootstrap of the framework
@@ -46,13 +45,11 @@
public void testFrameworkBootstrap() throws Exception
{
OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
- OSGiFramework framework = bootProvider.getFramework();
+ Framework framework = bootProvider.getFramework();
assertNotNull("Framework not null", framework);
- Bundle bundle = framework.getBundle();
-
- assertEquals("BundleId == 0", 0, bundle.getBundleId());
- assertNotNull("SymbolicName not null", bundle.getSymbolicName());
+ assertEquals("BundleId == 0", 0, framework.getBundleId());
+ assertNotNull("SymbolicName not null", framework.getSymbolicName());
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -96,25 +96,11 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-remotelog</artifactId>
- <version>${version.jboss.osgi.remotelog}</version>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version.jboss.osgi.common}</version>
<scope>provided</scope>
</dependency>
- <!-- OSGi Dependencies -->
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>${version.osgi}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <version>${version.osgi}</version>
- <scope>provided</scope>
- </dependency>
-
<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
@@ -160,8 +146,9 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>org.osgi.compendium</artifactId>
<version>${version.apache.felix.core}</version>
+ <scope>provided</scope>
</dependency>
</dependencies>
</profile>
@@ -186,8 +173,9 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>org.osgi.compendium</artifactId>
<version>${version.apache.felix.core}</version>
+ <scope>provided</scope>
</dependency>
</dependencies>
</profile>
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-bundles.xml 2009-07-29 06:27:26 UTC (rev 91761)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-bundles.xml 2009-07-29 12:14:37 UTC (rev 91762)
@@ -23,13 +23,12 @@
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
- <include>*:jboss-osgi-remotelog:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
<include>*:org.apache.felix.configadmin:jar</include>
<include>*:org.apache.felix.http.jetty:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.apache.felix.metatype:jar</include>
- <include>org.osgi:org.osgi.compendium:jar</include>
+ <include>*:org.osgi.compendium:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
<scope>provided</scope>
More information about the jboss-osgi-commits
mailing list