1 25 26 package org.objectweb.jonas.webapp.jonasadmin.jonasserver; 27 28 import java.io.IOException ; 29 30 import javax.management.ObjectName ; 31 import javax.servlet.ServletException ; 32 import javax.servlet.http.HttpServletRequest ; 33 import javax.servlet.http.HttpServletResponse ; 34 35 import org.apache.struts.action.ActionForm; 36 import org.apache.struts.action.ActionForward; 37 import org.apache.struts.action.ActionMapping; 38 import org.objectweb.jonas.jmx.J2eeObjectName; 39 import org.objectweb.jonas.jmx.JonasManagementRepr; 40 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction; 41 42 45 public class JonasServerStopAction extends JonasBaseAction { 46 47 49 66 public ActionForward executeAction(ActionMapping pMapping, ActionForm pForm 67 , HttpServletRequest pRequest, HttpServletResponse pResponse) 68 throws IOException , ServletException { 69 try { 70 ObjectName oObjectName = J2eeObjectName.J2EEServer(m_WhereAreYou.getCurrentDomainName() 72 , m_WhereAreYou.getCurrentJonasServerName()); 73 JonasManagementRepr.invoke(oObjectName, "stop", null, null); 75 } catch (Throwable t) { 76 addGlobalError(t); 77 saveErrors(pRequest, m_Errors); 78 return (pMapping.findForward("Global Error")); 79 } 80 81 return (pMapping.findForward("JonasServer")); 83 } 84 } 85 | Popular Tags |