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.Jlists; 41 import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx; 42 43 48 49 public class EditDomainDeployAction extends BaseDeployAction { 50 51 53 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 54 , HttpServletRequest p_Request, HttpServletResponse p_Response) 55 throws IOException , ServletException { 56 57 DomainDeployForm oForm = (DomainDeployForm) p_Form; 59 try { 60 setCurrentJonasDeployment(p_Request); 62 ArrayList alDeployable = getListDeployableFiles(); 64 65 ArrayList alServers = new ArrayList (); 67 ObjectName on = JonasAdminJmx.getJ2eeDomainObjectName(); 68 Object oValue = JonasManagementRepr.getAttribute(on, "servers"); 69 Object [] servers = (Object []) oValue; 70 for (int j = 0; j < servers.length; j++) { 71 alServers.add(servers[j]); 72 } 73 74 ArrayList alServerNames = new ArrayList (); 77 for (int j = 0; j < alServers.size(); j++) { 78 alServerNames.add(j, ObjectName.getInstance((String ) alServers.get(j)).getKeyProperty("name")); 79 } 80 81 ArrayList alDeploy = new ArrayList (alDeployable); 83 84 oForm.setListDeployable(alDeployable); 86 oForm.setListServers(alServers); 87 oForm.setListServerNames(alServerNames); 88 oForm.setListDeploy(alDeploy); 89 oForm.setDeploy(Jlists.getString(alDeploy, Jlists.SEPARATOR)); 90 91 } 92 catch (Throwable t) { 93 addGlobalError(t); 94 saveErrors(p_Request, m_Errors); 95 return (p_Mapping.findForward("Global Error")); 96 } 97 return (p_Mapping.findForward(getForwardEdit())); 99 } 100 101 } 102 | Popular Tags |