From 0c8e77add501bf9f895be7b1129c8826ad490cf5 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Fri, 22 Mar 2013 15:22:36 +0000 Subject: [PATCH] Use new Commons features git-svn-id: https://svn.argeo.org/slc/trunk@6206 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../META-INF/spring/osgi.xml | 11 +++++- .../META-INF/spring/repo-osgi.xml | 11 +++++- .../slc/osgi/deploy/OsgiModuleLabel.java | 38 ------------------- 3 files changed, 20 insertions(+), 40 deletions(-) delete mode 100644 runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/deploy/OsgiModuleLabel.java diff --git a/modules/org.argeo.slc.agent/META-INF/spring/osgi.xml b/modules/org.argeo.slc.agent/META-INF/spring/osgi.xml index ad4281624..f22371189 100644 --- a/modules/org.argeo.slc.agent/META-INF/spring/osgi.xml +++ b/modules/org.argeo.slc.agent/META-INF/spring/osgi.xml @@ -37,7 +37,16 @@ - + + + + + + + + + \ No newline at end of file diff --git a/modules/org.argeo.slc.server.repo/META-INF/spring/repo-osgi.xml b/modules/org.argeo.slc.server.repo/META-INF/spring/repo-osgi.xml index cc3cbdbf3..fc2362c89 100644 --- a/modules/org.argeo.slc.server.repo/META-INF/spring/repo-osgi.xml +++ b/modules/org.argeo.slc.server.repo/META-INF/spring/repo-osgi.xml @@ -37,9 +37,18 @@ - + + + + + + + + + diff --git a/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/deploy/OsgiModuleLabel.java b/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/deploy/OsgiModuleLabel.java deleted file mode 100644 index 5da8b96c8..000000000 --- a/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/deploy/OsgiModuleLabel.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.argeo.slc.osgi.deploy; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; - -/** Logs the version of an OSGi bundle. */ -public class OsgiModuleLabel { - private final static Log log = LogFactory.getLog(OsgiModuleLabel.class); - - private Bundle bundle; - - public OsgiModuleLabel() { - } - - /** Sets without logging. */ - public OsgiModuleLabel(Bundle bundle) { - this.bundle = bundle; - } - - /** - * Retrieved bundle from a bundle context and logs it. Typically to be set - * as a Spring bean. - */ - public void setBundleContext(BundleContext bundleContext) { - this.bundle = bundleContext.getBundle(); - log.info(msg()); - } - - public String msg() { - String name = bundle.getHeaders().get(Constants.BUNDLE_NAME).toString(); - String symbolicName = bundle.getSymbolicName(); - String version = bundle.getVersion().toString(); - return name + " v" + version + " (" + symbolicName + ")"; - } -} -- 2.39.2