geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1245327 - in /geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main: i18n-resources/ java/org/apache/geronimo/console/webmanager/
Date Fri, 17 Feb 2012 07:06:41 GMT
Author: xiaming
Date: Fri Feb 17 07:06:41 2012
New Revision: 1245327

URL: http://svn.apache.org/viewvc?rev=1245327&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 3.0-beta

Modified:
    geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
    geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties
    geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
    geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java

Modified: geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties?rev=1245327&r1=1245326&r2=1245327&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
(original)
+++ geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
Fri Feb 17 07:06:41 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/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties?rev=1245327&r1=1245326&r2=1245327&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties
(original)
+++ geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties
Fri Feb 17 07:06:41 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/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties?rev=1245327&r1=1245326&r2=1245327&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
(original)
+++ geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
Fri Feb 17 07:06:41 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/branches/3.0-beta/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java?rev=1245327&r1=1245326&r2=1245327&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
(original)
+++ geronimo/server/branches/3.0-beta/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
Fri Feb 17 07:06:41 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");



Mime
View raw message