KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > webapp > jonasadmin > catalina > CatalinaBaseAction


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2003-2004 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * 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,v 1.9 2004/10/19 09:02:00 danesa Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.webapp.jonasadmin.catalina;
27
28 import javax.servlet.http.HttpServletRequest JavaDoc;
29
30 import org.objectweb.jonas.webapp.jonasadmin.JonasTreeBuilder;
31 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou;
32 import org.objectweb.jonas.webapp.jonasadmin.deploy.BaseDeployAction;
33 import org.objectweb.jonas.webapp.taglib.TreeControl;
34 import org.objectweb.jonas.webapp.taglib.TreeControlNode;
35
36 /**
37  * @author Michel-Ange ANTON
38  */

39 abstract public class CatalinaBaseAction extends BaseDeployAction {
40
41 // --------------------------------------------------------- Public Methods
42
/**
43      * Refresh the tree.
44      *
45      * @param p_Request Current instance
46      * @throws Exception
47      */

48     protected void refreshTree(HttpServletRequest JavaDoc p_Request)
49         throws Exception JavaDoc {
50         // Refresh Security Tree
51
refreshConnectorsTree(p_Request);
52         // Refresh MBeans Tree
53
refreshMBeansTree();
54         // Force display to refresh
55
m_WhereAreYou.setTreeToRefresh(true);
56     }
57
58     /**
59      * Refresh the connectors branch tree.
60      *
61      * @param p_Request Current instance
62      * @throws Exception
63      */

64     protected void refreshConnectorsTree(HttpServletRequest JavaDoc p_Request)
65         throws Exception JavaDoc {
66         // Get the current node name
67
String JavaDoc sCurrentNodeNameItem = getTreeBranchName(DEPTH_SERVER)
68             + WhereAreYou.NODE_SEPARATOR + "protocols"
69             + WhereAreYou.NODE_SEPARATOR + "connectors";
70         // Get current tree
71
TreeControl oControl = m_WhereAreYou.getTreeControl();
72         // Get branch root node
73
TreeControlNode oBranchRootNode = oControl.findNode(sCurrentNodeNameItem);
74         // Enable auto-refresh mode
75
oControl.enableAutoRefresh();
76         // Remove old children
77
TreeControlNode[] aoNodes = oBranchRootNode.findChildren();
78         for (int i = 0; i < aoNodes.length; i++) {
79             aoNodes[i].remove();
80         }
81         // Build node for the Service
82
JonasTreeBuilder oBuilder = new JonasTreeBuilder();
83         oBuilder.getCatalinaDetailConnectors(oBranchRootNode, m_Resources, p_Request);
84         // Disable auto-refresh mode
85
oControl.disableAutoRefresh();
86     }
87
88 }
89
Popular Tags