01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 2003-2004 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: CatalinaBaseAction.java 9680 2006-10-06 12:08:33Z danesa $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas.webapp.jonasadmin.catalina;
25:
26: import javax.servlet.http.HttpServletRequest;
27:
28: import org.objectweb.jonas.webapp.jonasadmin.JonasTreeBuilder;
29: import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou;
30: import org.objectweb.jonas.webapp.jonasadmin.deploy.BaseDeployAction;
31: import org.objectweb.jonas.webapp.taglib.TreeControl;
32: import org.objectweb.jonas.webapp.taglib.TreeControlNode;
33:
34: /**
35: * @author Michel-Ange ANTON
36: */
37: abstract public class CatalinaBaseAction extends BaseDeployAction {
38:
39: // --------------------------------------------------------- Public Methods
40: /**
41: * Refresh the tree.
42: *
43: * @param p_Request Current instance
44: * @throws Exception
45: */
46: protected void refreshTree(HttpServletRequest p_Request)
47: throws Exception {
48: // Refresh Security Tree
49: refreshConnectorsTree(p_Request);
50: // Refresh MBeans Tree
51: refreshMBeansTree(p_Request);
52: // Force display to refresh
53: m_WhereAreYou.setTreeToRefresh(true);
54: }
55:
56: /**
57: * Refresh the connectors branch tree.
58: *
59: * @param p_Request Current instance
60: * @throws Exception
61: */
62: protected void refreshConnectorsTree(HttpServletRequest p_Request)
63: throws Exception {
64: // Get the current node name
65: String sCurrentNodeNameItem = getTreeBranchName(DEPTH_SERVER)
66: + WhereAreYou.NODE_SEPARATOR + "protocols"
67: + WhereAreYou.NODE_SEPARATOR + "connectors";
68: // Get current tree
69: TreeControl oControl = m_WhereAreYou.getTreeControl();
70: // Get branch root node
71: TreeControlNode oBranchRootNode = oControl
72: .findNode(sCurrentNodeNameItem);
73: // Enable auto-refresh mode
74: oControl.enableAutoRefresh();
75: // Remove old children
76: TreeControlNode[] aoNodes = oBranchRootNode.findChildren();
77: for (int i = 0; i < aoNodes.length; i++) {
78: aoNodes[i].remove();
79: }
80: // Build node for the Service
81: JonasTreeBuilder oBuilder = new JonasTreeBuilder();
82: oBuilder.getCatalinaDetailConnectors(oBranchRootNode,
83: m_Resources, p_Request);
84: // Disable auto-refresh mode
85: oControl.disableAutoRefresh();
86: }
87:
88: }
|