You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xi...@apache.org on 2012/02/17 08:10:29 UTC
svn commit: r1245328 - in
/geronimo/server/trunk/plugins/console/console-base-portlets/src/main:
i18n-resources/ java/org/apache/geronimo/console/webmanager/
Author: xiaming
Date: Fri Feb 17 07:10:29 2012
New Revision: 1245328
URL: http://svn.apache.org/viewvc?rev=1245328&view=rev
Log:
GERONIMO-6276 Not restart connector if user wants to update the serving connector and feed back a warning message in the portlet, for trunk
Modified:
geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties
geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties?rev=1245328&r1=1245327&r2=1245328&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties Fri Feb 17 07:10:29 2012
@@ -134,6 +134,8 @@ consolebase.errorMsg21 = Unable to get n
consolebase.errorMsg22 = Errors in user input while processing a CSR.
consolebase.errorMsg23 = Errors encountered while issuing certificate.
consolebase.errorMsg24 = Default properties-login module does not exist, it might be replaced by a customized login module.
+consolebase.errorMsg25 = Unable to reload updated connector <b>{0}</b>.
+consolebase.errorMsg26 = Unable to update connector in var/catalina/server.xml.
consolebase.infoMsg01 = Started application
consolebase.infoMsg02 = Stopped application
consolebase.infoMsg03 = Restarted application
@@ -161,6 +163,7 @@ consolebase.warnMsg05 = CA is not runni
consolebase.warnMsg06 = A certificate with the serial number <b>{0}</b> has already been issued. You might be seeing this message since you have clicked 'Issue Certificate' button a second time.
consolebase.warnMsg07 = A shutdown of the server will disable this Web Console! Proceed only if you are certain you want to terminate the server.
consolebase.warnMsg08 = There are no Web Containers defined.
+consolebase.warnMsg09 = Cannot update the serving connector <b>{0}</b>. You can update it via modifying var/catalina/server.xml when server is stopped.
consolebase.bundlemanager.info.start = Bundle: {0} (id={1}) is successfully started.
consolebase.bundlemanager.info.stop = Bundle: {0} (id={1}) is successfully stopped.
Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties?rev=1245328&r1=1245327&r2=1245328&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties Fri Feb 17 07:10:29 2012
@@ -135,6 +135,8 @@ consolebase.errorMsg21 = èªè¨¼å�
consolebase.errorMsg22 = è¨¼ææ¸ç½²åè¦æ±ã®å¦çä¸ã«ã¦ã¼ã¶ã¼å
¥åã®ã¨ã©ã¼ã§ãã
consolebase.errorMsg23 = è¨¼ææ¸ã®çºè¡ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã
consolebase.errorMsg24 = ããã©ã«ãã® properties-login ã¢ã¸ã¥ã¼ã«ãåå¨ãã¾ãããã«ã¹ã¿ãã¤ãºããããã°ã¤ã³ã»ã¢ã¸ã¥ã¼ã«ã«ç½®æããå¯è½æ§ãããã¾ãã
+consolebase.errorMsg25 = Unable to reload updated connector <b>{0}</b>.
+consolebase.errorMsg26 = Unable to update connector in var/catalina/server.xml.
consolebase.infoMsg01 = ã¢ããªã±ã¼ã·ã§ã³ãå§åãã¾ãã
consolebase.infoMsg02 = ã¢ããªã±ã¼ã·ã§ã³ã忢ãã¾ãã
consolebase.infoMsg03 = ã¢ããªã±ã¼ã·ã§ã³ãåå§åãã¾ãã
@@ -161,6 +163,7 @@ consolebase.warnMsg05 = èªè¨¼å�
consolebase.warnMsg06 = ã·ãªã¢ã«çªå· <b>{0}</b> ã®è¨¼ææ¸ã¯ãã§ã«çºè¡æ¸ã¿ã§ãã'è¨¼ææ¸ã®çºè¡' ãã¿ã³ã 2 åã¯ãªãã¯ããããããã®ã¡ãã»ã¼ã¸ã確èªããå¯è½æ§ãããã¾ãã
consolebase.warnMsg07 = ãµã¼ãã¼ã®ã·ã£ãããã¦ã³ã¯ããã® Web ã³ã³ã½ã¼ã«ãç¡å¹åãã¾ã! ãµã¼ãã¼ãå¼·å¶çµäºããããå ´åã®ã¿ç¶è¡ãã¦ãã ããã
consolebase.warnMsg08 = Web ã³ã³ããã¼ãå®ç¾©ãã¦ãã¾ããã
+consolebase.warnMsg09 = Cannot update the serving connector <b>{0}</b>. You can update it via modifying var/catalina/server.xml when server is stopped.
consolebase.bundlemanager.info.start = Bundle: {0} (id={1}) is successfully started.
consolebase.bundlemanager.info.stop = Bundle: {0} (id={1}) is successfully stopped.
@@ -173,4 +176,4 @@ consolebase.bundlemanager.warn.nobundles
consolebase.bundlemanager.err.actionError = Encountered an unhandled exception while process action:
consolebase.bundlemanager.err.file.uploadError = File upload failed, encounter a FileUploadException.
consolebase.bundlemanager.err.file.writeError = Write file failed, encounter an unhandled exception.
-consolebase.bundlemanager.err.file.nullError = The uploaded file is null.
\ No newline at end of file
+consolebase.bundlemanager.err.file.nullError = The uploaded file is null.
Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties?rev=1245328&r1=1245327&r2=1245328&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties Fri Feb 17 07:10:29 2012
@@ -135,6 +135,8 @@ consolebase.errorMsg21 = æ æ³ä�
consolebase.errorMsg22 = å¤çCSRæ¶ç¨æ·è¾å
¥é误ã
consolebase.errorMsg23 = é¢åè¯ä¹¦æ¶éå°é误ã
consolebase.errorMsg24 = é»è®¤çç»å½æ¨¡åä¸åå¨, å¯è½è¢«èªå®ä¹çç»å½æ¨¡åæ¿æ¢ã
+consolebase.errorMsg25 = Unable to reload updated connector <b>{0}</b>.
+consolebase.errorMsg26 = Unable to update connector in var/catalina/server.xml.
consolebase.infoMsg01 = å·²å¯å¨åºç¨
consolebase.infoMsg02 = 已忢åºç¨
consolebase.infoMsg03 = å·²éå¯åºç¨
@@ -161,6 +163,7 @@ consolebase.warnMsg05 = CAæªå¤�
consolebase.warnMsg06 = åºåå·ä¸º<b>{0}</b>çè¯ä¹¦å
å已被åå¸ï¼å½ä½ ç¹å»äº'åå¸è¯ä¹¦'æé®ä¸¤æ¬¡æ¶ä½ å¯è½ä¼çå°è¿æ¡æ¶æ¯ã
consolebase.warnMsg07 = å
³éæå¡å¨å°ä¼ä½¿Webæ§å¶å°ä¸å¯ç¨ï¼åªæå½ä½ ç¡®å®è¦å
³éæå¡å¨æ¶ï¼æç»§ç»ã
consolebase.warnMsg08 = æªå®ä¹ä»»ä½Web容å¨ã
+consolebase.warnMsg09 = Cannot update the serving connector <b>{0}</b>. You can update it via modifying var/catalina/server.xml when server is stopped.
consolebase.bundlemanager.info.start = Bundle: {0} (id={1}) is successfully started.
consolebase.bundlemanager.info.stop = Bundle: {0} (id={1}) is successfully stopped.
@@ -173,4 +176,4 @@ consolebase.bundlemanager.warn.nobundles
consolebase.bundlemanager.err.actionError = Encountered an unhandled exception while process action:
consolebase.bundlemanager.err.file.uploadError = File upload failed, encounter a FileUploadException.
consolebase.bundlemanager.err.file.writeError = Write file failed, encounter an unhandled exception.
-consolebase.bundlemanager.err.file.nullError = The uploaded file is null.
\ No newline at end of file
+consolebase.bundlemanager.err.file.nullError = The uploaded file is null.
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=1245328&r1=1245327&r2=1245328&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 Fri Feb 17 07:10:29 2012
@@ -173,10 +173,15 @@ public class ConnectorPortlet extends Ba
log.error("Unable to get connectorGBeanData by abstractName:"+connectorName.toURI(), e);
}
+ // Store the port info of the connector currently modified
+ String toBeUpdatedConnectorName = (String) connectorGBeanData.getAttribute("name");
+ Integer toBeUpdatedConnectorPort = (Integer) connectorGBeanData.getAttribute("port");
+
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)) {
@@ -213,23 +218,30 @@ public class ConnectorPortlet extends Ba
// set the keystore properties if its a secure connector
setKeystoreProperties(actionRequest, connectorName);
+
+ if (actionRequest.getServerPort() != toBeUpdatedConnectorPort.intValue()) {
+ try {
+ Kernel kernel = PortletManager.getKernel();
+ BundleContext bundleContext = kernel.getBundleFor(connectorName).getBundleContext();
+ kernel.stopGBean(connectorName);
+ kernel.unloadGBean(connectorName);
+ kernel.loadGBean(connectorGBeanData, bundleContext);
+ kernel.startGBean(connectorName);
+ } catch (Exception e) {
+ log.error("Unable to reload updated connector:" + connectorName.toURI(), e);
+ actionResponse.setRenderParameter("toBeUpdatedConnectorName", toBeUpdatedConnectorName);
+ addErrorMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.errorMsg25", toBeUpdatedConnectorName));
+ }
- try {
- Kernel kernel = PortletManager.getKernel();
- BundleContext bundleContext = kernel.getBundleFor(connectorName).getBundleContext();
- kernel.stopGBean(connectorName);
- kernel.unloadGBean(connectorName);
- kernel.loadGBean(connectorGBeanData, bundleContext);
- kernel.startGBean(connectorName);
- } catch (Exception e) {
- log.error("Unable to reload updated connector:" + connectorName.toURI(), e);
- }
-
-
- try {
- manager.updateConnectorConfig(connectorName);
- } catch (Exception e) {
- log.error("Unable to update connector in server.xml", e); //TODO: get into rendered page
+ try {
+ manager.updateConnectorConfig(connectorName);
+ } catch (Exception e) {
+ log.error("Unable to update connector in server.xml", e);
+ addErrorMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.errorMsg26"));
+ }
+ } else {
+ actionResponse.setRenderParameter("toBeUpdatedConnectorName", toBeUpdatedConnectorName);
+ addWarningMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.warnMsg09", toBeUpdatedConnectorName));
}
}
actionResponse.setRenderParameter(PARM_MODE, "list");