1 25 26 package org.objectweb.jonas.webapp.jonasadmin.mbean; 27 28 import java.io.IOException ; 29 import java.util.ArrayList ; 30 import java.util.Collections ; 31 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.webapp.jonasadmin.JonasAdminJmx; 40 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction; 41 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 42 import org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator; 43 44 49 50 public final class ListOwnerMBeansAction extends JonasBaseAction { 51 52 54 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 55 , HttpServletRequest p_Request, HttpServletResponse p_Response) 56 throws IOException , ServletException { 57 58 m_WhereAreYou.selectNameNode(getTreeBranchName(DEPTH_SERVER) 60 + WhereAreYou.NODE_SEPARATOR 61 + "owner", true); 62 63 try { 64 ArrayList list = new ArrayList (); 65 ArrayList [] als = JonasAdminJmx.getFamiliesMbeansLists(); 66 Collections.sort(als[MbeanItem.FAMILY_OWNER], new BeanComparator(new String [] { 67 "domain", "type", "objectName"})); 68 p_Request.setAttribute("OwnerMBeans", als[MbeanItem.FAMILY_OWNER]); 69 } catch (Throwable t) { 70 addGlobalError(t); 71 saveErrors(p_Request, m_Errors); 72 return (p_Mapping.findForward("Global Error")); 73 } 74 return p_Mapping.findForward("List OwnerMBeans"); 76 } 77 78 } 79 | Popular Tags |