Thread: [Ejtools-cvs] applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model ConnectionS
Brought to you by:
letiemble
From: <let...@us...> - 2002-06-10 07:49:58
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model In directory usw-pr-cvs1:/tmp/cvs-serv14005/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model Modified Files: ConnectionService.java ConnectionServiceProvider.java Domain.java EJBConnectionService.java LocalConnectionService.java Node.java RMIConnectionService.java Resource.java Server.java Log Message: In progress Index: ConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/ConnectionService.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConnectionService.java 15 May 2002 20:56:51 -0000 1.3 --- ConnectionService.java 10 Jun 2002 07:49:55 -0000 1.4 *************** *** 11,14 **** --- 11,15 ---- import javax.management.Attribute; + import javax.management.AttributeList; import javax.management.MBeanInfo; import javax.management.ObjectInstance; *************** *** 21,24 **** --- 22,26 ---- * @author letiemble * @created 13 décembre 2001 + * @version $Revision$ * @todo Javadoc to complete */ *************** *** 89,92 **** --- 91,105 ---- /** + * Description of the Method + * + * @param name Description of the Parameter + * @param exp Description of the Parameter + * @return Description of the Return Value + * @exception Exception Description of the Exception + */ + public Set queryNames(ObjectName name, QueryExp exp) throws Exception; + + + /** * Sets the attribute attribute of the ConnectionService object * *************** *** 96,99 **** --- 109,123 ---- */ public void setAttribute(ObjectName name, Attribute attribute) throws Exception; + + + /** + * Sets the attributes attribute of the ConnectionService object + * + * @param name The new attributes value + * @param list The new attributes value + * @return Description of the Return Value + * @exception Exception Description of the Exception + */ + public AttributeList setAttributes(ObjectName name, AttributeList list) throws Exception; Index: ConnectionServiceProvider.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/ConnectionServiceProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConnectionServiceProvider.java 15 May 2002 20:56:51 -0000 1.2 --- ConnectionServiceProvider.java 10 Jun 2002 07:49:55 -0000 1.3 *************** *** 18,21 **** --- 18,22 ---- * @author letiemble * @created 13 décembre 2001 + * @version $Revision$ * @todo Javadoc to complete */ Index: Domain.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/Domain.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Domain.java 15 May 2002 20:56:51 -0000 1.3 --- Domain.java 10 Jun 2002 07:49:55 -0000 1.4 *************** *** 12,18 **** * Description of the Class * ! * @author letiemble ! * @created 13 décembre 2001 ! * @todo Javadoc to complete */ public class Domain extends Node --- 12,22 ---- * Description of the Class * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @javabean:class displayName="JMX Domain" shortDescription="JMX Domain" ! * @javabean:icons color16="/toolbarButtonGraphics/development/Jar16.gif" ! * @javabean:property name="name" class="java.lang.String" displayname="Name" shortDescription="Domain name" */ public class Domain extends Node Index: EJBConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/EJBConnectionService.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EJBConnectionService.java 15 May 2002 20:56:51 -0000 1.3 --- EJBConnectionService.java 10 Jun 2002 07:49:55 -0000 1.4 *************** *** 10,13 **** --- 10,14 ---- import javax.management.Attribute; + import javax.management.AttributeList; import javax.management.MBeanInfo; import javax.management.ObjectInstance; *************** *** 25,28 **** --- 26,30 ---- * @author letiemble * @created 13 décembre 2001 + * @version $Revision$ * @todo Javadoc to complete */ *************** *** 144,147 **** --- 146,163 ---- /** + * Description of the Method + * + * @param name Description of the Parameter + * @param exp Description of the Parameter + * @return Description of the Return Value + * @exception Exception Description of the Exception + */ + public Set queryNames(ObjectName name, QueryExp exp) throws Exception + { + return getConnector().queryNames(name, exp); + } + + + /** * Setter for the attribute attribute * *************** *** 154,157 **** --- 170,188 ---- getConnector().setAttribute(name, attribute); } + + + /** + * Sets the attributes attribute of the EJBConnectionService object + * + * @param name The new attributes value + * @param list The new attributes value + * @return Description of the Return Value + * @exception Exception Description of the Exception + */ + public AttributeList setAttributes(ObjectName name, AttributeList list) throws Exception + { + return getConnector().setAttributes(name, list); + } + Index: LocalConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/LocalConnectionService.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LocalConnectionService.java 15 May 2002 20:56:51 -0000 1.3 --- LocalConnectionService.java 10 Jun 2002 07:49:55 -0000 1.4 *************** *** 11,14 **** --- 11,15 ---- import javax.management.Attribute; + import javax.management.AttributeList; import javax.management.MBeanInfo; import javax.management.MBeanServer; *************** *** 23,26 **** --- 24,28 ---- * @author letiemble * @created 13 décembre 2001 + * @version $Revision$ * @todo Javadoc to complete */ *************** *** 142,145 **** --- 144,161 ---- /** + * Description of the Method + * + * @param name Description of the Parameter + * @param exp Description of the Parameter + * @return Description of the Return Value + * @exception Exception Description of the Exception + */ + public Set queryNames(ObjectName name, QueryExp exp) throws Exception + { + return getConnector().queryNames(name, exp); + } + + + /** * Setter for the attribute attribute * *************** *** 152,155 **** --- 168,186 ---- getConnector().setAttribute(name, attribute); } + + + /** + * Sets the attributes attribute of the LocalConnectionService object + * + * @param name The new attributes value + * @param list The new attributes value + * @return Description of the Return Value + * @exception Exception Description of the Exception + */ + public AttributeList setAttributes(ObjectName name, AttributeList list) throws Exception + { + return getConnector().setAttributes(name, list); + } + Index: Node.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/Node.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Node.java 15 May 2002 20:56:51 -0000 1.3 --- Node.java 10 Jun 2002 07:49:55 -0000 1.4 *************** *** 26,29 **** --- 26,30 ---- * @author letiemble * @created 13 décembre 2001 + * @version $Revision$ * @todo Javadoc to complete */ Index: RMIConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/RMIConnectionService.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RMIConnectionService.java 15 May 2002 20:56:51 -0000 1.3 --- RMIConnectionService.java 10 Jun 2002 07:49:55 -0000 1.4 *************** *** 10,13 **** --- 10,14 ---- import javax.management.Attribute; + import javax.management.AttributeList; import javax.management.MBeanInfo; import javax.management.ObjectInstance; *************** *** 24,27 **** --- 25,29 ---- * @author letiemble * @created 13 décembre 2001 + * @version $Revision$ * @todo Javadoc to complete */ *************** *** 143,146 **** --- 145,162 ---- /** + * Description of the Method + * + * @param name Description of the Parameter + * @param exp Description of the Parameter + * @return Description of the Return Value + * @exception Exception Description of the Exception + */ + public Set queryNames(ObjectName name, QueryExp exp) throws Exception + { + return getConnector().queryNames(name, exp); + } + + + /** * Setter for the attribute attribute * *************** *** 153,156 **** --- 169,187 ---- getConnector().setAttribute(name, attribute); } + + + /** + * Sets the attributes attribute of the RMIConnectionService object + * + * @param name The new attributes value + * @param list The new attributes value + * @return Description of the Return Value + * @exception Exception Description of the Exception + */ + public AttributeList setAttributes(ObjectName name, AttributeList list) throws Exception + { + return getConnector().setAttributes(name, list); + } + Index: Resource.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/Resource.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Resource.java 15 May 2002 20:56:51 -0000 1.4 --- Resource.java 10 Jun 2002 07:49:55 -0000 1.5 *************** *** 13,16 **** --- 13,17 ---- import javax.management.AttributeChangeNotification; import javax.management.AttributeChangeNotificationFilter; + import javax.management.AttributeList; import javax.management.MBeanInfo; import javax.management.Notification; *************** *** 22,31 **** import net.sourceforge.ejtools.jmx.MBeanAccessor; /** * Description of the Class * ! * @author letiemble ! * @created 13 décembre 2001 ! * @todo Javadoc to complete */ public class Resource extends Node implements MBeanAccessor --- 23,41 ---- import net.sourceforge.ejtools.jmx.MBeanAccessor; + import org.apache.log4j.Category; + /** * Description of the Class * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @javabean:class displayName="JMX Resource" shortDescription="JMX Resource" ! * @javabean:icons color16="/toolbarButtonGraphics/development/Bean16.gif" ! * @javabean:property name="name" class="java.lang.String" displayname="Name" shortDescription="Resource name" ! * @javabean:property name="className" class="java.lang.String" displayname="Class Name" shortDescription="Class Name" ! * @javabean:property name="domain" class="java.lang.String" displayname="Domain" shortDescription="Domain name" ! * @javabean:property name="description" class="java.lang.String" displayname="Description" shortDescription="Description" */ public class Resource extends Node implements MBeanAccessor *************** *** 43,46 **** --- 53,58 ---- /** Description of the Field */ protected transient ResourceUpdater updater; + /** Description of the Field */ + private static Category logger = Category.getInstance(Resource.class); *************** *** 50,94 **** /** - * Description of the Method - * - * @param className Description of the Parameter - * @param name Description of the Parameter - * @param loaderName Description of the Parameter - * @param params Description of the Parameter - * @param signature Description of the Parameter - * @return Description of the Return Value - */ - public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) - { - BeanContextServices context = (BeanContextServices) getBeanContext(); - ObjectInstance result = null; - - if (context.hasService(ConnectionService.class)) - { - try - { - ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); - - result = service.createMBean(className, name, loaderName, params, signature); - - context.releaseService(this, this, ConnectionService.class); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - return result; - } - - - /** * Getter for the attribute attribute * ! * @param name Description of Parameter ! * @param attribute Description of Parameter ! * @return The value */ ! public Object getAttribute(ObjectName name, String attribute) { BeanContextServices context = (BeanContextServices) getBeanContext(); --- 62,72 ---- /** * Getter for the attribute attribute * ! * @param attribute Description of Parameter ! * @return The value ! * @exception Exception Description of the Exception */ ! public Object getAttribute(String attribute) throws Exception { BeanContextServices context = (BeanContextServices) getBeanContext(); *************** *** 101,105 **** ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! result = service.getAttribute(name, attribute); context.releaseService(this, this, ConnectionService.class); --- 79,83 ---- ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! result = service.getAttribute(objectName, attribute); context.releaseService(this, this, ConnectionService.class); *************** *** 107,111 **** catch (Exception e) { ! e.printStackTrace(); } } --- 85,90 ---- catch (Exception e) { ! logger.error("Error while getting attribute " + e.getMessage()); ! throw e; } } *************** *** 162,167 **** catch (Exception e) { ! System.out.println("Error during utilisation of service ConnectionService (" + e.getMessage() + ")"); ! e.printStackTrace(); } } --- 141,145 ---- catch (Exception e) { ! logger.error("Error during utilisation of service ConnectionService " + e.getMessage()); } } *************** *** 225,230 **** catch (Exception e) { ! System.out.println("Error during utilisation of service ConnectionService (" + e.getMessage() + ")"); ! e.printStackTrace(); } } --- 203,207 ---- catch (Exception e) { ! logger.error("Error during utilisation of service ConnectionService " + e.getMessage()); } } *************** *** 259,269 **** * Description of the Method * ! * @param name Description of Parameter ! * @param action Description of Parameter ! * @param params Description of Parameter ! * @param signatures Description of Parameter ! * @return Description of the Returned Value */ ! public Object invoke(ObjectName name, String action, Object[] params, String[] signatures) { BeanContextServices context = (BeanContextServices) getBeanContext(); --- 236,246 ---- * Description of the Method * ! * @param action Description of Parameter ! * @param params Description of Parameter ! * @param signatures Description of Parameter ! * @return Description of the Returned Value ! * @exception Exception Description of the Exception */ ! public Object invoke(String action, Object[] params, String[] signatures) throws Exception { BeanContextServices context = (BeanContextServices) getBeanContext(); *************** *** 276,280 **** ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! result = service.invoke(name, action, params, signatures); context.releaseService(this, this, ConnectionService.class); --- 253,257 ---- ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! result = service.invoke(objectName, action, params, signatures); context.releaseService(this, this, ConnectionService.class); *************** *** 282,286 **** catch (Exception e) { ! e.printStackTrace(); } } --- 259,264 ---- catch (Exception e) { ! logger.error("Error while invoking method " + e.getMessage()); ! throw e; } } *************** *** 292,299 **** * Getter for the attribute attribute * ! * @param name Description of Parameter ! * @param attribute Description of Parameter */ ! public void setAttribute(ObjectName name, Attribute attribute) { BeanContextServices context = (BeanContextServices) getBeanContext(); --- 270,277 ---- * Getter for the attribute attribute * ! * @param attribute Description of Parameter ! * @exception Exception Description of the Exception */ ! public void setAttribute(Attribute attribute) throws Exception { BeanContextServices context = (BeanContextServices) getBeanContext(); *************** *** 305,309 **** ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! service.setAttribute(name, attribute); context.releaseService(this, this, ConnectionService.class); --- 283,287 ---- ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! service.setAttribute(objectName, attribute); context.releaseService(this, this, ConnectionService.class); *************** *** 311,320 **** catch (Exception e) { ! e.printStackTrace(); } } } /** * Sets the reference attribute of the Resource object --- 289,332 ---- catch (Exception e) { ! logger.error("Error while setting attribute " + e.getMessage()); ! throw e; ! } ! } ! } ! ! ! /** ! * Sets the attributes attribute of the Resource object ! * ! * @param list The new attributes value ! * @return Description of the Return Value ! * @exception Exception Description of the Exception ! */ ! public AttributeList setAttributes(AttributeList list) throws Exception ! { ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! AttributeList result = null; ! ! if (context.hasService(ConnectionService.class)) ! { ! try ! { ! ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! ! result = service.setAttributes(objectName, list); ! ! context.releaseService(this, this, ConnectionService.class); ! } ! catch (Exception e) ! { ! logger.error("Error while setting attributes " + e.getMessage()); ! throw e; } } + return result; } + /** * Sets the reference attribute of the Resource object *************** *** 336,342 **** * Description of the Method * ! * @param name Description of the Parameter */ ! public void unregisterMBean(ObjectName name) { BeanContextServices context = (BeanContextServices) getBeanContext(); --- 348,354 ---- * Description of the Method * ! * @exception Exception Description of the Exception */ ! public void unregisterMBean() throws Exception { BeanContextServices context = (BeanContextServices) getBeanContext(); *************** *** 348,352 **** ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! service.unregisterMBean(name); context.releaseService(this, this, ConnectionService.class); --- 360,364 ---- ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! service.unregisterMBean(objectName); context.releaseService(this, this, ConnectionService.class); *************** *** 354,358 **** catch (Exception e) { ! e.printStackTrace(); } } --- 366,371 ---- catch (Exception e) { ! logger.error("Error while unregistering " + e.getMessage()); ! throw e; } } Index: Server.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model/Server.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Server.java 17 May 2002 07:21:30 -0000 1.5 --- Server.java 10 Jun 2002 07:49:55 -0000 1.6 *************** *** 8,26 **** import java.beans.beancontext.BeanContextServices; import java.util.Collection; - import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; import javax.management.ObjectInstance; - import javax.management.ObjectName; import javax.naming.Context; /** * Description of the Class * ! * @author letiemble ! * @created 13 décembre 2001 ! * @todo Javadoc to complete */ public class Server extends Node --- 8,39 ---- import java.beans.beancontext.BeanContextServices; + import java.util.*; import java.util.Collection; import java.util.Iterator; import java.util.Vector; + import javax.management.*; import javax.management.ObjectInstance; import javax.naming.Context; + import org.apache.log4j.Category; + /** * Description of the Class * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Add log4j logs ! * @javabean:class displayName="JMX Server" shortDescription="JMX Server" ! * @javabean:icons color16="/toolbarButtonGraphics/development/Server16.gif" ! * @javabean:property name="defaultDomain" class="java.lang.String" displayname="Default Domain" shortDescription="Default Domain" ! * @javabean:property name="count" class="int" displayname="MBean number" shortDescription="Number of MBean registered" ! * @javabean:property name="factory" class="java.lang.String" displayName="Factory" shortDescription="JNDI context factory" ! * @javabean:property name="packages" class="java.lang.String" displayName="Packages" shortDescription="Packages for context" ! * @javabean:property name="url" class="java.lang.String" displayName="URL" shortDescription="JNDI Server URL" ! * @javabean:property name="context" class="java.lang.String" displayName="Context" shortDescription="Initial JNDI context" ! * @javabean:property name="eJBName" class="java.lang.String" displayname="EJB Adaptor" shortDescription="JMX EJB Adaptor" */ public class Server extends Node *************** *** 42,45 **** --- 55,60 ---- /** Description of the Field */ protected String url = "localhost:1099"; + /** Description of the Field */ + private static Category logger = Category.getInstance(Server.class); *************** *** 64,72 **** ! /** Description of the Method */ public void connect() { - System.out.println("In connect"); - this.clear(); this.domains.clear(); --- 79,89 ---- ! /** ! * Description of the Method ! * ! * @javabean:method name="connect" displayName="Connect" shortDescription="Connect to JMX Server" ! */ public void connect() { this.clear(); this.domains.clear(); *************** *** 200,203 **** --- 217,254 ---- { return this.url; + } + + + /** + * Description of the Method + * + * @param name Description of the Parameter + * @param exp Description of the Parameter + * @return Description of the Return Value + */ + public Set query(ObjectName name, QueryExp exp) + { + Set result = null; + + BeanContextServices context = (BeanContextServices) getBeanContext(); + + if (context.hasService(ConnectionService.class)) + { + try + { + ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); + + result = service.queryNames(name, exp); + + context.releaseService(this, this, ConnectionService.class); + } + catch (Exception e) + { + System.out.println("Error during utilisation of service ConnectionService (" + e.getMessage() + ")"); + e.printStackTrace(); + } + } + + return result; } |