1 25 26 package org.objectweb.jonas.webapp.jonasadmin.service; 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.jmx.JonasObjectName; 40 import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx; 41 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction; 42 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 43 44 47 48 public class ListServicesAction extends JonasBaseAction { 49 50 52 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 53 , HttpServletRequest p_Request, HttpServletResponse p_Response) 54 throws IOException , ServletException { 55 56 m_WhereAreYou.selectNameNode(getTreeBranchName(DEPTH_SERVER) + WhereAreYou.NODE_SEPARATOR 58 + "services", true); 59 60 try { 62 ArrayList al = new ArrayList (); 63 al.add(new ServiceItem(m_Resources.getMessage("treenode.jonas.server.services.ear") 65 , JonasAdminJmx.hasMBeanName(JonasObjectName.earService()) 66 , "ActionListAppContainers")); 67 al.add(new ServiceItem(m_Resources.getMessage( 68 "treenode.jonas.server.services.ejbContainers") 69 , JonasAdminJmx.hasMBeanName(JonasObjectName.ejbService()), "ActionListContainers")); 70 al.add(new ServiceItem(m_Resources.getMessage("treenode.jonas.server.services.web") 71 , JonasAdminJmx.hasMBeanName(JonasObjectName.webContainerService()) 72 , "ActionListWebContainers")); 73 al.add(new ServiceItem(m_Resources.getMessage("treenode.jonas.server.services.database") 74 , JonasAdminJmx.hasMBeanName(JonasObjectName.databaseService()) 75 , "ActionListDatabases")); 76 al.add(new ServiceItem(m_Resources.getMessage("treenode.jonas.server.services.resource") 77 , JonasAdminJmx.hasMBeanName(JonasObjectName.resourceService()) 78 , "ActionListResourceAdapters")); 79 al.add(new ServiceItem(m_Resources.getMessage( 80 "treenode.jonas.server.services.transaction") 81 , JonasAdminJmx.hasMBeanName(JonasObjectName.transactionService()) 82 , "ActionEditJtmService")); 83 al.add(new ServiceItem(m_Resources.getMessage("treenode.jonas.server.services.jms") 84 , JonasAdminJmx.hasMBeanName(JonasObjectName.jmsService()), "ActionEditJmsService")); 85 al.add(new ServiceItem(m_Resources.getMessage("treenode.jonas.server.services.mail") 86 , JonasAdminJmx.hasMBeanName(JonasObjectName.mailService()) 87 , "ActionEditMailService")); 88 al.add(new ServiceItem(m_Resources.getMessage("treenode.jonas.server.services.security") 89 , JonasAdminJmx.hasMBeanName(JonasObjectName.securityService()) 90 , "ActionEditServiceSecurity")); 91 al.add(new ServiceItem(m_Resources.getMessage("treenode.jonas.server.services.discovery") 92 , JonasAdminJmx.hasMBeanName(JonasObjectName.discoveryService()) 93 , "ActionEditServiceDiscovery")); 94 al.add(new ServiceItem(m_Resources.getMessage("treenode.jonas.server.services.webservices") 95 , JonasAdminJmx.hasMBeanName(JonasObjectName.wsService()) 96 , "ActionListWebService")); 97 98 Collections.sort(al, new ServiceItemByNameComparator()); 100 p_Request.setAttribute("listServices", al); 102 } 103 catch (Throwable t) { 104 addGlobalError(t); 105 saveErrors(p_Request, m_Errors); 106 return (p_Mapping.findForward("Global Error")); 107 } 108 return (p_Mapping.findForward("Services")); 110 } 111 } 112 | Popular Tags |