Thread: [Ejtools-cvs] CVS: applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model Domain
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-04-24 20:33:25
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model In directory usw-pr-cvs1:/tmp/cvs-serv31842/model Modified Files: Domain.java Node.java Resource.java Server.java Log Message: Remove Iconable implementation Add filter capability for Server Index: Domain.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/Domain.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Domain.java 22 Apr 2002 17:38:59 -0000 1.1 --- Domain.java 24 Apr 2002 20:08:22 -0000 1.2 *************** *** 23,31 **** public Domain() { } - public String getSmallIcon(){ - return "Home16.gif"; - } - - /** * Setter for the reference attribute --- 23,26 ---- Index: Node.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/Node.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Node.java 22 Apr 2002 17:40:48 -0000 1.1 --- Node.java 24 Apr 2002 20:08:22 -0000 1.2 *************** *** 18,22 **** * @created 13 décembre 2001 */ ! public abstract class Node extends BeanContextServicesSupport implements BeanContextChildComponentProxy,XmlIconable { /** Description of the Field */ --- 18,22 ---- * @created 13 décembre 2001 */ ! public abstract class Node extends BeanContextServicesSupport implements BeanContextChildComponentProxy { /** Description of the Field */ *************** *** 34,45 **** } - public String getSmallIcon(){ - return null; - } - public String getBigIcon(){ - return null; - } - - /** --- 34,37 ---- *************** *** 151,154 **** this.name = name; } } - --- 143,157 ---- this.name = name; } + + public void clear() { + Iterator iterator = iterator(); + while (iterator.hasNext()) + { + Object o = iterator.next(); + if (o instanceof BeanContext) { + ((BeanContext)o).clear(); + } + remove(o); + } + } } Index: Resource.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/Resource.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Resource.java 22 Apr 2002 17:41:03 -0000 1.1 --- Resource.java 24 Apr 2002 20:08:22 -0000 1.2 *************** *** 42,49 **** public Resource() { } - public String getSmallIcon(){ - return "EJBModule16.gif"; - } - /** * Getter for the attribute attribute --- 42,45 ---- *************** *** 173,176 **** --- 169,192 ---- public MBeanInfo getMBeanInfo() { + if (this.info == null) + { + BeanContextServices context = (BeanContextServices) getBeanContext(); + if (context.hasService(ConnectionService.class)) + { + try + { + ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); + + this.info = service.getMBeanInfo(this.objectName); + + context.releaseService(this, this, ConnectionService.class); + } + catch (Exception e) + { + System.out.println("Error during utilisation of service ConnectionService (" + e.getMessage() + ")"); + e.printStackTrace(); + } + } + } return this.info; } Index: Server.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/Server.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Server.java 22 Apr 2002 17:41:37 -0000 1.1 --- Server.java 24 Apr 2002 20:08:22 -0000 1.2 *************** *** 25,29 **** * @created 13 décembre 2001 */ ! public class Server extends Node implements BeanContextXmlProxy { /** Description of the Field */ --- 25,29 ---- * @created 13 décembre 2001 */ ! public class Server extends Node { /** Description of the Field */ *************** *** 34,37 **** --- 34,39 ---- protected Hashtable domains = new Hashtable(); /** Description of the Field */ + protected Hashtable mbeans = new Hashtable(); + /** Description of the Field */ protected String ejbName = "ejb/jmx/ejb/Adaptor"; /** Description of the Field */ *************** *** 42,46 **** protected String url = "localhost:1099"; /** Description of the Field */ ! protected transient XmlComponent xc = null; --- 44,48 ---- protected String url = "localhost:1099"; /** Description of the Field */ ! protected String filter = "*:*"; *************** *** 66,85 **** } - public String getSmallIcon(){ - return "Server16.gif"; - } - - public XmlComponent getXmlProxy() - { - if (xc == null) - { - xc = new GenericXmlCustomizer(this); - } - return xc; - } - /** Description of the Method */ public void connect() { BeanContextServices context = (BeanContextServices) getBeanContext(); --- 68,80 ---- } /** Description of the Method */ public void connect() { + System.out.println("In connect"); + + this.clear(); + this.domains.clear(); + this.mbeans.clear(); + BeanContextServices context = (BeanContextServices) getBeanContext(); *************** *** 96,105 **** this.setDefaultDomain(service.getDefaultDomain()); ! this.setCount(service.getMBeanCount().intValue()); ! Collection mbeans = service.queryMBeans(null, null); Vector resources = new Vector(); ! Iterator it = mbeans.iterator(); while (it.hasNext()) { --- 91,102 ---- this.setDefaultDomain(service.getDefaultDomain()); ! // this.setCount(service.getMBeanCount().intValue()); ! Collection result = service.queryMBeans(new ObjectName(filter), null); ! ! int counter = result.size(); Vector resources = new Vector(); ! Iterator it = result.iterator(); while (it.hasNext()) { *************** *** 118,123 **** --- 115,123 ---- d.add(resource); resource.setReference(oi); + this.mbeans.put(resource.getCanonicalName(), resource); } + setCount(counter); + it = resources.iterator(); while (it.hasNext()) *************** *** 141,144 **** --- 141,151 ---- + public Object searchObjectName(String objectName) { + if (objectName!=null){ + return mbeans.get(objectName); + } + return null; + } + /** * Getter for the count attribute *************** *** 162,165 **** --- 169,177 ---- } + public String getFilter() + { + return filter; + } + /** *************** *** 215,218 **** --- 227,235 ---- { this.ejbName = ejbName; + } + + public void setFilter(String filter) + { + this.filter = filter; } |