geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1075695 - in /geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console: apache/jk/ infomanager/ logmanager/ repository/ webmanager/
Date Tue, 01 Mar 2011 08:02:42 GMT
Author: xuhaihong
Date: Tue Mar  1 08:02:41 2011
New Revision: 1075695

URL: http://svn.apache.org/viewvc?rev=1075695&view=rev
Log:
No function change.
1. Use valueOf instead of new for primitive wrapper
2. Remove some unused variables in the codes

Modified:
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/apache/jk/AJPHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/apache/jk/AJPHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/apache/jk/AJPHandler.java?rev=1075695&r1=1075694&r2=1075695&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/apache/jk/AJPHandler.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/apache/jk/AJPHandler.java
Tue Mar  1 08:02:41 2011
@@ -27,7 +27,6 @@ import org.slf4j.LoggerFactory;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.management.geronimo.NetworkConnector;
-import org.apache.geronimo.management.geronimo.WebConnector;
 import org.apache.geronimo.management.geronimo.WebManager;
 
 /**
@@ -71,7 +70,7 @@ public class AJPHandler extends BaseApac
             break;
         }
 
-        ((ApacheModel)model).setAddAjpPort(new Integer(port));
+        ((ApacheModel)model).setAddAjpPort(Integer.valueOf(port));
 
         return getMode();
     }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java?rev=1075695&r1=1075694&r2=1075695&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java
Tue Mar  1 08:02:41 2011
@@ -84,7 +84,7 @@ public class ServerInfoPortlet extends B
         jvmProps.put("Java Version", jvm.getJavaVersion());
         jvmProps.put("Java Vendor", jvm.getJavaVendor());
         jvmProps.put("Node", jvm.getNode());
-        jvmProps.put("Available Processors", new Integer(jvm.getAvailableProcessors()));
+        jvmProps.put("Available Processors", Integer.valueOf(jvm.getAvailableProcessors()));
         renderRequest.setAttribute("jvmProps", jvmProps);
 
         if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java?rev=1075695&r1=1075694&r2=1075695&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java
Tue Mar  1 08:02:41 2011
@@ -54,7 +54,7 @@ public class LogManagerPortlet extends B
 //        renderRequest.setAttribute("configuration", LogHelper.getConfiguration());
         renderRequest.setAttribute("logLevel", log.getRootLoggerLevel());
         try{
-            renderRequest.setAttribute("refreshPeriod", new Integer(log.getRefreshPeriodSeconds()));
+            renderRequest.setAttribute("refreshPeriod", Integer.valueOf(log.getRefreshPeriodSeconds()));
         }catch(NumberFormatException e){
             //ignore
         }
@@ -76,7 +76,7 @@ public class LogManagerPortlet extends B
         String action = actionRequest.getParameter("action");
         String logLevel = actionRequest.getParameter("logLevel");
         String configFile = actionRequest.getParameter("configFile");
-        String configuration = actionRequest.getParameter("append");
+        //String configuration = actionRequest.getParameter("append");
         String refreshPeriod = actionRequest.getParameter("refreshPeriod");
         String currentLevel = log.getRootLoggerLevel();
 

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java?rev=1075695&r1=1075694&r2=1075695&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
Tue Mar  1 08:02:41 2011
@@ -130,7 +130,7 @@ public class LogViewerPortlet extends Ba
         SystemLog.SearchResults results = log.getMatchingItems(criteria.logFile, criteria.start,
criteria.stop,
                         criteria.level, criteria.text, criteria.max, criteria.stackTraces);
         renderRequest.setAttribute("searchResults", results.getResults());
-        renderRequest.setAttribute("lineCount", new Integer(results.getLineCount()));
+        renderRequest.setAttribute("lineCount", Integer.valueOf(results.getLineCount()));
         renderRequest.setAttribute("startPos", criteria.start);
         renderRequest.setAttribute("endPos", criteria.stop);
         renderRequest.setAttribute("logLevel", criteria.level);

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java?rev=1075695&r1=1075694&r2=1075695&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java
Tue Mar  1 08:02:41 2011
@@ -263,7 +263,7 @@ public class WebAccessLogViewerPortlet e
                 WebAccessLog.SearchResults matchingItems = chosenLog.getMatchingItems(logToSearch,
                                                 requestHost, authUser, requestMethod, requestedURI,
fromDate, toDate, iStartResult, Integer.valueOf(iMaxResult.intValue()-1));
                 renderRequest.setAttribute("logs", matchingItems.getResults());
-                renderRequest.setAttribute("logLength", new Integer(matchingItems.getLineCount()));
+                renderRequest.setAttribute("logLength", Integer.valueOf(matchingItems.getLineCount()));
             }
             renderRequest.setAttribute("ignoreDates", Boolean.valueOf(ignoreDates));
             renderRequest.setAttribute("requestHost", requestHost);
@@ -308,7 +308,7 @@ public class WebAccessLogViewerPortlet e
         }
     }
     private static class Criteria implements Serializable {
-        Integer maxResult = new Integer(DEFAULT_MAX_RESULTS);
+        Integer maxResult = Integer.valueOf(DEFAULT_MAX_RESULTS);
         String fromDate = null;
         String toDate = null;
         boolean ignoreDates = false;

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java?rev=1075695&r1=1075694&r2=1075695&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java
Tue Mar  1 08:02:41 2011
@@ -96,8 +96,6 @@ public class RepositoryViewPortlet exten
 
         try {
 
-
-            List list = new ArrayList();
             WriteableRepository repo = PortletManager.getCurrentServer(actionRequest).getWritableRepositories()[0];
 
             File uploadFile = null;
@@ -218,7 +216,7 @@ public class RepositoryViewPortlet exten
             request.setAttribute("groupId", parts[0]);
             request.setAttribute("artifactId", parts[1]);
             request.setAttribute("version", parts[2]);
-            request.setAttribute("type", parts[3]);        
+            request.setAttribute("type", parts[3]);
             usageView.include(request, response);
             return;
         }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java?rev=1075695&r1=1075694&r2=1075695&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
Tue Mar  1 08:02:41 2011
@@ -65,7 +65,7 @@ import org.slf4j.LoggerFactory;
  */
 public class ConnectorPortlet extends BasePortlet {
     private static final Logger log = LoggerFactory.getLogger(ConnectorPortlet.class);
-    
+
     public static final String PARM_CONTAINER_URI = "containerURI";
     public static final String PARM_CONNECTOR_URI = "connectorURI";
     public static final String PARM_MANAGER_URI = "managerURI";
@@ -88,7 +88,7 @@ public class ConnectorPortlet extends Ba
             actionResponse.setRenderParameter(PARM_MODE, "list");
             return;
         }
-        
+
         String mode = actionRequest.getParameter(PARM_MODE);
         String managerURI = actionRequest.getParameter(PARM_MANAGER_URI);
         String containerURI = actionRequest.getParameter(PARM_CONTAINER_URI);
@@ -112,7 +112,7 @@ public class ConnectorPortlet extends Ba
             // Create and configure the connector
             WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
             ConnectorType connectorType = new ConnectorType(actionRequest.getParameter(PARM_CONNECTOR_TYPE));
-            
+
             String uniqueName = actionRequest.getParameter(PARM_DISPLAY_NAME);
             actionResponse.setRenderParameter(PARM_DISPLAY_NAME, uniqueName);
             // set the connector attributes from the form post
@@ -120,7 +120,7 @@ public class ConnectorPortlet extends Ba
             for (ConnectorAttribute attribute : connectorAttributes) {
                 String name = attribute.getAttributeName();
                 String value = actionRequest.getParameter(name);
-                
+
                 // handle booelan type special
                 if (attribute.getAttributeClass().equals(Boolean.class)) {
                     // browser sends value of checked checkbox as "on" or "checked"
@@ -142,10 +142,10 @@ public class ConnectorPortlet extends Ba
             }
             // create the connector gbean based on the configuration data
             AbstractName newConnectorName = manager.getConnectorConfiguration(connectorType,
connectorAttributes, webContainer, uniqueName);
-            
+
             // set the keystore properties if its a secure connector
             setKeystoreProperties(actionRequest, newConnectorName);
-            
+
             // Start the connector
             try {
                 GeronimoManagedBean managedBean = PortletManager.getManagedBean(actionRequest,
newConnectorName);
@@ -153,7 +153,7 @@ public class ConnectorPortlet extends Ba
             } catch (Exception e) {
                 log.error("Unable to start connector", e); //TODO: get into rendered page
             }
-            
+
             try {
                 manager.updateConnectorConfig(newConnectorName);
             } catch (Exception e) {
@@ -171,18 +171,18 @@ public class ConnectorPortlet extends Ba
                 connectorGBeanData=PortletManager.getKernel().getGBeanData(connectorName);
             } catch (Exception e) {
                 log.error("Unable to get connectorGBeanData by abstractName:"+connectorName.toURI(),
e);
-            } 
-            
+            }
+
             NetworkConnector connector = PortletManager.getNetworkConnector(actionRequest,
connectorName);
             if(connector != null) {
                 WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
                 ConnectorType connectorType = manager.getConnectorType(connectorName);
-                
+
                 // set the connector attributes from the form post
                 for (ConnectorAttribute attribute : manager.getConnectorAttributes(connectorType))
{
                     String name = attribute.getAttributeName();
                     String value = actionRequest.getParameter(name);
-                    
+
                     // handle booelan type special
                     if (attribute.getAttributeClass().equals(Boolean.class)) {
                         // browser sends value of checked checkbox as "on" or "checked"
@@ -196,11 +196,11 @@ public class ConnectorPortlet extends Ba
                     if (value == null || value.trim().length()<1) {
                         // special case for KeystoreManager gbean
                         if ("trustStore".equals(attribute.getAttributeName())) {
-                            
+
                             connectorGBeanData.setAttribute(name, null);
                         }
                     } else {
-                        // set the string value on the ConnectorAttribute so 
+                        // set the string value on the ConnectorAttribute so
                         // it can handle type conversion via getValue()
                         try {
                             attribute.setStringValue(value);
@@ -210,10 +210,10 @@ public class ConnectorPortlet extends Ba
                         }
                     }
                 }
-                
+
                 // set the keystore properties if its a secure connector
                 setKeystoreProperties(actionRequest, connectorName);
-                
+
                 try {
                     Kernel kernel = PortletManager.getKernel();
                     BundleContext bundleContext = kernel.getBundleFor(connectorName).getBundleContext();
@@ -224,8 +224,8 @@ public class ConnectorPortlet extends Ba
                 } catch (Exception e) {
                     log.error("Unable to reload updated connector:" + connectorName.toURI(),
e);
                 }
-                
-                
+
+
                 try {
                     manager.updateConnectorConfig(connectorName);
                 } catch (Exception e) {
@@ -339,7 +339,7 @@ public class ConnectorPortlet extends Ba
                     ConnectorType connectorType = webManager.getConnectorType(connectorName);
                     List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(connectorType);
                     sortConnectorAttributes(connectorAttributes);
-                    
+
                     // populate the connector attributes from the connector
                     for (ConnectorAttribute attribute : connectorAttributes) {
                         try {
@@ -349,13 +349,13 @@ public class ConnectorPortlet extends Ba
                             log.error("Unable to retrieve value of property " + attribute.getAttributeName(),
e);
                         }
                     }
-                    
+
                     renderRequest.setAttribute(PARM_CONNECTOR_ATTRIBUTES, connectorAttributes);
                     renderRequest.setAttribute(PARM_CONNECTOR_URI, connectorURI);
                     // populate any enum type values.  the browser will render them in a
                     // <SELECT> input for the attribute
                     populateEnumAttributes(renderRequest);
-                    
+
                     renderRequest.setAttribute(PARM_MODE, "save");
                     editConnectorView.include(renderRequest, renderResponse);
                 }
@@ -388,7 +388,7 @@ public class ConnectorPortlet extends Ba
         for (int i = 0; i < managers.length; i++) {
             WebManager manager = managers[i];
             AbstractName webManagerName = PortletManager.getNameFor(renderRequest, manager);
-            
+
             WebContainer[] containers = (WebContainer[]) manager.getContainers();
             for (int j = 0; j < containers.length; j++) {
                 List<ConnectorInfo> beans = new ArrayList<ConnectorInfo>();
@@ -426,7 +426,7 @@ public class ConnectorPortlet extends Ba
             addWarningMessage(renderRequest, "warnMsg08");
         }
         renderRequest.setAttribute("containers", all);
-        renderRequest.setAttribute("serverPort", new Integer(renderRequest.getServerPort()));
+        renderRequest.setAttribute("serverPort", Integer.valueOf(renderRequest.getServerPort()));
 
         if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
             normalView.include(renderRequest, renderResponse);
@@ -502,23 +502,23 @@ public class ConnectorPortlet extends Ba
     public static boolean isValid(String s) {
         return s != null && !s.equals("");
     }
-    
+
     // stash any 'enum' type values for attributes.  right now this is
     // hardcoded, need to promote these to the ConnectorAttribute apis
     private void populateEnumAttributes(PortletRequest request) {
         HashMap<String,String[]> enumValues = new HashMap<String,String[]>();
-        
+
         // provide the two possible values for secure protocol - TLS and SSL
         enumValues.put("secureProtocol", new String[] { "TLS", "SSL" }); //jetty
         enumValues.put("sslProtocol", new String[] { "TLS", "SSL" }); //tomcat
-        
+
         // keystore and truststore types for tomcat
         enumValues.put("keystoreType", KeystoreUtil.keystoreTypes.toArray(new String[0]));
         enumValues.put("truststoreType", KeystoreUtil.keystoreTypes.toArray(new String[0]));
 
-        // provide the three possible values for secure algorithm - Default, SunX509, and
IbmX509 
+        // provide the three possible values for secure algorithm - Default, SunX509, and
IbmX509
         enumValues.put("algorithm", new String[] { "Default", "SunX509", "IbmX509" });
-        
+
         // provide the possible values for the keystore name
         KeystoreManager mgr = PortletManager.getCurrentServer(request).getKeystoreManager();
         KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
@@ -527,7 +527,7 @@ public class ConnectorPortlet extends Ba
             storeNames[i] = stores[i].getKeystoreName();
         }
         enumValues.put("keyStore", storeNames);
-        
+
         // provide the possible values for the trust store name
         KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
         String[] trustNames = new String[trusts.length];
@@ -535,10 +535,10 @@ public class ConnectorPortlet extends Ba
             trustNames[i] = trusts[i].getKeystoreName();
         }
         enumValues.put("trustStore", trustNames);
-        
+
         request.setAttribute("geronimoConsoleEnumValues", enumValues);
     }
-    
+
     // get the special keystore properties from the request and set them on the connector
     // TODO: need a more generic way to handle this
     private void setKeystoreProperties(PortletRequest request, AbstractName connectorName)
throws PortletException {
@@ -551,13 +551,13 @@ public class ConnectorPortlet extends Ba
         if (!(connector instanceof SecureConnector)) {
             return;
         }
-        
+
         // right now only jetty supports the KeystoreManager
         if (server.equals(WEB_SERVER_JETTY)) {
             String keyStore = request.getParameter("keyStore");
-            
+
             // get the unlocked keystore object from the keystore managaer
-            // gbean and set its keyalias directly on the connector 
+            // gbean and set its keyalias directly on the connector
             try {
                 KeystoreInstance[] keystores = PortletManager.getCurrentServer(request)
                         .getKeystoreManager().getKeystores();

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java?rev=1075695&r1=1075694&r2=1075695&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
Tue Mar  1 08:02:41 2011
@@ -147,11 +147,11 @@ public class WebManagerPortlet extends B
                             // renderRequest.setAttribute("requestDurationAvg", new Long(webStats.getRequestDurationAvg().getCount()));
                             long avg = count == 0 ? 0 : totalTime / count;
                             renderRequest.setAttribute("requestDurationAvg", avg);
-                            renderRequest.setAttribute("response1xx", new Long(webStats.getResponses1xx().getCount()));
-                            renderRequest.setAttribute("response2xx", new Long(webStats.getResponses2xx().getCount()));
-                            renderRequest.setAttribute("response3xx", new Long(webStats.getResponses3xx().getCount()));
-                            renderRequest.setAttribute("response4xx", new Long(webStats.getResponses4xx().getCount()));
-                            renderRequest.setAttribute("response5xx", new Long(webStats.getResponses5xx().getCount()));
+                            renderRequest.setAttribute("response1xx", Long.valueOf(webStats.getResponses1xx().getCount()));
+                            renderRequest.setAttribute("response2xx", Long.valueOf(webStats.getResponses2xx().getCount()));
+                            renderRequest.setAttribute("response3xx", Long.valueOf(webStats.getResponses3xx().getCount()));
+                            renderRequest.setAttribute("response4xx", Long.valueOf(webStats.getResponses4xx().getCount()));
+                            renderRequest.setAttribute("response5xx", Long.valueOf(webStats.getResponses5xx().getCount()));
                             renderRequest.setAttribute("elapsedTime", TimeUtils.formatDuration(webStats.getStatsOnMs().getCount()));
                         }
                     } else {



Mime
View raw message