BaseSecurityAction.java

00001 /*
00002  * JOnAS: Java(TM) Open Application Server
00003  * Copyright (C) 1999 Bull S.A.
00004  * Contact: jonas-team@objectweb.org
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00019  * USA
00020  *
00021  * --------------------------------------------------------------------------
00022  * $Id: BaseSecurityAction.java,v 1.8 2004/05/28 13:30:03 danesa Exp $
00023  * --------------------------------------------------------------------------
00024  */
00025 
00026 package org.objectweb.jonas.webapp.jonasadmin.security;
00027 
00028 import javax.management.ObjectName;
00029 
00030 import org.objectweb.jonas.jmx.J2eeObjectName;
00031 import org.objectweb.jonas.webapp.jonasadmin.JonasTreeBuilder;
00032 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou;
00033 import org.objectweb.jonas.webapp.jonasadmin.deploy.BaseDeployAction;
00034 import org.objectweb.jonas.webapp.taglib.TreeControl;
00035 import org.objectweb.jonas.webapp.taglib.TreeControlNode;
00036 
00041 abstract public class BaseSecurityAction extends BaseDeployAction {
00042 
00043 // --------------------------------------------------------- Protected Methods
00044 
00050     protected void refreshTree()
00051         throws Exception {
00052         // Refresh Security Tree
00053         refreshSecurityTree();
00054         // Refresh MBeans Tree
00055         refreshMBeansTree();
00056         // Force display to refresh
00057         m_WhereAreYou.setTreeToRefresh(true);
00058     }
00059 
00065     protected void refreshSecurityTree()
00066         throws Exception {
00067         // Get the security service node name
00068         String sCurrentNodeNameItem =  
00069                 m_WhereAreYou.getCurrentDomainName() + WhereAreYou.NODE_SEPARATOR + 
00070                 m_WhereAreYou.getCurrentJonasServerName() + WhereAreYou.NODE_SEPARATOR + 
00071                 "security";
00072         // Get current tree
00073         TreeControl oControl = m_WhereAreYou.getTreeControl();
00074         // Get branch root node
00075         TreeControlNode oBranchRootNode = oControl.findNode(sCurrentNodeNameItem);
00076         // Enable auto-refresh mode
00077         oControl.enableAutoRefresh();
00078         // Remove old children
00079         TreeControlNode[] aoNodes = oBranchRootNode.findChildren();
00080         for (int i = 0; i < aoNodes.length; i++) {
00081             aoNodes[i].remove();
00082         }
00083         // Build node for the Service
00084         JonasTreeBuilder oBuilder = new JonasTreeBuilder();
00085         oBuilder.getSecurityFactories(oBranchRootNode, m_Resources);
00086         // Disable auto-refresh mode
00087         oControl.disableAutoRefresh();
00088     }
00089 
00095     /*
00096          protected void refreshMBeansTree()
00097         throws Exception {
00098         // Get current tree
00099         TreeControl oControl = m_WhereAreYou.getTreeControl();
00100         // MBeans node present ?
00101         TreeControlNode oMBeansNode = oControl.findNode("mbeans");
00102         if (oMBeansNode != null) {
00103             // Enable auto-refresh mode
00104             oControl.enableAutoRefresh();
00105             // Remove node
00106             oMBeansNode.remove();
00107             // Build node and his children
00108             MBeanTreeBuilder oBuilder = new MBeanTreeBuilder();
00109             oBuilder.getMBeans(oControl.getRoot(), m_Resources);
00110             // Disable auto-refresh mode
00111             oControl.disableAutoRefresh();
00112         }
00113          }
00114      */
00115 }

Generated on Tue Feb 15 15:05:30 2005 for JOnAS by  doxygen 1.3.9.1