[Mc4j-cvs] mc4j/src/org/mc4j/console/dashboard Dashboard.java,1.12,1.13
Brought to you by:
ghinkl
From: Greg H. <gh...@us...> - 2004-04-07 03:07:33
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15399/src/org/mc4j/console/dashboard Modified Files: Dashboard.java Log Message: Support for the new matching system. Index: Dashboard.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/Dashboard.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Dashboard.java 2 Apr 2004 03:34:05 -0000 1.12 --- Dashboard.java 7 Apr 2004 02:54:38 -0000 1.13 *************** *** 20,33 **** package org.mc4j.console.dashboard; ! import javax.management.ObjectName; ! import org.openide.ErrorManager; ! import org.openide.windows.IOProvider; - import org.apache.regexp.RE; - import org.apache.regexp.RESyntaxException; - import org.apache.regexp.REUtil; import org.w3c.dom.Document; - import org.w3c.dom.Element; /** --- 20,31 ---- package org.mc4j.console.dashboard; ! import java.util.HashMap; ! import java.util.Map; ! import org.mc4j.console.bean.MBeanNode; ! import org.mc4j.console.dashboard.match.DashboardMatch; ! import org.mc4j.console.dashboard.match.MatchExecutor; import org.w3c.dom.Document; /** *************** *** 35,39 **** * not the dashboard itself, but the data representing a class of dashboard, * but not a specific instance. Instances of the dashboards themselves are ! * created by the DashBoardFactory. * * @author Greg Hinkle (gh...@us...), September 2002 --- 33,37 ---- * not the dashboard itself, but the data representing a class of dashboard, * but not a specific instance. Instances of the dashboards themselves are ! * created by the DashboardFactory. * * @author Greg Hinkle (gh...@us...), September 2002 *************** *** 54,64 **** private String description; ! private boolean isMultiBean; ! ! private String nameFilterString; ! ! private RE nameFilter; ! private boolean isGlobal; --- 52,58 ---- private String description; ! private DashboardMatch dashboardMatch; ! private Map contextStarter = new HashMap(); *************** *** 79,83 **** this.dashboardDocument = dashboardDocument; - init(); } --- 73,76 ---- *************** *** 93,128 **** ! private void init() { ! Element rootElement = this.dashboardDocument.getDocumentElement(); ! ! setNameFilter(rootElement.getAttribute("nameFilter")); ! ! setDescription(rootElement.getElementsByTagName("Description").item(0).getNodeValue()); ! ! setIsMultiBean(Boolean.valueOf(rootElement.getAttribute("isMultiBean")).booleanValue()); ! ! setGlobal(Boolean.valueOf(rootElement.getAttribute("isGlobal")).booleanValue()); ! } ! ! public void setGlobal(boolean isGlobal) { ! this.isGlobal = isGlobal; ! } ! ! public boolean isGlobal() { ! return this.isGlobal; } ! public void setNameFilter(String regexFilter) { ! this.nameFilterString = regexFilter; ! ! try { ! this.nameFilter = new RE(regexFilter); ! REUtil.createRE(regexFilter); ! } catch (RESyntaxException rese) { ! ErrorManager.getDefault().notify(rese); ! IOProvider.getDefault().getStdOut().println( ! "Invalid dashboard matching regular expression [" + regexFilter + ! "] in dashboard: " + getName()); ! } } --- 86,95 ---- ! public void putContext(String name, Object value) { ! this.contextStarter.put(name, value); } ! public Map getContextStarter() { ! return contextStarter; } *************** *** 159,178 **** } - /** Getter for property isMultiBean. - * @return Value of property isMultiBean. - * - */ - public boolean isIsMultiBean() { - return isMultiBean; - } - - /** Setter for property isMultiBean. - * @param isMultiBean New value of property isMultiBean. - * - */ - public void setIsMultiBean(boolean isMultiBean) { - this.isMultiBean = isMultiBean; - } - /** Getter for property dashboardDocument. * @return Value of property dashboardDocument. --- 126,129 ---- *************** *** 191,204 **** } - public boolean matches(ObjectName name) { - String cName = name.getCanonicalName(); - //IOProvider.getDefault().getIO("Dashboard debugging",false).getOut().println( - // "Comparing [" + this.nameFilterString + "] - [" + cName + "]"); ! if (this.nameFilter != null) { ! return this.nameFilter.match(cName); ! } else { ! return true; ! } } --- 142,156 ---- } ! public DashboardMatch getDashboardMatch() { ! return dashboardMatch; ! } ! ! public void setDashboardMatch(DashboardMatch dashboardMatch) { ! this.dashboardMatch = dashboardMatch; ! } ! ! public boolean matches(MBeanNode mBeanNode) { ! return MatchExecutor.getInstance().matchSingle(this, mBeanNode); } |