1 25 26 package org.objectweb.jonas.webapp.jonasadmin.deploy; 27 28 import java.io.IOException ; 29 import java.util.ArrayList ; 30 31 import javax.management.ObjectName ; 32 import javax.servlet.ServletException ; 33 import javax.servlet.http.HttpServletRequest ; 34 import javax.servlet.http.HttpServletResponse ; 35 36 import org.apache.struts.action.ActionForm; 37 import org.apache.struts.action.ActionForward; 38 import org.apache.struts.action.ActionMapping; 39 import org.objectweb.jonas.jmx.JonasManagementRepr; 40 import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx; 41 42 46 47 public class DomainDeployAction extends BaseDeployAction { 48 49 51 public ActionForward executeAction(ActionMapping p_Mapping, 52 ActionForm p_Form, HttpServletRequest p_Request, 53 HttpServletResponse p_Response) throws IOException , 54 ServletException { 55 56 DomainDeployForm oForm = (DomainDeployForm) p_Form; 58 try { 59 ArrayList alDeployable = JonasAdminJmx.getWarFilesDeployable(); 61 alDeployable.addAll(JonasAdminJmx.getWarFilesDeployed()); 62 alDeployable.addAll(JonasAdminJmx.getWarFilesDeployable()); 63 64 ArrayList alServers = new ArrayList (); 66 ObjectName on = JonasAdminJmx.getJ2eeDomainObjectName(); 67 Object oValue = JonasManagementRepr.getAttribute(on, "servers"); 68 Object [] servers = (Object []) oValue; 69 for(int j = 0; j < servers.length; j++) { 70 alServers.add(servers[j]); 71 } 72 73 oForm.setListDeployable(alDeployable); 75 oForm.setListServers(alServers); 76 77 oForm.setConfirm(true); 78 79 80 } catch (Throwable t) { 81 addGlobalError(t); 82 saveErrors(p_Request, m_Errors); 83 return (p_Mapping.findForward("Global Error")); 84 } 85 86 return (p_Mapping.findForward("Domain Deploy")); 88 } 89 90 } 91 | Popular Tags |