Reload the web application at the specified context path. @param writer Writer to render to @param cn Name of the application to be restarted @param smClient i18n support for current client's locale
(PrintWriter writer, ContextName cn, StringManager smClient)
| 1081 | * @param smClient i18n support for current client's locale |
| 1082 | */ |
| 1083 | protected void reload(PrintWriter writer, ContextName cn, StringManager smClient) { |
| 1084 | |
| 1085 | if (debug >= 1) { |
| 1086 | log("restart: Reloading web application '" + cn + "'"); |
| 1087 | } |
| 1088 | |
| 1089 | if (!validateContextName(cn, writer, smClient)) { |
| 1090 | return; |
| 1091 | } |
| 1092 | |
| 1093 | String name = cn.getName(); |
| 1094 | try { |
| 1095 | if (tryAddServiced(name)) { |
| 1096 | try { |
| 1097 | // Validates the Context of the specified application |
| 1098 | Context context = getContextForName(cn, writer, smClient); |
| 1099 | if (context == null) { |
| 1100 | return; |
| 1101 | } |
| 1102 | context.reload(); |
| 1103 | writer.println(smClient.getString("managerServlet.reloaded", cn.getDisplayName())); |
| 1104 | } finally { |
| 1105 | removeServiced(name); |
| 1106 | } |
| 1107 | } else { |
| 1108 | writer.println(smClient.getString("managerServlet.inService", cn.getDisplayName())); |
| 1109 | } |
| 1110 | } catch (Throwable t) { |
| 1111 | ExceptionUtils.handleThrowable(t); |
| 1112 | log(sm.getString("managerServlet.error.reload", cn.getDisplayName()), t); |
| 1113 | writer.println(smClient.getString("managerServlet.exception", t.toString())); |
| 1114 | } |
| 1115 | } |
| 1116 | |
| 1117 | |
| 1118 | /** |
no test coverage detected