geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r816095 - in /geronimo/server/branches/2.2/plugins: console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/
Date Thu, 17 Sep 2009 08:35:13 GMT
Author: genspring
Date: Thu Sep 17 08:35:12 2009
New Revision: 816095

URL: http://svn.apache.org/viewvc?rev=816095&view=rev
Log:
GERONIMO-4879 Unable accessing created connector after changing its port number

Modified:
    geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
    geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java

Modified: geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java?rev=816095&r1=816094&r2=816095&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
Thu Sep 17 08:35:12 2009
@@ -36,12 +36,13 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.crypto.KeystoreUtil;
 import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
 import org.apache.geronimo.management.geronimo.KeystoreException;
 import org.apache.geronimo.management.geronimo.KeystoreInstance;
@@ -52,7 +53,8 @@
 import org.apache.geronimo.management.geronimo.WebManager;
 import org.apache.geronimo.management.geronimo.WebManager.ConnectorAttribute;
 import org.apache.geronimo.management.geronimo.WebManager.ConnectorType;
-import org.apache.geronimo.crypto.KeystoreUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A portlet that lets you list, add, remove, start, stop, restart and edit web
@@ -163,6 +165,13 @@
             String connectorURI = actionRequest.getParameter(PARM_CONNECTOR_URI);
             // Identify and update the connector
             AbstractName connectorName = new AbstractName(URI.create(connectorURI));
+            GBeanData connectorGBeanData=null;
+            try {
+                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)));
@@ -186,14 +195,15 @@
                     if (value == null || value.trim().length()<1) {
                         // special case for KeystoreManager gbean
                         if ("trustStore".equals(attribute.getAttributeName())) {
-                            setProperty(connector,name,null);
+                            
+                            connectorGBeanData.setAttribute(name, null);
                         }
                     } else {
                         // set the string value on the ConnectorAttribute so 
                         // it can handle type conversion via getValue()
                         try {
                             attribute.setStringValue(value);
-                            setProperty(connector,name,attribute.getValue());
+                            connectorGBeanData.setAttribute(name, attribute.getValue());
                         } catch (Exception e) {
                             log.error("Unable to set property " + attribute.getAttributeName(),
e);
                         }
@@ -202,6 +212,22 @@
                 
                 // set the keystore properties if its a secure connector
                 setKeystoreProperties(actionRequest, connectorName);
+                
+                try {
+                    Kernel kernel=PortletManager.getKernel();
+                    ClassLoader oldCL=connector.getClass().getClassLoader();
+                    kernel.stopGBean(connectorName);
+                    kernel.unloadGBean(connectorName);
+                    
+                    
+                    kernel.loadGBean(connectorGBeanData, oldCL);
+                    kernel.startGBean(connectorName);
+                  
+                } catch (Exception e) {
+                    log.error("Unable to reload updated connector:"+connectorName.toURI(),
e);
+                }
+                
+                
                 try {
                     manager.updateConnectorConfig(connectorName);
                 } catch (Exception e) {

Modified: geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java?rev=816095&r1=816094&r2=816095&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java
(original)
+++ geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java
Thu Sep 17 08:35:12 2009
@@ -153,7 +153,7 @@
         if (executor != null)
 
         {
-            log.info("executor"+executor.getName()+" found, set it to connector:"+this.getName()
);     
+            log.info("executor:"+executor.getName()+" found, set it to connector:"+this.getName()
);     
 
             try {
 



Mime
View raw message