felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r657050 [2/2] - in /felix/trunk/webconsole: ./ src/main/java/org/apache/sling/felix/ src/main/java/org/apache/sling/felix/webconsole/ src/main/java/org/apache/sling/felix/webconsole/internal/ src/main/java/org/apache/sling/felix/webconsole/...
Date Fri, 16 May 2008 13:09:36 GMT
Modified: felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/servlet/SlingHttpContext.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/servlet/SlingHttpContext.java?rev=657050&r1=657025&r2=657050&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/servlet/SlingHttpContext.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/servlet/SlingHttpContext.java
Fri May 16 06:09:35 2008
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sling.osgi.console.web.internal.servlet;
+package org.apache.sling.felix.webconsole.internal.servlet;
 
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;

Modified: felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/servlet/SlingManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/servlet/SlingManager.java?rev=657050&r1=657025&r2=657050&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/servlet/SlingManager.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/servlet/SlingManager.java
Fri May 16 06:09:35 2008
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sling.osgi.console.web.internal.servlet;
+package org.apache.sling.felix.webconsole.internal.servlet;
 
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -22,6 +22,7 @@
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Hashtable;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.SortedMap;
@@ -39,28 +40,28 @@
 import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.apache.commons.fileupload.servlet.ServletFileUpload;
 import org.apache.commons.fileupload.servlet.ServletRequestContext;
-import org.apache.sling.osgi.console.web.Action;
-import org.apache.sling.osgi.console.web.Render;
-import org.apache.sling.osgi.console.web.internal.BaseManagementPlugin;
-import org.apache.sling.osgi.console.web.internal.Util;
-import org.apache.sling.osgi.console.web.internal.compendium.AjaxConfigManagerAction;
-import org.apache.sling.osgi.console.web.internal.compendium.ComponentConfigurationPrinter;
-import org.apache.sling.osgi.console.web.internal.compendium.ComponentRenderAction;
-import org.apache.sling.osgi.console.web.internal.compendium.ConfigManager;
-import org.apache.sling.osgi.console.web.internal.core.AjaxBundleDetailsAction;
-import org.apache.sling.osgi.console.web.internal.core.BundleListRender;
-import org.apache.sling.osgi.console.web.internal.core.InstallAction;
-import org.apache.sling.osgi.console.web.internal.core.RefreshPackagesAction;
-import org.apache.sling.osgi.console.web.internal.core.SetStartLevelAction;
-import org.apache.sling.osgi.console.web.internal.core.StartAction;
-import org.apache.sling.osgi.console.web.internal.core.StopAction;
-import org.apache.sling.osgi.console.web.internal.core.UninstallAction;
-import org.apache.sling.osgi.console.web.internal.core.UpdateAction;
-import org.apache.sling.osgi.console.web.internal.misc.ConfigurationRender;
-import org.apache.sling.osgi.console.web.internal.system.GCAction;
-import org.apache.sling.osgi.console.web.internal.system.ShutdownAction;
-import org.apache.sling.osgi.console.web.internal.system.ShutdownRender;
-import org.apache.sling.osgi.console.web.internal.system.VMStatRender;
+import org.apache.sling.felix.webconsole.Action;
+import org.apache.sling.felix.webconsole.Render;
+import org.apache.sling.felix.webconsole.internal.BaseManagementPlugin;
+import org.apache.sling.felix.webconsole.internal.Util;
+import org.apache.sling.felix.webconsole.internal.compendium.AjaxConfigManagerAction;
+import org.apache.sling.felix.webconsole.internal.compendium.ComponentConfigurationPrinter;
+import org.apache.sling.felix.webconsole.internal.compendium.ComponentRenderAction;
+import org.apache.sling.felix.webconsole.internal.compendium.ConfigManager;
+import org.apache.sling.felix.webconsole.internal.core.AjaxBundleDetailsAction;
+import org.apache.sling.felix.webconsole.internal.core.BundleListRender;
+import org.apache.sling.felix.webconsole.internal.core.InstallAction;
+import org.apache.sling.felix.webconsole.internal.core.RefreshPackagesAction;
+import org.apache.sling.felix.webconsole.internal.core.SetStartLevelAction;
+import org.apache.sling.felix.webconsole.internal.core.StartAction;
+import org.apache.sling.felix.webconsole.internal.core.StopAction;
+import org.apache.sling.felix.webconsole.internal.core.UninstallAction;
+import org.apache.sling.felix.webconsole.internal.core.UpdateAction;
+import org.apache.sling.felix.webconsole.internal.misc.ConfigurationRender;
+import org.apache.sling.felix.webconsole.internal.system.GCAction;
+import org.apache.sling.felix.webconsole.internal.system.ShutdownAction;
+import org.apache.sling.felix.webconsole.internal.system.ShutdownRender;
+import org.apache.sling.felix.webconsole.internal.system.VMStatRender;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
@@ -118,7 +119,7 @@
      */
     private static final String DEFAULT_MANAGER_ROOT = "/system/console";
 
-    private static final Class<?>[] PLUGIN_CLASSES = {
+    private static final Class[] PLUGIN_CLASSES = {
         AjaxConfigManagerAction.class, ComponentConfigurationPrinter.class,
         ComponentRenderAction.class, ConfigManager.class,
         AjaxBundleDetailsAction.class, BundleListRender.class,
@@ -142,9 +143,9 @@
 
     private ServiceRegistration configurationListener;
 
-    private Map<String, Action> operations = new HashMap<String, Action>();
+    private Map operations = new HashMap();
 
-    private SortedMap<String, Render> renders = new TreeMap<String, Render>();
+    private SortedMap renders = new TreeMap();
 
     private Render defaultRender;
 
@@ -152,7 +153,7 @@
 
     private String webManagerRoot;
 
-    private Dictionary<String, Object> configuration;
+    private Dictionary configuration;
 
     public SlingManager(BundleContext bundleContext) {
 
@@ -175,7 +176,8 @@
         httpServiceTracker = new HttpServiceTracker(this);
         httpServiceTracker.open();
 
-        for (Class<?> pluginClass : PLUGIN_CLASSES) {
+        for (int i=0; i < PLUGIN_CLASSES.length; i++) {
+            Class pluginClass = PLUGIN_CLASSES[i];
             try {
                 Object plugin = pluginClass.newInstance();
                 if (plugin instanceof BaseManagementPlugin) {
@@ -271,7 +273,7 @@
         // check action
         String actionName = this.getParameter(req, Util.PARAM_ACTION);
         if (actionName != null) {
-            Action action = this.operations.get(actionName);
+            Action action = (Action) this.operations.get(actionName);
             if (action != null) {
                 boolean redirect = true;
                 try {
@@ -322,7 +324,7 @@
             page = page.substring(lastSlash + 1);
         }
 
-        Render render = this.renders.get(page);
+        Render render = (Render) this.renders.get(page);
         return (render == null) ? this.defaultRender : render;
     }
 
@@ -334,8 +336,7 @@
         }
 
         // check, whether we alread have the parameters
-        @SuppressWarnings("unchecked")
-        Map<String, FileItem[]> params = (Map<String, FileItem[]>) request.getAttribute(Util.ATTR_FILEUPLOAD);
+        Map params = (Map) request.getAttribute(Util.ATTR_FILEUPLOAD);
         if (params == null) {
             // parameters not read yet, read now
             // Create a factory for disk-based file items
@@ -347,12 +348,12 @@
             upload.setSizeMax(-1);
 
             // Parse the request
-            params = new HashMap<String, FileItem[]>();
+            params = new HashMap();
             try {
-                @SuppressWarnings("unchecked")
-                List<FileItem> items = upload.parseRequest(request);
-                for (FileItem fi : items) {
-                    FileItem[] current = params.get(fi.getFieldName());
+                List items = upload.parseRequest(request);
+                for (Iterator fiter=items.iterator(); fiter.hasNext(); ) {
+                    FileItem fi = (FileItem) fiter.next();
+                    FileItem[] current = (FileItem[]) params.get(fi.getFieldName());
                     if (current == null) {
                         current = new FileItem[] { fi };
                     } else {
@@ -370,7 +371,7 @@
             request.setAttribute(Util.ATTR_FILEUPLOAD, params);
         }
 
-        FileItem[] param = params.get(name);
+        FileItem[] param = (FileItem[]) params.get(name);
         if (param != null) {
             for (int i = 0; i < param.length; i++) {
                 if (param[i].isFormField()) {
@@ -397,7 +398,6 @@
             this.slingManager = slingManager;
         }
 
-        @Override
         public Object addingService(ServiceReference reference) {
             Object operation = super.addingService(reference);
             if (operation instanceof HttpService) {
@@ -406,7 +406,6 @@
             return operation;
         }
 
-        @Override
         public void removedService(ServiceReference reference, Object service) {
             if (service instanceof HttpService) {
                 slingManager.unbindHttpService((HttpService) service);
@@ -425,7 +424,6 @@
             this.slingManager = slingManager;
         }
 
-        @Override
         public Object addingService(ServiceReference reference) {
             Object operation = super.addingService(reference);
             if (operation instanceof Action) {
@@ -434,7 +432,6 @@
             return operation;
         }
 
-        @Override
         public void removedService(ServiceReference reference, Object service) {
             if (service instanceof Action) {
                 slingManager.bindOperation((Action) service);
@@ -453,7 +450,6 @@
             this.slingManager = slingManager;
         }
 
-        @Override
         public Object addingService(ServiceReference reference) {
             Object operation = super.addingService(reference);
             if (operation instanceof Render) {
@@ -462,7 +458,6 @@
             return operation;
         }
 
-        @Override
         public void removedService(ServiceReference reference, Object service) {
             if (service instanceof Render) {
                 slingManager.bindRender((Render) service);
@@ -473,7 +468,7 @@
     }
 
     protected synchronized void bindHttpService(HttpService httpService) {
-        Dictionary<String, Object> config = getConfiguration();
+        Dictionary config = getConfiguration();
 
         // get authentication details
         String realm = this.getProperty(config, PROP_REALM,
@@ -486,7 +481,7 @@
             HttpContext httpContext = new SlingHttpContext(httpService, realm,
                 userId, password);
 
-            Dictionary<String, String> servletConfig = toStringConfig(config);
+            Dictionary servletConfig = toStringConfig(config);
 
             // rest of sling
             httpService.registerServlet(this.webManagerRoot, this,
@@ -535,25 +530,25 @@
             if (this.renders.isEmpty()) {
                 this.defaultRender = null;
             } else {
-                this.defaultRender = this.renders.values().iterator().next();
+                this.defaultRender = (Render) renders.values().iterator().next();
             }
         }
     }
 
-    private Dictionary<String, Object> getConfiguration() {
+    private Dictionary getConfiguration() {
         return configuration;
     }
 
-    void updateConfiguration(Dictionary<String, Object> config) {
+    void updateConfiguration(Dictionary config) {
         if (config == null) {
-            config = new Hashtable<String, Object>();
+            config = new Hashtable();
         }
 
         configuration = config;
 
         defaultRenderName = (String) config.get(PROP_DEFAULT_RENDER);
         if (defaultRenderName != null && renders.get(defaultRenderName) != null)
{
-            defaultRender = renders.get(defaultRenderName);
+            defaultRender = (Render) renders.get(defaultRenderName);
         }
 
         // get the web manager root path
@@ -582,7 +577,7 @@
      * @return The value of the named property as a string or <code>def</code>
      *         if the property does not exist
      */
-    private String getProperty(Dictionary<String, Object> config, String name,
+    private String getProperty(Dictionary config, String name,
             String def) {
         Object value = config.get(name);
         if (value instanceof String) {
@@ -596,9 +591,9 @@
         return String.valueOf(value);
     }
 
-    private Dictionary<String, String> toStringConfig(Dictionary<?, ?> config)
{
-        Dictionary<String, String> stringConfig = new Hashtable<String, String>();
-        for (Enumeration<?> ke = config.keys(); ke.hasMoreElements();) {
+    private Dictionary toStringConfig(Dictionary config) {
+        Dictionary stringConfig = new Hashtable();
+        for (Enumeration ke = config.keys(); ke.hasMoreElements();) {
             Object key = ke.nextElement();
             stringConfig.put(key.toString(), String.valueOf(config.get(key)));
         }

Modified: felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/GCAction.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/GCAction.java?rev=657050&r1=657025&r2=657050&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/GCAction.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/GCAction.java
Fri May 16 06:09:35 2008
@@ -14,12 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sling.osgi.console.web.internal.system;
+package org.apache.sling.felix.webconsole.internal.system;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.sling.osgi.console.web.Action;
+import org.apache.sling.felix.webconsole.Action;
 
 public class GCAction implements Action {
 

Modified: felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/ShutdownAction.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/ShutdownAction.java?rev=657050&r1=657025&r2=657050&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/ShutdownAction.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/ShutdownAction.java
Fri May 16 06:09:35 2008
@@ -14,13 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sling.osgi.console.web.internal.system;
+package org.apache.sling.felix.webconsole.internal.system;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.sling.osgi.console.web.Action;
-import org.apache.sling.osgi.console.web.internal.BaseManagementPlugin;
+import org.apache.sling.felix.webconsole.Action;
+import org.apache.sling.felix.webconsole.internal.BaseManagementPlugin;
 import org.osgi.framework.BundleException;
 import org.osgi.service.log.LogService;
 

Modified: felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/ShutdownRender.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/ShutdownRender.java?rev=657050&r1=657025&r2=657050&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/ShutdownRender.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/ShutdownRender.java
Fri May 16 06:09:35 2008
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sling.osgi.console.web.internal.system;
+package org.apache.sling.felix.webconsole.internal.system;
 
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -22,7 +22,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.sling.osgi.console.web.Render;
+import org.apache.sling.felix.webconsole.Render;
 
 public class ShutdownRender implements Render {
 

Modified: felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/VMStatRender.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/VMStatRender.java?rev=657050&r1=657025&r2=657050&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/VMStatRender.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/sling/felix/webconsole/internal/system/VMStatRender.java
Fri May 16 06:09:35 2008
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sling.osgi.console.web.internal.system;
+package org.apache.sling.felix.webconsole.internal.system;
 
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -23,10 +23,10 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.sling.osgi.console.web.Render;
-import org.apache.sling.osgi.console.web.internal.BaseManagementPlugin;
-import org.apache.sling.osgi.console.web.internal.Util;
-import org.apache.sling.osgi.console.web.internal.core.SetStartLevelAction;
+import org.apache.sling.felix.webconsole.Render;
+import org.apache.sling.felix.webconsole.internal.BaseManagementPlugin;
+import org.apache.sling.felix.webconsole.internal.Util;
+import org.apache.sling.felix.webconsole.internal.core.SetStartLevelAction;
 
 public class VMStatRender extends BaseManagementPlugin implements Render {
 

Modified: felix/trunk/webconsole/src/main/resources/OSGI-INF/metatype/metatype.properties
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=657050&r1=657049&r2=657050&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/OSGI-INF/metatype/metatype.properties (original)
+++ felix/trunk/webconsole/src/main/resources/OSGI-INF/metatype/metatype.properties Fri May
16 06:09:35 2008
@@ -22,8 +22,8 @@
 # descriptions as used in the metatype.xml descriptor generated by the
 # the Sling SCR plugin
 
-manager.name = Sling Management Console
-manager.description = Configuration of the Sling Management Console.
+manager.name = OSGi Management Console
+manager.description = Configuration of the OSGi Management Console.
 
 manager.root.name = Root URI
 manager.root.description = The root path to the Sling Management Console.



Mime
View raw message