1 25 26 package org.objectweb.jonas.webapp.jonasadmin.logging; 27 28 import javax.management.ObjectName ; 29 import javax.servlet.http.HttpServletRequest ; 30 31 import org.objectweb.jonas.jmx.J2eeObjectName; 32 import org.objectweb.jonas.webapp.jonasadmin.JonasTreeBuilder; 33 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 34 import org.objectweb.jonas.webapp.jonasadmin.deploy.BaseDeployAction; 35 import org.objectweb.jonas.webapp.taglib.TreeControl; 36 import org.objectweb.jonas.webapp.taglib.TreeControlNode; 37 38 41 abstract public class BaseLoggerAction extends BaseDeployAction { 42 43 45 51 protected void refreshTree(HttpServletRequest p_Request) 52 throws Exception { 53 refreshLoggersTree(p_Request); 55 refreshMBeansTree(); 57 m_WhereAreYou.setTreeToRefresh(true); 59 } 60 61 67 protected void refreshLoggersTree(HttpServletRequest p_Request) 68 throws Exception { 69 String sDomainLabel = "domain"; 71 ObjectName oObjectName = J2eeObjectName.J2EEServer(m_WhereAreYou.getCurrentDomainName() 72 , m_WhereAreYou.getCurrentJonasServerName()); 73 String sServerName = getStringAttribute(oObjectName, "serverName"); 74 String sCurrentNodeNameItem = sDomainLabel + WhereAreYou.NODE_SEPARATOR + sServerName + WhereAreYou.NODE_SEPARATOR + "logging"; 76 TreeControl oControl = m_WhereAreYou.getTreeControl(); 78 TreeControlNode oBranchRootNode = oControl.findNode(sCurrentNodeNameItem); 80 oControl.enableAutoRefresh(); 82 TreeControlNode[] aoNodes = oBranchRootNode.findChildren(); 84 for (int i = 0; i < aoNodes.length; i++) { 85 aoNodes[i].remove(); 86 } 87 JonasTreeBuilder oBuilder = new JonasTreeBuilder(); 89 oBuilder.getLoggers(oBranchRootNode, m_Resources, p_Request); 90 oControl.disableAutoRefresh(); 92 } 93 } 94 | Popular Tags |