felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1461812 - in /felix/trunk/inventory/src: main/java/org/apache/felix/inventory/ main/java/org/apache/felix/inventory/impl/ main/java/org/apache/felix/inventory/impl/webconsole/ test/java/org/apache/felix/inventory/
Date Wed, 27 Mar 2013 19:24:06 GMT
Author: fmeschbe
Date: Wed Mar 27 19:24:05 2013
New Revision: 1461812

URL: http://svn.apache.org/r1461812
Log:
Formatting and import organizations

Modified:
    felix/trunk/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java
    felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
    felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java
    felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
    felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
    felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
    felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
    felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java
    felix/trunk/inventory/src/test/java/org/apache/felix/inventory/PrinterModeTest.java

Modified: felix/trunk/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java
URL: http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java?rev=1461812&r1=1461811&r2=1461812&view=diff
==============================================================================
--- felix/trunk/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java (original)
+++ felix/trunk/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java Wed Mar
27 19:24:05 2013
@@ -6,9 +6,9 @@
  * 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

Modified: felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java?rev=1461812&r1=1461811&r2=1461812&view=diff
==============================================================================
--- felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
(original)
+++ felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
Wed Mar 27 19:24:05 2013
@@ -5,9 +5,9 @@
  * 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.
@@ -46,7 +46,7 @@ public abstract class AbstractWebConsole
 
     /**
      * Constructor
-     *
+     * 
      * @param inventoryPrinterManager The manager
      */
     AbstractWebConsolePlugin(final InventoryPrinterManagerImpl inventoryPrinterManager)
@@ -83,7 +83,7 @@ public abstract class AbstractWebConsole
      * <p>
      * This method sets the <code>Cache-Control</code>, <code>Expires</code>,
      * and <code>Pragma</code> headers.
-     *
+     * 
      * @param response The response for which to set the cache prevention
      */
     private final void setNoCache(final HttpServletResponse response)
@@ -205,9 +205,12 @@ public abstract class AbstractWebConsole
 
             final JSONConfigurationWriter jcw = new JSONConfigurationWriter(response.getWriter());
             final PrinterMode mode;
-            if (handler.supports(PrinterMode.JSON)) {
+            if (handler.supports(PrinterMode.JSON))
+            {
                 mode = PrinterMode.JSON;
-            } else {
+            }
+            else
+            {
                 mode = PrinterMode.TEXT;
                 jcw.startJSONWrapper();
             }
@@ -552,8 +555,8 @@ public abstract class AbstractWebConsole
 
         /**
          * Escapes HTML special chars like: <>&\r\n and space
-         *
-         *
+         * 
+         * 
          * @param text the text to escape
          * @return the escaped text
          */

Modified: felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java?rev=1461812&r1=1461811&r2=1461812&view=diff
==============================================================================
--- felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java (original)
+++ felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java Wed
Mar 27 19:24:05 2013
@@ -5,9 +5,9 @@
  * 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.

Modified: felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java?rev=1461812&r1=1461811&r2=1461812&view=diff
==============================================================================
--- felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
(original)
+++ felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
Wed Mar 27 19:24:05 2013
@@ -5,9 +5,9 @@
  * 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.
@@ -33,7 +33,7 @@ public class DefaultWebConsolePlugin ext
 
     /**
      * Constructor
-     *
+     * 
      * @param inventoryPrinterAdapter The adapter
      */
     DefaultWebConsolePlugin(final InventoryPrinterManagerImpl inventoryPrinterManager)

Modified: felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
URL: http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java?rev=1461812&r1=1461811&r2=1461812&view=diff
==============================================================================
--- felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
(original)
+++ felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
Wed Mar 27 19:24:05 2013
@@ -5,9 +5,9 @@
  * 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.
@@ -18,7 +18,6 @@ package org.apache.felix.inventory.impl;
 
 import java.io.IOException;
 import java.io.PrintWriter;
-import java.lang.reflect.Method;
 import java.text.DateFormat;
 import java.util.Comparator;
 import java.util.Locale;
@@ -32,7 +31,7 @@ import org.osgi.framework.ServiceRegistr
 
 /**
  * Helper class for a inventory printer.
- *
+ * 
  * The adapter simplifies accessing and working with the inventory printer.
  */
 public class InventoryPrinterAdapter implements InventoryPrinterHandler, Comparable
@@ -45,19 +44,6 @@ public class InventoryPrinterAdapter imp
         Locale.US);
 
     /**
-     * Create a new adapter if the provided service is either a printer or
-     * provides
-     * the print method.
-     *
-     * @return An adapter or <code>null</code> if the method is missing.
-     */
-    public static InventoryPrinterAdapter createAdapter(final InventoryPrinterDescription
description,
-        final InventoryPrinter service)
-    {
-        return new InventoryPrinterAdapter(description, service);
-    }
-
-    /**
      * Comparator for adapters based on the service ranking.
      */
     public static final Comparator RANKING_COMPARATOR = new Comparator()

Modified: felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java?rev=1461812&r1=1461811&r2=1461812&view=diff
==============================================================================
--- felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
(original)
+++ felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
Wed Mar 27 19:24:05 2013
@@ -5,9 +5,9 @@
  * 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.
@@ -70,7 +70,7 @@ public class InventoryPrinterManagerImpl
 
     /**
      * Create the inventory printer manager
-     *
+     * 
      * @param btx Bundle Context
      * @throws InvalidSyntaxException Should only happen if we have an error in
      *             the code
@@ -140,6 +140,16 @@ public class InventoryPrinterManagerImpl
         this.addService(reference, (InventoryPrinter) service);
     }
 
+    /**
+     * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(org.osgi.framework.ServiceReference,
+     *      java.lang.Object)
+     */
+    public void removedService(final ServiceReference reference, final Object service)
+    {
+        this.removeService(reference);
+        this.bundleContext.ungetService(reference);
+    }
+
     private void addService(final ServiceReference reference, final InventoryPrinter obj)
     {
         final InventoryPrinterDescription desc = new InventoryPrinterDescription(reference);
@@ -165,16 +175,7 @@ public class InventoryPrinterManagerImpl
         }
         if (valid)
         {
-            final InventoryPrinterAdapter adapter = InventoryPrinterAdapter.createAdapter(desc,
obj);
-            if (adapter == null)
-            {
-                Activator.log(null, LogService.LOG_INFO, "Ignoring inventory printer - printer
method is missing: "
-                    + reference, null);
-            }
-            else
-            {
-                this.addAdapter(adapter);
-            }
+            this.addAdapter(new InventoryPrinterAdapter(desc, obj));
         }
     }
 
@@ -235,16 +236,6 @@ public class InventoryPrinterManagerImpl
         }
     }
 
-    /**
-     * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(org.osgi.framework.ServiceReference,
-     *      java.lang.Object)
-     */
-    public void removedService(final ServiceReference reference, final Object service)
-    {
-        this.removeService(reference);
-        this.bundleContext.ungetService(reference);
-    }
-
     private void removeService(final ServiceReference reference)
     {
         synchronized (this.allAdapters)
@@ -290,7 +281,7 @@ public class InventoryPrinterManagerImpl
 
     /**
      * Get all inventory printer handlers.
-     *
+     * 
      * @return A list of handlers - might be empty.
      */
     public InventoryPrinterHandler[] getAllHandlers()
@@ -301,7 +292,7 @@ public class InventoryPrinterManagerImpl
 
     /**
      * Get all handlers supporting the mode.
-     *
+     * 
      * @return A list of handlers - might be empty.
      */
     public InventoryPrinterHandler[] getHandlers(final PrinterMode mode)
@@ -321,7 +312,7 @@ public class InventoryPrinterManagerImpl
 
     /**
      * Return a handler for the unique name.
-     *
+     * 
      * @return The corresponding handler or <code>null</code>.
      */
     public InventoryPrinterHandler getHandler(final String name)

Modified: felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
URL: http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java?rev=1461812&r1=1461811&r2=1461812&view=diff
==============================================================================
--- felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
(original)
+++ felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
Wed Mar 27 19:24:05 2013
@@ -5,9 +5,9 @@
  * 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.

Modified: felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java
URL: http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java?rev=1461812&r1=1461811&r2=1461812&view=diff
==============================================================================
--- felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java
(original)
+++ felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java
Wed Mar 27 19:24:05 2013
@@ -5,9 +5,9 @@
  * 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.

Modified: felix/trunk/inventory/src/test/java/org/apache/felix/inventory/PrinterModeTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/inventory/src/test/java/org/apache/felix/inventory/PrinterModeTest.java?rev=1461812&r1=1461811&r2=1461812&view=diff
==============================================================================
--- felix/trunk/inventory/src/test/java/org/apache/felix/inventory/PrinterModeTest.java (original)
+++ felix/trunk/inventory/src/test/java/org/apache/felix/inventory/PrinterModeTest.java Wed
Mar 27 19:24:05 2013
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */



Mime
View raw message