Index: web/src/main/java/org/glassfish/web/admingui/handlers/WebAppHandlers.java =================================================================== --- web/src/main/java/org/glassfish/web/admingui/handlers/WebAppHandlers.java (revision 23586) +++ web/src/main/java/org/glassfish/web/admingui/handlers/WebAppHandlers.java (working copy) @@ -69,12 +69,14 @@ import java.util.List; import java.util.Map; +import javax.enterprise.deploy.spi.Target; import javax.management.ObjectName; import org.glassfish.admingui.common.util.AMXRoot; import org.glassfish.admingui.common.util.AMXUtil; import org.glassfish.admingui.common.util.GuiUtil; import org.glassfish.admingui.common.util.TargetUtil; +import org.glassfish.deployment.client.DeploymentFacility; public class WebAppHandlers { @@ -257,6 +259,28 @@ handlerCtx.setOutputValue("displayType", displayMap.get(appType)); } + @Handler(id = "restartApplication", + input = { + @HandlerInput(name = "appName", type = String.class, required = true) + }) + // TODO: This may have issues with multiple VS/targets. See DeploymentHandler.changeAppStatus() + public static void restartApplication(HandlerContext handlerCtx) { + String appName = (String) handlerCtx.getInputValue("appName"); + String[] targetNames = new String[]{"server"}; + try { + DeploymentFacility df = GuiUtil.getDeploymentFacility(); + df.disable(df.createTargets(targetNames), appName); + df.enable(df.createTargets(targetNames), appName); + if (AMXRoot.getInstance().isEE()) { + GuiUtil.prepareAlert(handlerCtx, "success", "Success", null); + } else { + GuiUtil.prepareAlert(handlerCtx, "success", "Success", null); + } + } catch (Exception ex) { + GuiUtil.handleException(handlerCtx, ex); + } + + } // // /** // *
Handler to set the viewKey which is used to decide if user wants summary or detail view.
@@ -437,4 +461,4 @@
displayMap.put("appclient", GuiUtil.getMessage("deploy.appClient"));
displayMap.put("connector", GuiUtil.getMessage("deploy.rar"));
}
-}
\ No newline at end of file
+}
Index: web/src/main/resources/org/glassfish/web/admingui/Strings.properties
===================================================================
--- web/src/main/resources/org/glassfish/web/admingui/Strings.properties (revision 23584)
+++ web/src/main/resources/org/glassfish/web/admingui/Strings.properties (working copy)
@@ -87,3 +87,6 @@
#deployment
war.deployTitle=Deploy Web Application
war.deployTitleHelp=Specify the location of the web application to deploy. Application can be in packaged war file or specified as a directory.
+
+restart.restart=Restart
+restart.success=The application has been successfully restarted
\ No newline at end of file
Index: web/src/main/resources/webApp/webApplications.jsf
===================================================================
--- web/src/main/resources/webApp/webApplications.jsf (revision 23584)
+++ web/src/main/resources/webApp/webApplications.jsf (working copy)
@@ -38,6 +38,7 @@