JBoss-OSGI SVN: r94640 - projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/resources/META-INF.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-10 11:15:43 -0400 (Sat, 10 Oct 2009)
New Revision: 94640
Modified:
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/resources/META-INF/base-deployers-beans.xml
Log:
Add WARStructureDeployer
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/resources/META-INF/base-deployers-beans.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/resources/META-INF/base-deployers-beans.xml 2009-10-10 15:09:32 UTC (rev 94639)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/resources/META-INF/base-deployers-beans.xml 2009-10-10 15:15:43 UTC (rev 94640)
@@ -41,28 +41,13 @@
</bean>
<!-- JAR Structure -->
- <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure">
- <!-- Unless specified the default list of suffixes is .jar -->
- <constructor>
- <parameter>
- <set elementClass="java.lang.String">
- <value>.jar</value>
- </set>
- </parameter>
- </constructor>
- </bean>
+ <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure"/>
+ <!-- WAR Structure -->
+ <bean name="WARStructure" class="org.jboss.deployers.vfs.plugins.structure.war.WARStructure"/>
+
<!-- File Structure -->
- <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure">
- <!-- Unless specified the default list of suffixes is -beans.xml -->
- <constructor>
- <parameter>
- <set elementClass="java.lang.String">
- <value>-beans.xml</value>
- </set>
- </parameter>
- </constructor>
- </bean>
+ <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure"/>
<!-- POJO Deployment -->
16 years, 9 months
JBoss-OSGI SVN: r94639 - in projects/jboss-osgi/projects/bundles/hotdeploy/trunk: src/main/java/org/jboss/osgi/hotdeploy/internal and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-10 11:09:32 -0400 (Sat, 10 Oct 2009)
New Revision: 94639
Modified:
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java
Log:
Optimize call to deployer delegate for empty set
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml 2009-10-10 14:15:46 UTC (rev 94638)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml 2009-10-10 15:09:32 UTC (rev 94639)
@@ -27,12 +27,12 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.2</version>
+ <version>1.0.3-SNAPSHOT</version>
</parent>
<!-- Properties -->
<properties>
- <version.jboss.osgi.common>1.0.1</version.jboss.osgi.common>
+ <version.jboss.osgi.common>1.0.2-SNAPSHOT</version.jboss.osgi.common>
<version.osgi>r4v42</version.osgi>
</properties>
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java 2009-10-10 14:15:46 UTC (rev 94638)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java 2009-10-10 15:09:32 UTC (rev 94639)
@@ -230,15 +230,18 @@
logBundleDeployments("NEW diff", diff);
// Deploy the bundles through the DeployerService
- try
+ if (diff.size() > 0)
{
- BundleDeployment[] depArr = diff.toArray(new BundleDeployment[diff.size()]);
- deployer.deploy(depArr);
+ try
+ {
+ BundleDeployment[] depArr = diff.toArray(new BundleDeployment[diff.size()]);
+ deployer.deploy(depArr);
+ }
+ catch (Exception ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot deploy bundles", ex);
+ }
}
- catch (Exception ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot deploy bundles", ex);
- }
return diff.size();
}
16 years, 9 months
JBoss-OSGI SVN: r94637 - in projects/jboss-osgi/trunk/testsuite/example: src/test/java/org/jboss/test/osgi/example/webapp and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-10 02:24:45 -0400 (Sat, 10 Oct 2009)
New Revision: 94637
Modified:
projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppTestCase.java
Log:
Use example-webapp.war instead of *.jar
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-10-10 05:39:45 UTC (rev 94636)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-10-10 06:24:45 UTC (rev 94637)
@@ -62,7 +62,7 @@
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-simple-husky.jar" files="${tests.resources.dir}/simple/example-simple-husky.bnd" />
<!-- webapp -->
- <war destfile="${tests.output.dir}/test-libs/example-webapp.jar"
+ <war destfile="${tests.output.dir}/test-libs/example-webapp.war"
manifest="${tests.resources.dir}/webapp/MANIFEST.MF"
webxml="${tests.resources.dir}/webapp/web.xml">
<classes dir="${tests.classes.dir}">
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppTestCase.java 2009-10-10 05:39:45 UTC (rev 94636)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppTestCase.java 2009-10-10 06:24:45 UTC (rev 94637)
@@ -54,7 +54,7 @@
runtime = new OSGiTestHelper().getDefaultRuntime();
runtime.addCapability(new WebAppCapability());
- OSGiBundle bundle = runtime.installBundle("example-webapp.jar");
+ OSGiBundle bundle = runtime.installBundle("example-webapp.war");
bundle.start();
}
16 years, 9 months
JBoss-OSGI SVN: r94618 - projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-09 15:32:24 -0400 (Fri, 09 Oct 2009)
New Revision: 94618
Modified:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java
Log:
[JBOSGI-161] Cannot use commons-logging
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java 2009-10-09 17:57:17 UTC (rev 94617)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java 2009-10-09 19:32:24 UTC (rev 94618)
@@ -71,8 +71,9 @@
String loggerClass = log.getClass().getName();
List<String> expected = new ArrayList<String>();
+ expected.add("org.jboss.slf4j.JBossLoggerAdapter");
expected.add("org.slf4j.impl.Log4jLoggerAdapter");
- expected.add("org.jboss.slf4j.JBossLoggerAdapter");
+ expected.add("org.slf4j.impl.Slf4jLogger");
if (expected.contains(loggerClass) == false)
throw new IllegalStateException("Unexpected logger: " + loggerClass);
16 years, 9 months
JBoss-OSGI SVN: r94615 - projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-09 13:21:31 -0400 (Fri, 09 Oct 2009)
New Revision: 94615
Modified:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java
Log:
[JBOSGI-161] Cannot use commons-logging
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java 2009-10-09 16:52:58 UTC (rev 94614)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java 2009-10-09 17:21:31 UTC (rev 94615)
@@ -72,6 +72,7 @@
List<String> expected = new ArrayList<String>();
expected.add("org.slf4j.impl.Log4jLoggerAdapter");
+ expected.add("org.jboss.slf4j.JBossLoggerAdapter");
if (expected.contains(loggerClass) == false)
throw new IllegalStateException("Unexpected logger: " + loggerClass);
16 years, 9 months
JBoss-OSGI SVN: r94612 - projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-09 12:30:52 -0400 (Fri, 09 Oct 2009)
New Revision: 94612
Modified:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java
Log:
Allow org.apache.commons.logging.impl.Log4JLogger
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java 2009-10-09 16:13:02 UTC (rev 94611)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java 2009-10-09 16:30:52 UTC (rev 94612)
@@ -23,6 +23,9 @@
// $Id:$
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleActivator;
@@ -48,7 +51,12 @@
Log log = LogFactory.getLog(OSGI161Activator.class);
String loggerClass = log.getClass().getName();
- if ("org.apache.commons.logging.impl.SLF4JLocationAwareLog".equals(loggerClass) == false)
+
+ List<String> expected = new ArrayList<String>();
+ expected.add("org.apache.commons.logging.impl.Log4JLogger");
+ expected.add("org.apache.commons.logging.impl.SLF4JLocationAwareLog");
+
+ if (expected.contains(loggerClass) == false)
throw new IllegalStateException("Unexpected logger: " + loggerClass);
log.info("*******************************************");
@@ -61,7 +69,11 @@
Logger log = LoggerFactory.getLogger(OSGI161Activator.class);
String loggerClass = log.getClass().getName();
- if ("org.slf4j.impl.Log4jLoggerAdapter".equals(loggerClass) == false)
+
+ List<String> expected = new ArrayList<String>();
+ expected.add("org.slf4j.impl.Log4jLoggerAdapter");
+
+ if (expected.contains(loggerClass) == false)
throw new IllegalStateException("Unexpected logger: " + loggerClass);
log.info("*******************************************");
16 years, 9 months
JBoss-OSGI SVN: r94606 - in projects/jboss-osgi/trunk: reactor/framework/src/main/java/org/jboss/osgi/framework/bundle and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-09 11:21:10 -0400 (Fri, 09 Oct 2009)
New Revision: 94606
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiSystemState.java
Log:
[JBOSGI-177] HttpService bundles need to import org.ops4j.pax.web.service
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-10-09 15:19:35 UTC (rev 94605)
+++ projects/jboss-osgi/trunk/pom.xml 2009-10-09 15:21:10 UTC (rev 94606)
@@ -58,7 +58,7 @@
<version.jboss.osgi.runtime.felix>2.0.0</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.runtime.jbossas>1.0.1</version.jboss.osgi.runtime.jbossas>
<version.jboss.osgi.spi>1.0.2-SNAPSHOT</version.jboss.osgi.spi>
- <version.jboss.osgi.webconsole>1.0.1</version.jboss.osgi.webconsole>
+ <version.jboss.osgi.webconsole>1.0.2-SNAPSHOT</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
<version.ops4j.pax.base>1.2.1</version.ops4j.pax.base>
<version.ops4j.pax.web>0.7.0</version.ops4j.pax.web>
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-10-09 15:19:35 UTC (rev 94605)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-10-09 15:21:10 UTC (rev 94606)
@@ -484,7 +484,6 @@
StringBuilder builder = new StringBuilder();
builder.append("Service{");
builder.append("id=").append(getServiceId());
- builder.append(" bundle=").append(getBundleState().getCanonicalName());
builder.append(" classes=").append(Arrays.asList(getClasses()));
builder.append("}");
return builder.toString();
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiSystemState.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiSystemState.java 2009-10-09 15:19:35 UTC (rev 94605)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiSystemState.java 2009-10-09 15:21:10 UTC (rev 94606)
@@ -25,10 +25,12 @@
import java.io.InputStream;
import java.net.URL;
import java.util.Enumeration;
+import java.util.Vector;
import org.jboss.logging.Logger;
import org.jboss.osgi.framework.metadata.OSGiMetaData;
import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
@@ -71,10 +73,32 @@
}
@SuppressWarnings("unchecked")
- public Enumeration findEntries(String path, String filePattern, boolean recurse)
+ public Enumeration<URL> findEntries(String path, String filePattern, boolean recurse)
{
log.warn("[JBOSGI-138] findEntries(" + path + "," + filePattern + "," + recurse + ")");
return null;
+
+ // [Bug-1472] Clarify the semantic of resource API when called on the system bundle
+ // https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1472
+ /*
+ Vector<URL> entryList = new Vector<URL>();
+ for (Bundle bundle : getBundleManager().getBundles())
+ {
+ if (bundle != this)
+ {
+ Enumeration<URL> bundleEntries = bundle.findEntries(path, filePattern, recurse);
+ if (bundleEntries != null)
+ {
+ while(bundleEntries.hasMoreElements())
+ {
+ URL next = bundleEntries.nextElement();
+ entryList.add(next);
+ }
+ }
+ }
+ }
+ return (entryList.size() > 0 ? entryList.elements() : null);
+ */
}
public URL getEntry(String path)
16 years, 9 months
JBoss-OSGI SVN: r94605 - projects/jboss-osgi/projects/bundles/webconsole/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-09 11:19:35 -0400 (Fri, 09 Oct 2009)
New Revision: 94605
Modified:
projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml
Log:
[JBOSGI-177] HttpService bundles need to import org.ops4j.pax.web.service
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml 2009-10-09 14:55:56 UTC (rev 94604)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml 2009-10-09 15:19:35 UTC (rev 94605)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.2</version>
+ <version>1.0.3-SNAPSHOT</version>
</parent>
<!-- Properties -->
@@ -35,12 +35,12 @@
<version.commons.fileupload>1.1.1</version.commons.fileupload>
<version.commons.io>1.4</version.commons.io>
<version.felix.bundlerepository>1.0.3</version.felix.bundlerepository>
- <version.felix.osgi.core>1.4.0</version.felix.osgi.core>
<version.felix.scr>1.0.0</version.felix.scr>
<version.felix.webconsole>1.2.10</version.felix.webconsole>
<version.javax.servlet>2.4</version.javax.servlet>
- <version.jboss.osgi.spi>1.0.1</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.2-SNAPSHOT</version.jboss.osgi.spi>
<version.json>20070829</version.json>
+ <version.osgi>r4v42</version.osgi>
</properties>
<!-- Dependencies -->
@@ -73,12 +73,6 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <version>${version.felix.osgi.core}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.webconsole</artifactId>
<version>${version.felix.webconsole}</version>
<scope>provided</scope>
@@ -91,21 +85,47 @@
<scope>compile</scope>
<optional>true</optional>
</dependency>
-
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr</artifactId>
<version>${version.felix.scr}</version>
<scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
-
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.bundlerepository</artifactId>
<version>${version.felix.bundlerepository}</version>
<scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </exclusion>
+ </exclusions>
<optional>true</optional>
</dependency>
+
+ <!-- org.osgi -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>${version.osgi}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <version>${version.osgi}</version>
+ </dependency>
</dependencies>
<!-- Build -->
@@ -160,6 +180,10 @@
org.apache.felix.scr;
org.apache.felix.shell;
org.osgi.service.*;resolution:=optional,
+
+ <!-- FIXME https://jira.jboss.org/jira/browse/JBOSGI-177 -->
+ org.ops4j.pax.web.service;version=0.7,
+
javax.portlet;resolution:=optional,*
</Import-Package>
<Embed-Dependency>
16 years, 9 months
JBoss-OSGI SVN: r94598 - in projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org: jboss/osgi/common/internal and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-09 09:26:58 -0400 (Fri, 09 Oct 2009)
New Revision: 94598
Removed:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/apache/commons/logging/
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LoggingLogListener.java
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java
Log:
Ignore INFO message of type 'BundleEvent STARTING'
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java 2009-10-09 13:26:38 UTC (rev 94597)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java 2009-10-09 13:26:58 UTC (rev 94598)
@@ -54,7 +54,7 @@
public Object addingService(ServiceReference reference)
{
LogReaderService logReader = (LogReaderService)super.addingService(reference);
- logReader.addLogListener(new LoggingLogListener());
+ logReader.addLogListener(new LogListenerBridge());
return logReader;
}
};
Deleted: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LoggingLogListener.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LoggingLogListener.java 2009-10-09 13:26:38 UTC (rev 94597)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LoggingLogListener.java 2009-10-09 13:26:58 UTC (rev 94598)
@@ -1,62 +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 org.osgi.framework.Bundle;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogListener;
-import org.osgi.service.log.LogService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A LogListener that logs LogEntrys to SLF4J.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 04-Mar-2009
- */
-public class LoggingLogListener implements LogListener
-{
- public void logged(LogEntry entry)
- {
- Bundle bundle = entry.getBundle();
- int level = entry.getLevel();
- Throwable throwable = entry.getException();
-
- String loggerName = bundle.getSymbolicName();
- Logger log = LoggerFactory.getLogger(loggerName);
-
- if (level == LogService.LOG_DEBUG)
- log.debug(entry.getMessage(), throwable);
-
- else if (level == LogService.LOG_INFO)
- log.info(entry.getMessage(), throwable);
-
- else if (level == LogService.LOG_WARNING)
- log.warn(entry.getMessage(), throwable);
-
- else if (level == LogService.LOG_ERROR)
- log.error(entry.getMessage(), throwable);
- }
-}
\ No newline at end of file
16 years, 9 months
JBoss-OSGI SVN: r94597 - projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-09 09:26:38 -0400 (Fri, 09 Oct 2009)
New Revision: 94597
Added:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LogListenerBridge.java
Log:
Ignore INFO message of type 'BundleEvent STARTING'
Copied: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LogListenerBridge.java (from rev 94596, projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LoggingLogListener.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LogListenerBridge.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/LogListenerBridge.java 2009-10-09 13:26:38 UTC (rev 94597)
@@ -0,0 +1,71 @@
+/*
+ * 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 org.osgi.framework.Bundle;
+import org.osgi.service.log.LogEntry;
+import org.osgi.service.log.LogListener;
+import org.osgi.service.log.LogService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A LogListener that logs LogEntrys to SLF4J.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Mar-2009
+ */
+public class LogListenerBridge implements LogListener
+{
+ public void logged(LogEntry entry)
+ {
+ Bundle bundle = entry.getBundle();
+ int level = entry.getLevel();
+ Throwable throwable = entry.getException();
+
+ String loggerName = bundle.getSymbolicName();
+ Logger log = LoggerFactory.getLogger(loggerName);
+
+ String message = entry.getMessage();
+
+ if (level == LogService.LOG_DEBUG)
+ log.debug(message, throwable);
+
+ else if (level == LogService.LOG_INFO)
+ {
+ // Ignore INFO message of type 'BundleEvent STARTING'
+ String[] splitMessage = message.split("[\\s]");
+ if (throwable != null || splitMessage.length != 2 || splitMessage[0].endsWith("Event") == false)
+ {
+ log.info(message, throwable);
+ }
+ }
+
+ else if (level == LogService.LOG_WARNING)
+ log.warn(message, throwable);
+
+ else if (level == LogService.LOG_ERROR)
+ log.error(message, throwable);
+ }
+}
\ No newline at end of file
16 years, 9 months