Remove printer handler and printer manager interface, remove category support and use java 1.4 as the base
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1450134 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/inventory/pom.xml b/inventory/pom.xml
index 9a34cdc..fb113c9 100644
--- a/inventory/pom.xml
+++ b/inventory/pom.xml
@@ -42,6 +42,7 @@
<extensions>true</extensions>
<configuration>
<instructions>
+ <Package-Export>org.apache.felix.inventory;version=1.0.0</Package-Export>
<Bundle-Category>osgi</Bundle-Category>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
@@ -50,16 +51,6 @@
</instructions>
</configuration>
</plugin>
- <!--
- Configure default compilation for Java 5
- -->
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
</plugins>
</build>
diff --git a/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java b/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java
index 4683373..f1ad0f4 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java
@@ -66,12 +66,6 @@
String CONFIG_TITLE = "felix.inventory.printer.title"; //$NON-NLS-1$
/**
- * The category under which this printer is categorized.
- * This property is optional.
- */
- String CONFIG_CATEGORY = "felix.inventory.printer.category"; //$NON-NLS-1$
-
- /**
* Prints the configuration report to the given <code>printWriter</code>.
* Implementations are free to print whatever information they deem useful.
*
diff --git a/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinterManager.java b/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinterManager.java
deleted file mode 100644
index 16ba159..0000000
--- a/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinterManager.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.inventory;
-
-/**
- * The manager allows to access inventory printers.
- * Instead of directly returning a inventory printer, a inventory
- * printer handler is returned which provides access to the
- * meta information of the printer and other utility methods.
- */
-public interface InventoryPrinterManager {
-
- /**
- * Get all inventory printer handlers.
- * @return A list of handlers - might be empty.
- */
- InventoryPrinterHandler[] getAllHandlers();
-
- /**
- * Get all handlers supporting the mode.
- * @return A list of handlers - might be empty.
- */
- InventoryPrinterHandler[] getHandlers( final PrinterMode mode);
-
- /**
- * Return a handler for the unique name.
- * @return The corresponding handler or <code>null</code>.
- */
- InventoryPrinterHandler getHandler( final String name );
-}
diff --git a/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java b/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java
index 6324707..9dfe26e 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java
@@ -21,11 +21,69 @@
/**
* Enumeration for the different printer modes.
*/
-public enum PrinterMode {
+public final class PrinterMode {
- TEXT, // plain text
- HTML_BODY, // HTML which can be placed inside a HTML body element (no external references)
- JSON, // JSON output
- ZIP_FILE_TEXT, // file content for a zip
- ZIP_FILE_JSON // json file content for a zip
+ // plain text
+ public static PrinterMode TEXT = new PrinterMode("TEXT");
+
+ // HTML which can be placed inside a HTML body element (no external references)
+ public static PrinterMode HTML_BODY = new PrinterMode("HTML_BODY");
+
+ // JSON output
+ public static PrinterMode JSON = new PrinterMode("JSON");
+
+ // file content for a zip
+ public static PrinterMode ZIP_FILE_TEXT = new PrinterMode("ZIP_FILE_TEXT");
+
+ // json file content for a zip
+ public static PrinterMode ZIP_FILE_JSON = new PrinterMode("ZIP_FILE_JSON");
+
+ private final String mode;
+
+ private PrinterMode(final String mode) {
+ this.mode = mode;
+ }
+
+ public static PrinterMode valueOf(final String m) {
+ if ( TEXT.name().equals(m) ) {
+ return TEXT;
+ } else if ( HTML_BODY.equals(m) ) {
+ return HTML_BODY;
+ } else if ( JSON.equals(m) ) {
+ return JSON;
+ } else if ( ZIP_FILE_TEXT.equals(m) ) {
+ return ZIP_FILE_TEXT;
+ } else if ( ZIP_FILE_JSON.equals(m) ) {
+ return ZIP_FILE_JSON;
+ }
+ return null;
+ }
+
+ public String name() {
+ return this.mode;
+ }
+
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ return mode.hashCode();
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final PrinterMode other = (PrinterMode) obj;
+ return mode.equals(other.mode);
+ }
}
diff --git a/inventory/src/main/java/org/apache/felix/inventory/ZipAttachmentProvider.java b/inventory/src/main/java/org/apache/felix/inventory/ZipAttachmentProvider.java
index e1e0e2c..a90ad09 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/ZipAttachmentProvider.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/ZipAttachmentProvider.java
@@ -33,7 +33,7 @@
* should either support {@link PrinterMode.ZIP_FILE_JSON}
* or {@link PrinterMode.ZIP_FILE_TEXT}
*/
-public interface ZipAttachmentProvider extends InventoryPrinter {
+public interface ZipAttachmentProvider {
/**
* Add attachments to the zip output stream.
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java b/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
index 0553358..71de906 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
@@ -31,8 +31,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.felix.inventory.InventoryPrinterHandler;
-import org.apache.felix.inventory.InventoryPrinterManager;
import org.apache.felix.inventory.PrinterMode;
/**
@@ -43,13 +41,13 @@
private static final long serialVersionUID = 1L;
/** The inventory printer manager. */
- protected final InventoryPrinterManager inventoryPrinterManager;
+ protected final InventoryPrinterManagerImpl inventoryPrinterManager;
/**
* Constructor
* @param inventoryPrinterManager The manager
*/
- AbstractWebConsolePlugin(final InventoryPrinterManager inventoryPrinterManager) {
+ AbstractWebConsolePlugin(final InventoryPrinterManagerImpl inventoryPrinterManager) {
this.inventoryPrinterManager = inventoryPrinterManager;
}
@@ -60,8 +58,9 @@
final InventoryPrinterHandler handler )
throws IOException {
if ( handler == null ) {
- for(final InventoryPrinterHandler sph : this.inventoryPrinterManager.getHandlers(mode)) {
- pw.printInventory(mode, sph);
+ final InventoryPrinterHandler[] adapters = this.inventoryPrinterManager.getHandlers(mode);
+ for(int i = 0; i < adapters.length; i++) {
+ pw.printInventory(mode, adapters[i]);
}
} else {
if ( handler.supports(mode) ) {
@@ -89,7 +88,6 @@
response.setHeader("Pragma", "no-cache"); //$NON-NLS-1$ //$NON-NLS-2$
}
- @Override
protected void doGet(final HttpServletRequest request,
final HttpServletResponse response)
throws ServletException, IOException {
@@ -299,7 +297,6 @@
// IE has an issue with white-space:pre in our case so, we write
// <br/> instead of [CR]LF to get the line break. This also works
// in other browsers.
- @Override
public void println() {
if ( doFilter ) {
this.write('\n'); // write <br/>
@@ -311,7 +308,6 @@
// some VM implementation directly write in underlying stream, instead of
// delegation to the write() method. So we need to override this, to make
// sure, that everything is escaped correctly
- @Override
public void print(final String str) {
final char[] chars = str.toCharArray();
write(chars, 0, chars.length);
@@ -322,7 +318,6 @@
// always delegate to write(char[], int, int) otherwise in some VM
// it cause endless cycle and StackOverflowError
- @Override
public void write(final int character) {
synchronized (oneChar) {
oneChar[0] = (char) character;
@@ -332,7 +327,6 @@
// write the characters unmodified unless filtering is enabled in
// which case the writeFiltered(String) method is called for filtering
- @Override
public void write(char[] chars, int off, int len) {
if (doFilter) {
chars = this.escapeHtml(new String(chars, off, len)).toCharArray();
@@ -344,7 +338,6 @@
// write the string unmodified unless filtering is enabled in
// which case the writeFiltered(String) method is called for filtering
- @Override
public void write( final String string, final int off, final int len ) {
write(string.toCharArray(), off, len);
}
@@ -397,7 +390,6 @@
super( delegatee );
}
- @Override
protected void title( final String title ) throws IOException {
print( "*** " );
print( title );
@@ -405,7 +397,6 @@
}
- @Override
protected void end() throws IOException {
println();
}
@@ -433,7 +424,6 @@
{ new Integer( counter ), title } );
}
- @Override
protected void title( final String title ) throws IOException {
counter++;
@@ -443,14 +433,12 @@
zip.putNextEntry( entry );
}
- @Override
protected void end() throws IOException {
flush();
zip.closeEntry();
}
- @Override
public void printInventory(
final PrinterMode mode,
final InventoryPrinterHandler handler)
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java b/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java
index 959973c..14a1b57 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java
@@ -16,25 +16,17 @@
*/
package org.apache.felix.inventory.impl;
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.apache.felix.inventory.InventoryPrinterManager;
import org.apache.felix.inventory.impl.webconsole.WebConsoleAdapter;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceRegistration;
/**
- * Activate bridges and register manager.
+ * Activate bridges and internal manager.
*/
public class Activator implements BundleActivator {
private InventoryPrinterManagerImpl printerManager;
- private ServiceRegistration managerRegistration;
-
private WebConsoleAdapter webAdapter;
/**
@@ -43,22 +35,12 @@
public void start(final BundleContext context) throws Exception {
this.webAdapter = new WebConsoleAdapter(context);
this.printerManager = new InventoryPrinterManagerImpl(context);
- final Dictionary<String, Object> props = new Hashtable<String, Object>();
- props.put(Constants.SERVICE_DESCRIPTION, "Apache Felix Inventory Printer Manager");
- props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
- this.managerRegistration = context.registerService(
- InventoryPrinterManager.class.getName(),
- this.printerManager, props);
}
/**
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(final BundleContext context) throws Exception {
- if( this.managerRegistration != null ) {
- this.managerRegistration.unregister();
- this.managerRegistration = null;
- }
if ( this.printerManager != null ) {
this.printerManager.dispose();
this.printerManager = null;
@@ -68,5 +50,4 @@
this.webAdapter = null;
}
}
-
}
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/ClassUtils.java b/inventory/src/main/java/org/apache/felix/inventory/impl/ClassUtils.java
index de5bbcf..fca742b 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/ClassUtils.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/ClassUtils.java
@@ -27,7 +27,7 @@
* Search a method with the given name and signature.
* @return The method or <code>null</code> if not found.
*/
- public static Method searchMethod(final Class<?> clazz, final String mName, final Class<?>[] params) {
+ public static Method searchMethod(final Class clazz, final String mName, final Class[] params) {
try {
final Method m = clazz.getMethod(mName, params);
m.setAccessible(true);
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java b/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
index 66f0d85..b77592d 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
@@ -22,8 +22,6 @@
import java.util.Hashtable;
import java.util.zip.ZipOutputStream;
-import org.apache.felix.inventory.InventoryPrinterHandler;
-import org.apache.felix.inventory.InventoryPrinterManager;
import org.apache.felix.inventory.PrinterMode;
import org.apache.felix.inventory.impl.webconsole.ConsoleConstants;
import org.osgi.framework.Bundle;
@@ -42,45 +40,37 @@
* Constructor
* @param inventoryPrinterAdapter The adapter
*/
- DefaultWebConsolePlugin(final InventoryPrinterManager inventoryPrinterManager) {
+ DefaultWebConsolePlugin(final InventoryPrinterManagerImpl inventoryPrinterManager) {
super(inventoryPrinterManager);
}
- @Override
protected InventoryPrinterHandler getInventoryPrinterHandler() {
return this;
}
/**
- * @see org.apache.felix.inventory.InventoryPrinterHandler#getTitle()
+ * @see org.apache.felix.inventory.impl.InventoryPrinterHandler#getTitle()
*/
public String getTitle() {
return "Overview";
}
/**
- * @see org.apache.felix.inventory.InventoryPrinterHandler#getName()
+ * @see org.apache.felix.inventory.impl.InventoryPrinterHandler#getName()
*/
public String getName() {
return "config";
}
/**
- * @see org.apache.felix.inventory.InventoryPrinterHandler#getCategory()
- */
- public String getCategory() {
- return "Inventory";
- }
-
- /**
- * @see org.apache.felix.inventory.InventoryPrinterHandler#getModes()
+ * @see org.apache.felix.inventory..implInventoryPrinterHandler#getModes()
*/
public PrinterMode[] getModes() {
return new PrinterMode[] {PrinterMode.TEXT};
}
/**
- * @see org.apache.felix.inventory.InventoryPrinterHandler#supports(org.apache.felix.inventory.PrinterMode)
+ * @see org.apache.felix.inventory.impl.InventoryPrinterHandler#supports(org.apache.felix.inventory.PrinterMode)
*/
public boolean supports(final PrinterMode mode) {
return mode == PrinterMode.TEXT;
@@ -93,10 +83,10 @@
final InventoryPrinterHandler[] handlers = this.inventoryPrinterManager.getAllHandlers();
printWriter.print("Currently registered ");
printWriter.print(String.valueOf(handlers.length));
- printWriter.println(" inventory printer.");
+ printWriter.println(" printer(s).");
printWriter.println();
- for(final InventoryPrinterHandler handler : handlers) {
- printWriter.println(handler.getTitle());
+ for(int i=0; i<handlers.length; i++) {
+ printWriter.println(handlers[i].getTitle());
}
}
@@ -109,13 +99,13 @@
}
public static ServiceRegistration register(final BundleContext context,
- final InventoryPrinterManager manager) {
+ final InventoryPrinterManagerImpl manager) {
final DefaultWebConsolePlugin dwcp = new DefaultWebConsolePlugin(manager);
- final Dictionary<String, Object> props = new Hashtable<String, Object>();
+ final Dictionary props = new Hashtable();
props.put(ConsoleConstants.PLUGIN_LABEL, dwcp.getName());
props.put(ConsoleConstants.PLUGIN_TITLE, dwcp.getTitle());
- props.put(ConsoleConstants.PLUGIN_CATEGORY, dwcp.getCategory());
+ props.put(ConsoleConstants.PLUGIN_CATEGORY, ConsoleConstants.WEB_CONSOLE_CATEGORY);
return context.registerService(ConsoleConstants.INTERFACE_SERVLET, new ServiceFactory() {
public void ungetService(final Bundle bundle, final ServiceRegistration registration,
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
index ab12d52..29b1f2d 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
@@ -25,8 +25,6 @@
import java.util.zip.ZipOutputStream;
import org.apache.felix.inventory.InventoryPrinter;
-import org.apache.felix.inventory.InventoryPrinterHandler;
-import org.apache.felix.inventory.InventoryPrinterManager;
import org.apache.felix.inventory.PrinterMode;
import org.apache.felix.inventory.ZipAttachmentProvider;
import org.osgi.framework.BundleContext;
@@ -34,8 +32,10 @@
/**
* Helper class for a inventory printer.
+ *
+ * The adapter simplifies accessing and working with the inventory printer.
*/
-public class InventoryPrinterAdapter implements InventoryPrinterHandler, Comparable<InventoryPrinterAdapter> {
+public class InventoryPrinterAdapter implements InventoryPrinterHandler, Comparable {
/**
* Formatter pattern to render the current time of inventory generation.
@@ -78,10 +78,10 @@
/**
* Comparator for adapters based on the service ranking.
*/
- public static final Comparator<InventoryPrinterAdapter> RANKING_COMPARATOR = new Comparator<InventoryPrinterAdapter>() {
+ public static final Comparator RANKING_COMPARATOR = new Comparator() {
- public int compare(final InventoryPrinterAdapter o1, final InventoryPrinterAdapter o2) {
- return o1.description.compareTo(o2.description);
+ public int compare(final Object o1, final Object o2) {
+ return ((InventoryPrinterAdapter)o1).description.compareTo(((InventoryPrinterAdapter)o2).description);
}
};
@@ -112,7 +112,7 @@
this.attachmentMethod = attachmentMethod;
}
- public void registerConsole(final BundleContext context, final InventoryPrinterManager manager) {
+ public void registerConsole(final BundleContext context, final InventoryPrinterManagerImpl manager) {
if ( this.registration == null &&
(supports(PrinterMode.HTML_BODY) || supports(PrinterMode.TEXT))) {
this.registration = WebConsolePlugin.register(context, manager, this.description);
@@ -127,28 +127,21 @@
}
/**
- * @see org.apache.felix.inventory.InventoryPrinterHandler#getTitle()
+ * The human readable title for the inventory printer.
*/
public String getTitle() {
return this.description.getTitle();
}
/**
- * @see org.apache.felix.inventory.InventoryPrinterHandler#getName()
+ * The unique name of the printer.
*/
public String getName() {
return this.description.getName();
}
/**
- * @see org.apache.felix.inventory.InventoryPrinterHandler#getCategory()
- */
- public String getCategory() {
- return this.description.getCategory();
- }
-
- /**
- * @see org.apache.felix.inventory.InventoryPrinterHandler#getModes()
+ * All supported modes.
*/
public PrinterMode[] getModes() {
return this.description.getModes();
@@ -168,7 +161,7 @@
}
/**
- * @see org.apache.felix.inventory.InventoryPrinterHandler#supports(org.apache.felix.inventory.PrinterMode)
+ * Whether the printer supports this mode.
*/
public boolean supports(final PrinterMode mode) {
for(int i=0; i<this.description.getModes().length; i++) {
@@ -196,7 +189,6 @@
/**
* @see java.lang.Object#toString()
*/
- @Override
public String toString() {
return printer.getClass() + "(" + super.toString() + ")";
}
@@ -204,8 +196,8 @@
/**
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
- public int compareTo(final InventoryPrinterAdapter spa) {
- return this.description.getSortKey().compareTo(spa.description.getSortKey());
+ public int compareTo(final Object spa) {
+ return this.description.getSortKey().compareTo(((InventoryPrinterAdapter)spa).description.getSortKey());
}
public InventoryPrinterDescription getDescription() {
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterDescription.java b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterDescription.java
index 677f26e..d8abf59 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterDescription.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterDescription.java
@@ -25,7 +25,7 @@
/**
* Helper class for a configuration printer.
*/
-public class InventoryPrinterDescription implements Comparable<InventoryPrinterDescription> {
+public class InventoryPrinterDescription implements Comparable {
private final ServiceReference reference;
@@ -37,8 +37,6 @@
private final String sortKey;
- private final String category;
-
public InventoryPrinterDescription(final ServiceReference ref) {
this.reference = ref;
@@ -75,13 +73,6 @@
this.title = null;
this.sortKey = null;
}
-
- // check category
- if ( ref.getProperty(InventoryPrinter.CONFIG_CATEGORY) != null ) {
- this.category = ref.getProperty(InventoryPrinter.CONFIG_CATEGORY).toString();
- } else {
- this.category = null;
- }
}
public String getTitle() {
@@ -96,10 +87,6 @@
return this.name;
}
- public String getCategory() {
- return this.category;
- }
-
public PrinterMode[] getModes() {
return this.modes;
}
@@ -111,24 +98,20 @@
/**
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
- public int compareTo(final InventoryPrinterDescription spa) {
- return this.reference.compareTo(spa.reference);
+ public int compareTo(final Object spa) {
+ return this.reference.compareTo(((InventoryPrinterDescription)spa).reference);
}
- @Override
public boolean equals(final Object obj) {
return this.reference.equals(obj);
}
- @Override
public int hashCode() {
return this.reference.hashCode();
}
- @Override
public String toString() {
return "InventoryPrinterDescription [title=" + title + ", name=" + name
- + ", modes=" + Arrays.toString(modes) + ", sortKey=" + sortKey
- + ", category=" + category + "]";
+ + ", modes=" + Arrays.toString(modes) + ", sortKey=" + sortKey + "]";
}
}
diff --git a/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinterHandler.java b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterHandler.java
similarity index 81%
rename from inventory/src/main/java/org/apache/felix/inventory/InventoryPrinterHandler.java
rename to inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterHandler.java
index 1c51a21..3da5c16 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinterHandler.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterHandler.java
@@ -16,16 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.inventory;
+package org.apache.felix.inventory.impl;
+
+import org.apache.felix.inventory.InventoryPrinter;
+import org.apache.felix.inventory.PrinterMode;
+import org.apache.felix.inventory.ZipAttachmentProvider;
/**
* The inventory printer handler can be used by clients to access
- * a inventory printer. The handlers can be get from the {@link InventoryPrinterManager}.
+ * a inventory printer.
*
* For clients using inventory printers, a handler simplifies accessing and
- * working with the inventory printer. A client should never lookup a
- * inventory printer directly.
+ * working with the inventory printer.
*/
public interface InventoryPrinterHandler extends InventoryPrinter, ZipAttachmentProvider {
@@ -35,12 +38,9 @@
/** The human readable title for the inventory printer. */
String getTitle();
- /** The optional category for this printer. */
- String getCategory();
-
/** All supported modes. */
PrinterMode[] getModes();
/** Whether the printer supports this mode. */
boolean supports( final PrinterMode mode );
-}
+}
\ No newline at end of file
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
index 489cbd0..2335221 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
@@ -24,12 +24,11 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentSkipListSet;
import org.apache.felix.inventory.InventoryPrinter;
-import org.apache.felix.inventory.InventoryPrinterHandler;
-import org.apache.felix.inventory.InventoryPrinterManager;
import org.apache.felix.inventory.PrinterMode;
import org.osgi.framework.BundleContext;
import org.osgi.framework.InvalidSyntaxException;
@@ -46,8 +45,7 @@
* based on their name. If more than one printer with the same name
* is registered, the one with highest service ranking is used.
*/
-public class InventoryPrinterManagerImpl implements InventoryPrinterManager,
- ServiceTrackerCustomizer {
+public class InventoryPrinterManagerImpl implements ServiceTrackerCustomizer {
/** Logger. */
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@@ -58,11 +56,11 @@
/** Service tracker for Inventory printers. */
private final ServiceTracker cfgPrinterTracker;
- /** All adapters mapped by their name. */
- private final Map<String, List<InventoryPrinterAdapter>> allAdapters = new HashMap<String, List<InventoryPrinterAdapter>>();
+ /** All adapters mapped by their name. Type of the map: String, List<InventoryPrinterAdapter> */
+ private final Map allAdapters = new HashMap();
- /** Used adapters. */
- private final Set<InventoryPrinterAdapter> usedAdapters = new ConcurrentSkipListSet<InventoryPrinterAdapter>();
+ /** Used adapters. Type of the set: InventoryPrinterAdapter */
+ private final Set usedAdapters = new ConcurrentSkipListSet();
/** Registration for the web console. */
private final ServiceRegistration pluginRegistration;
@@ -149,14 +147,14 @@
final String key = adapter.getName();
synchronized ( this.allAdapters ) {
- List<InventoryPrinterAdapter> list = this.allAdapters.get(key);
+ List list = (List) this.allAdapters.get(key);
final InventoryPrinterAdapter first;
if ( list == null ) {
- list = new LinkedList<InventoryPrinterAdapter>();
+ list = new LinkedList();
this.allAdapters.put(key, list);
first = null;
} else {
- first = list.get(0);
+ first = (InventoryPrinterAdapter) list.get(0);
}
list.add(adapter);
Collections.sort(list, InventoryPrinterAdapter.RANKING_COMPARATOR);
@@ -172,7 +170,7 @@
}
}
if ( removeAdapter != null ) {
- final Iterator<InventoryPrinterAdapter> i = this.usedAdapters.iterator();
+ final Iterator i = this.usedAdapters.iterator();
while ( i.hasNext() ) {
if ( i.next() == removeAdapter ) {
i.remove();
@@ -197,13 +195,13 @@
private void removeService(final ServiceReference reference) {
synchronized ( this.allAdapters ) {
- final Iterator<Map.Entry<String, List<InventoryPrinterAdapter>>> i = this.allAdapters.entrySet().iterator();
+ final Iterator i = this.allAdapters.entrySet().iterator();
while ( i.hasNext() ) {
- final Map.Entry<String, List<InventoryPrinterAdapter>> entry = i.next();
- final Iterator<InventoryPrinterAdapter> iter = entry.getValue().iterator();
+ final Map.Entry entry = (Entry) i.next();
+ final Iterator iter = ((List) entry.getValue()).iterator();
boolean removed = false;
while ( iter.hasNext() ) {
- final InventoryPrinterAdapter adapter = iter.next();
+ final InventoryPrinterAdapter adapter = (InventoryPrinterAdapter) iter.next();
if ( adapter.getDescription().getServiceReference().compareTo(reference) == 0 ) {
iter.remove();
removed = true;
@@ -211,16 +209,16 @@
}
}
if ( removed ) {
- if ( entry.getValue().size() == 0 ) {
+ if ( ((List)entry.getValue()).size() == 0 ) {
i.remove();
}
break;
}
}
}
- final Iterator<InventoryPrinterAdapter> iter = this.usedAdapters.iterator();
+ final Iterator iter = this.usedAdapters.iterator();
while ( iter.hasNext() ) {
- final InventoryPrinterAdapter adapter = iter.next();
+ final InventoryPrinterAdapter adapter = (InventoryPrinterAdapter) iter.next();
if ( adapter.getDescription().getServiceReference().compareTo(reference) == 0 ) {
iter.remove();
adapter.unregisterConsole();
@@ -230,30 +228,37 @@
}
/**
- * @see org.apache.felix.inventory.InventoryPrinterManager#getAllHandlers()
+ * Get all inventory printer handlers.
+ * @return A list of handlers - might be empty.
*/
public InventoryPrinterHandler[] getAllHandlers() {
- return this.usedAdapters.toArray(new InventoryPrinterHandler[this.usedAdapters.size()]);
+ return (InventoryPrinterHandler[]) this.usedAdapters.toArray(new InventoryPrinterHandler[this.usedAdapters.size()]);
}
/**
- * @see org.apache.felix.inventory.InventoryPrinterManager#getHandlers(org.apache.felix.inventory.PrinterMode)
+ * Get all handlers supporting the mode.
+ * @return A list of handlers - might be empty.
*/
public InventoryPrinterHandler[] getHandlers(final PrinterMode mode) {
- final List<InventoryPrinterHandler> result = new ArrayList<InventoryPrinterHandler>();
- for(final InventoryPrinterAdapter printer : this.usedAdapters) {
+ final List result = new ArrayList();
+ final Iterator i = this.usedAdapters.iterator();
+ while ( i .hasNext() ) {
+ final InventoryPrinterAdapter printer = (InventoryPrinterAdapter) i.next();
if ( printer.supports(mode) ) {
result.add(printer);
}
}
- return result.toArray(new InventoryPrinterHandler[result.size()]);
+ return (InventoryPrinterHandler[]) result.toArray(new InventoryPrinterHandler[result.size()]);
}
/**
- * @see org.apache.felix.inventory.InventoryPrinterManager#getHandler(java.lang.String)
+ * Return a handler for the unique name.
+ * @return The corresponding handler or <code>null</code>.
*/
public InventoryPrinterHandler getHandler(final String name) {
- for(final InventoryPrinterAdapter printer : this.usedAdapters) {
+ final Iterator i = this.usedAdapters.iterator();
+ while ( i .hasNext() ) {
+ final InventoryPrinterAdapter printer = (InventoryPrinterAdapter) i.next();
if ( name.equals(printer.getName()) ) {
return printer;
}
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/WebConsolePlugin.java b/inventory/src/main/java/org/apache/felix/inventory/impl/WebConsolePlugin.java
index 809b793..7740c90 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/WebConsolePlugin.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/WebConsolePlugin.java
@@ -19,8 +19,6 @@
import java.util.Dictionary;
import java.util.Hashtable;
-import org.apache.felix.inventory.InventoryPrinterHandler;
-import org.apache.felix.inventory.InventoryPrinterManager;
import org.apache.felix.inventory.impl.webconsole.ConsoleConstants;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -42,25 +40,24 @@
* @param inventoryPrinterManager The inventory printer manager.
* @param printerName The name of the printer this plugin is displaying.
*/
- WebConsolePlugin(final InventoryPrinterManager inventoryPrinterManager,
+ WebConsolePlugin(final InventoryPrinterManagerImpl inventoryPrinterManager,
final String printerName) {
super(inventoryPrinterManager);
this.printerName = printerName;
}
- @Override
protected InventoryPrinterHandler getInventoryPrinterHandler() {
return this.inventoryPrinterManager.getHandler(this.printerName);
}
public static ServiceRegistration register(
final BundleContext context,
- final InventoryPrinterManager manager,
+ final InventoryPrinterManagerImpl manager,
final InventoryPrinterDescription desc) {
- final Dictionary<String, Object> props = new Hashtable<String, Object>();
- props.put(ConsoleConstants.PLUGIN_LABEL, "inventory-" + desc.getName());
+ final Dictionary props = new Hashtable();
+ props.put(ConsoleConstants.PLUGIN_LABEL, "status-" + desc.getName());
props.put(ConsoleConstants.PLUGIN_TITLE, desc.getTitle());
- props.put(ConsoleConstants.PLUGIN_CATEGORY, desc.getCategory() == null ? "Inventory" : desc.getCategory());
+ props.put(ConsoleConstants.PLUGIN_CATEGORY, ConsoleConstants.WEB_CONSOLE_CATEGORY);
return context.registerService(ConsoleConstants.INTERFACE_SERVLET, new ServiceFactory() {
public void ungetService(final Bundle bundle, final ServiceRegistration registration,
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
index 1ec7020..11911a9 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
@@ -41,7 +41,7 @@
private final Method printMethod;
private final Method attachmentMethod;
- private static final List<String> CUSTOM_MODES = new ArrayList<String>();
+ private static final List CUSTOM_MODES = new ArrayList();
static {
CUSTOM_MODES.add( ConsoleConstants.MODE_TXT);
CUSTOM_MODES.add( ConsoleConstants.MODE_WEB );
@@ -52,9 +52,10 @@
* Check whether the class implements the configuration printer.
* This is done manually to avoid having the configuration printer class available.
*/
- private static boolean isConfigurationPrinter(final Class<?> clazz) {
- for(final Class<?> i : clazz.getInterfaces() ) {
- if ( i.getName().equals(ConsoleConstants.INTERFACE_CONFIGURATION_PRINTER) ) {
+ private static boolean isConfigurationPrinter(final Class clazz) {
+ final Class[] interf = clazz.getInterfaces();
+ for(int i=0; i<interf.length; i++) {
+ if ( interf[i].getName().equals(ConsoleConstants.INTERFACE_CONFIGURATION_PRINTER) ) {
return true;
}
}
@@ -181,7 +182,7 @@
* Map the modes to inventory printer modes
*/
public String[] getPrinterModes() {
- final Set<String> list = new HashSet<String>();
+ final Set list = new HashSet();
if ( this.match(ConsoleConstants.MODE_TXT) || this.match(ConsoleConstants.MODE_ZIP) ) {
list.add(PrinterMode.ZIP_FILE_TEXT.name());
}
@@ -192,7 +193,7 @@
list.add(PrinterMode.TEXT.name());
}
}
- return list.toArray(new String[list.size()]);
+ return (String[]) list.toArray(new String[list.size()]);
}
private boolean match(final String mode) {
@@ -227,7 +228,6 @@
/**
* @see java.lang.Object#toString()
*/
- @Override
public String toString() {
return title + " (" + printer.getClass() + ")";
}
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java
index 865b6f9..274a989 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java
@@ -42,4 +42,6 @@
public static final String MODE_TXT = "txt"; //$NON-NLS-1$
public static final String PROPERTY_MODES = "modes"; //$NON-NLS-1$
+
+ public static final String WEB_CONSOLE_CATEGORY = "Status"; //$NON-NLS-1$
}
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ResourceBundleManager.java b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ResourceBundleManager.java
index 13b6850..7c4ae42 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ResourceBundleManager.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ResourceBundleManager.java
@@ -45,7 +45,7 @@
private final BundleContext bundleContext;
- private final Map<Long, ResourceBundle> resourceBundleCaches;
+ private final Map resourceBundleCaches;
/**
@@ -56,7 +56,7 @@
public ResourceBundleManager( final BundleContext bundleContext )
{
this.bundleContext = bundleContext;
- this.resourceBundleCaches = new HashMap<Long, ResourceBundle>();
+ this.resourceBundleCaches = new HashMap();
bundleContext.addBundleListener( this );
}
@@ -82,7 +82,7 @@
ResourceBundle cache;
final Long key = new Long( provider.getBundleId() );
synchronized ( resourceBundleCaches ) {
- cache = resourceBundleCaches.get( key );
+ cache = (ResourceBundle) resourceBundleCaches.get( key );
if ( cache == null && !resourceBundleCaches.containsKey(key)) {
cache = this.loadResourceBundle(provider);
resourceBundleCaches.put( key, cache );
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/WebConsoleAdapter.java b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/WebConsoleAdapter.java
index bfd30ca..3949f18 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/WebConsoleAdapter.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/WebConsoleAdapter.java
@@ -21,9 +21,12 @@
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.zip.ZipEntry;
@@ -42,6 +45,8 @@
/**
+ * The web console adapter registers web console status printers
+ * as inventory printers.
*/
public class WebConsoleAdapter implements ServiceTrackerCustomizer {
@@ -49,7 +54,7 @@
private final ServiceTracker cfgPrinterTracker;
- private final Map<ServiceReference, ServiceRegistration> registrations = new HashMap<ServiceReference, ServiceRegistration>();
+ private final Map registrations = new HashMap();
private final ResourceBundleManager rbManager;
@@ -70,16 +75,20 @@
*/
public void dispose() {
this.cfgPrinterTracker.close();
+ final List regs = new ArrayList();
synchronized ( this.registrations ) {
- for(final ServiceRegistration reg : this.registrations.values()) {
- reg.unregister();
- }
+ regs.addAll( this.registrations.values() );
this.registrations.clear();
}
+ final Iterator i = regs.iterator();
+ while (i.hasNext()) {
+ final ServiceRegistration reg = (ServiceRegistration) i.next();
+ reg.unregister();
+ }
this.rbManager.dispose();
}
- public void add(final ServiceReference reference, final Object service) {
+ private void add(final ServiceReference reference, final Object service) {
final ConfigurationPrinterAdapter cpa = ConfigurationPrinterAdapter.createAdapter(service, reference);
if ( cpa != null && cpa.title != null ) {
if ( cpa.title.startsWith("%") ) {
@@ -94,73 +103,12 @@
if ( cpa.label == null ) {
cpa.label = cpa.title;
}
- final Dictionary<String, Object> props = new Hashtable<String, Object>();
+ final Dictionary props = new Hashtable();
props.put(InventoryPrinter.CONFIG_NAME, cpa.label);
props.put(InventoryPrinter.CONFIG_TITLE, cpa.title);
props.put(InventoryPrinter.CONFIG_PRINTER_MODES, cpa.getPrinterModes());
- if ( reference.getProperty(ConsoleConstants.PLUGIN_CATEGORY) != null ) {
- props.put(InventoryPrinter.CONFIG_CATEGORY, reference.getProperty(ConsoleConstants.PLUGIN_CATEGORY));
- }
- final ServiceRegistration reg = this.bundleContext.registerService(InventoryPrinter.class.getName(), new ZipAttachmentProvider() {
-
- /**
- * @see org.apache.felix.inventory.InventoryPrinter#print(org.apache.felix.inventory.PrinterMode, java.io.PrintWriter)
- */
- public void print(final PrinterMode mode, final PrintWriter printWriter) {
- final String m;
- if ( mode == PrinterMode.HTML_BODY ) {
- m = ConsoleConstants.MODE_WEB;
- } else if ( mode == PrinterMode.TEXT ) {
- m = ConsoleConstants.MODE_TXT;
- } else if ( mode == PrinterMode.ZIP_FILE_TEXT ) {
- m = ConsoleConstants.MODE_ZIP;
- } else {
- m = null;
- }
- if ( m != null ) {
- cpa.printConfiguration(printWriter, m);
- }
- }
-
- /**
- * @see org.apache.felix.inventory.ZipAttachmentProvider#addAttachments(java.lang.String, java.util.zip.ZipOutputStream)
- */
- public void addAttachments(final String namePrefix, final ZipOutputStream zos)
- throws IOException {
- final URL[] attachments = cpa.getAttachments();
- if ( attachments != null ) {
- for(final URL current : attachments) {
- final String path = current.getPath();
- final String name;
- if ( path == null || path.length() == 0 ) {
- // sanity code, we should have a path, but if not let's
- // just create some random name
- name = "file" + Double.doubleToLongBits( Math.random() );
- } else {
- final int pos = path.lastIndexOf('/');
- name = (pos == -1 ? path : path.substring(pos + 1));
- }
- final ZipEntry entry = new ZipEntry(namePrefix + name);
- zos.putNextEntry(entry);
- final InputStream is = current.openStream();
- try {
- byte[] buffer = new byte[4096];
- int n = 0;
- while (-1 != (n = is.read(buffer))) {
- zos.write(buffer, 0, n);
- }
- } finally {
- if ( is != null ) {
- try { is.close(); } catch (final IOException ignore) {}
- }
- }
- zos.closeEntry();
- }
- }
- }
-
- }, props);
+ final ServiceRegistration reg = this.bundleContext.registerService(InventoryPrinter.class.getName(), new WebConsolePrinter(cpa), props);
synchronized ( this.registrations ) {
this.registrations.put(reference, reg);
}
@@ -170,7 +118,7 @@
private final void remove(final ServiceReference reference) {
final ServiceRegistration reg;
synchronized ( this.registrations ) {
- reg = this.registrations.remove(reference);
+ reg = (ServiceRegistration) this.registrations.remove(reference);
}
if ( reg != null ) {
reg.unregister();
@@ -202,4 +150,71 @@
this.remove(reference);
this.bundleContext.ungetService(reference);
}
+
+ private static class WebConsolePrinter implements InventoryPrinter, ZipAttachmentProvider {
+
+ final ConfigurationPrinterAdapter cpa;
+
+ public WebConsolePrinter(final ConfigurationPrinterAdapter cpa) {
+ this.cpa = cpa;
+ }
+
+ /**
+ * @see org.apache.felix.inventory.InventoryPrinter#print(org.apache.felix.inventory.PrinterMode, java.io.PrintWriter)
+ */
+ public void print(final PrinterMode mode, final PrintWriter printWriter) {
+ final String m;
+ if ( mode == PrinterMode.HTML_BODY ) {
+ m = ConsoleConstants.MODE_WEB;
+ } else if ( mode == PrinterMode.TEXT ) {
+ m = ConsoleConstants.MODE_TXT;
+ } else if ( mode == PrinterMode.ZIP_FILE_TEXT ) {
+ m = ConsoleConstants.MODE_ZIP;
+ } else {
+ m = null;
+ }
+ if ( m != null ) {
+ cpa.printConfiguration(printWriter, m);
+ }
+ }
+
+ /**
+ * @see org.apache.felix.inventory.ZipAttachmentProvider#addAttachments(java.lang.String, java.util.zip.ZipOutputStream)
+ */
+ public void addAttachments(final String namePrefix, final ZipOutputStream zos)
+ throws IOException {
+ final URL[] attachments = cpa.getAttachments();
+ if ( attachments != null ) {
+ for(int i=0;i<attachments.length;i++) {
+ final URL current = attachments[i];
+ final String path = current.getPath();
+ final String name;
+ if ( path == null || path.length() == 0 ) {
+ // sanity code, we should have a path, but if not let's
+ // just create some random name
+ name = "file" + Double.doubleToLongBits( Math.random() );
+ } else {
+ final int pos = path.lastIndexOf('/');
+ name = (pos == -1 ? path : path.substring(pos + 1));
+ }
+ final ZipEntry entry = new ZipEntry(namePrefix + name);
+ zos.putNextEntry(entry);
+ final InputStream is = current.openStream();
+ try {
+ byte[] buffer = new byte[4096];
+ int n = 0;
+ while (-1 != (n = is.read(buffer))) {
+ zos.write(buffer, 0, n);
+ }
+ } finally {
+ if ( is != null ) {
+ try { is.close(); } catch (final IOException ignore) {}
+ }
+ }
+ zos.closeEntry();
+ }
+ }
+ }
+
+ }
}
diff --git a/inventory/src/main/java/org/apache/felix/inventory/package-info.java b/inventory/src/main/java/org/apache/felix/inventory/package-info.java
deleted file mode 100644
index 83a97ed..0000000
--- a/inventory/src/main/java/org/apache/felix/inventory/package-info.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Interfaces for getting inventory information about the current instance
- *
- * @version 1.0.0
- */
-@Version("1.0.0")
-@Export(optional = "provide:=true")
-package org.apache.felix.inventory;
-
-import aQute.bnd.annotation.Export;
-import aQute.bnd.annotation.Version;
-
-