]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - legacy/argeo-commons/org.argeo.cms.ui.workbench/src/org/argeo/cms/spring/osgi/OsgiModuleLabel.java
Remove legacy
[gpl/argeo-slc.git] / legacy / argeo-commons / org.argeo.cms.ui.workbench / src / org / argeo / cms / spring / osgi / OsgiModuleLabel.java
diff --git a/legacy/argeo-commons/org.argeo.cms.ui.workbench/src/org/argeo/cms/spring/osgi/OsgiModuleLabel.java b/legacy/argeo-commons/org.argeo.cms.ui.workbench/src/org/argeo/cms/spring/osgi/OsgiModuleLabel.java
deleted file mode 100644 (file)
index e10ea06..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.argeo.cms.spring.osgi;
-
-import org.argeo.api.cms.CmsLog;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-
-/**
- * Logs the name and version of an OSGi bundle based on its
- * {@link BundleContext}.
- */
-public class OsgiModuleLabel {
-       private final static CmsLog log = CmsLog.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 + ")";
-       }
-}