mc4j-cvs Mailing List for MC4J JMX Console (Page 13)
Brought to you by:
ghinkl
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(7) |
Apr
(135) |
May
(32) |
Jun
(34) |
Jul
|
Aug
|
Sep
(7) |
Oct
(139) |
Nov
(11) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(34) |
Feb
(1) |
Mar
(12) |
Apr
|
May
(87) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(27) |
Nov
(49) |
Dec
(13) |
2006 |
Jan
|
Feb
|
Mar
|
Apr
(252) |
May
(16) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(3) |
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
(2) |
Jul
(15) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(6) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(1) |
Nov
|
Dec
|
From: Greg H. <gh...@us...> - 2006-04-11 18:00:20
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/editor/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28018/src/org/mc4j/console/swing/editor/xml Log Message: Directory /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/editor/xml added to the repository |
From: Greg H. <gh...@us...> - 2006-04-11 17:57:07
|
Update of /cvsroot/mc4j/mc4j/modules/ems/lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24867/modules/ems/lib/test Added Files: Tag: ems_module_separation log4j.jar log4j.properties Log Message: Various fixes and tweaks. New ability to reconnect provided by exposing the proxy on the connection to be reestablished for the providers. Only done for jboss so far. --- NEW FILE: log4j.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: log4j.properties --- ### direct log messages to stdout ### log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n ### set log levels - for more verbose logging change 'info' to 'debug' ### log4j.rootLogger=DEBUG, stdout, file |
From: Greg H. <gh...@us...> - 2006-04-11 17:56:41
|
Update of /cvsroot/mc4j/mc4j/modules/ems/lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24635/modules/ems/lib/test Log Message: Directory /cvsroot/mc4j/mc4j/modules/ems/lib/test added to the repository |
From: Greg H. <gh...@us...> - 2006-04-11 17:56:19
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/test/org/mc4j/ems/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24051/modules/ems/src/test/org/mc4j/ems/test Modified Files: Tag: ems_module_separation ConnectionTest.java MultiConnectionTest.java Log Message: Various fixes and tweaks. New ability to reconnect provided by exposing the proxy on the connection to be reestablished for the providers. Only done for jboss so far. Index: ConnectionTest.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/test/org/mc4j/ems/test/Attic/ConnectionTest.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** ConnectionTest.java 27 Oct 2005 07:03:07 -0000 1.1.2.2 --- ConnectionTest.java 11 Apr 2006 17:56:05 -0000 1.1.2.3 *************** *** 19,32 **** import org.mc4j.ems.connection.ConnectionFactory; import org.mc4j.ems.connection.EmsConnection; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.mc4j.ems.connection.settings.ConnectionSettings; - import org.mc4j.ems.connection.settings.persistence.ConnectionSettingPersistence; - import org.mc4j.ems.connection.support.metadata.Weblogic9ConnectionTypeDescriptor; import javax.management.InstanceNotFoundException; import javax.management.IntrospectionException; - import java.io.File; - import java.util.Arrays; /** --- 19,29 ---- import org.mc4j.ems.connection.ConnectionFactory; import org.mc4j.ems.connection.EmsConnection; + import org.mc4j.ems.connection.support.metadata.JBossConnectionTypeDescriptor; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.mc4j.ems.connection.settings.ConnectionSettings; import javax.management.InstanceNotFoundException; import javax.management.IntrospectionException; /** *************** *** 55,62 **** --- 52,63 ---- ConnectionFactory factory = new ConnectionFactory(); + + factory.discoverServerClasses(settings); + EmsConnection connection = factory.connect(settings); connection.loadSynchronous(true); + /*SortedSet<EmsBean> beans = connection.getBeans(); for (EmsBean bean : beans) { *************** *** 78,81 **** --- 79,90 ---- // settings.setServerUrl("service:jmx:rmi:///jndi/rmi://localhost:9777/jmxrmi"); + + settings.initializeConnectionType(new JBossConnectionTypeDescriptor()); + settings.setConnectionName("JBoss Test"); + settings.setServerUrl("jnp://localhost:1099"); + settings.setLibraryURI("/Users/ghinkle/development/tools/jboss-4.0.3SP1-installer"); + settings.setPrincipal("admin"); settings.setCredentials("admin"); + + // Local Tomcat/Chires test // settings.initializeConnectionType(new J2SE5ConnectionTypeDescriptor()); *************** *** 110,130 **** // Weblogic 9 - test ! settings.setConnectionName("test"); ! settings.setServerUrl("service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.runtime");//edit");//domainruntime"); ! settings.initializeConnectionType(new Weblogic9ConnectionTypeDescriptor()); ! settings.setConnectionName("test"); ! settings.setPrincipal("weblogic"); ! settings.setCredentials("weblogic"); ! settings.setClassPathEntries(Arrays.asList(new File[] { ! new File("E:\\tools\\weblogic9\\weblogic90b\\server\\lib\\weblogic.jar") ! })); ! // return settings; ! String xml = ConnectionSettingPersistence.getInstance().encodeSettings(settings); ! System.out.println(xml); ! return ConnectionSettingPersistence.getInstance().decodeSettings(xml); } --- 119,139 ---- // Weblogic 9 - test ! // settings.setConnectionName("test"); ! // settings.setServerUrl("service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.runtime");//edit");//domainruntime"); ! // settings.initializeConnectionType(new Weblogic9ConnectionTypeDescriptor()); ! // settings.setConnectionName("test"); ! // settings.setPrincipal("weblogic"); ! // settings.setCredentials("weblogic"); ! // settings.setClassPathEntries(Arrays.asList(new File[] { ! // new File("E:\\tools\\weblogic9\\weblogic90b\\server\\lib\\weblogic.jar") ! // })); ! return settings; ! // String xml = ConnectionSettingPersistence.getInstance().encodeSettings(settings); ! // System.out.println(xml); ! // return ConnectionSettingPersistence.getInstance().decodeSettings(xml); } Index: MultiConnectionTest.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/test/org/mc4j/ems/test/Attic/MultiConnectionTest.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** MultiConnectionTest.java 12 Dec 2005 14:13:00 -0000 1.1.2.4 --- MultiConnectionTest.java 11 Apr 2006 17:56:05 -0000 1.1.2.5 *************** *** 12,15 **** --- 12,16 ---- import java.net.URL; import java.net.URLClassLoader; + import java.util.List; /** *************** *** 43,51 **** // jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss-3.2.3"); ! jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss-3.2.4"); // jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss-3.2.5"); ! // jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss 4/"); ! jboss.setPrincipal("admin"); jboss.setCredentials("admin"); ConnectionFactory factory = new ConnectionFactory(); --- 44,52 ---- // jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss-3.2.3"); ! // jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss-3.2.4"); // jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss-3.2.5"); ! jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss-4.0.3SP1-installer/"); ! // jboss.setPrincipal("admin"); jboss.setCredentials("admin"); ConnectionFactory factory = new ConnectionFactory(); *************** *** 56,66 **** long start = System.currentTimeMillis(); ! jbossConnection.loadSynchronous(false); System.out.println("Loaded " + jbossConnection.getBeans().size() + " in " + (System.currentTimeMillis()-start) + "ms"); EmsBean bean = jbossConnection.getBean("jboss:service=TransactionManager"); //"jboss.mq:service=MessageCache"); //jbossConnection.getBean("jboss.system:type=ServerInfo"); EmsAttribute attribute = bean.getAttribute("TransactionCount"); //"TotalCacheSize"); ! for (int i=0;i<20;i++) { try { --- 57,74 ---- long start = System.currentTimeMillis(); ! jbossConnection.loadSynchronous(true); System.out.println("Loaded " + jbossConnection.getBeans().size() + " in " + (System.currentTimeMillis()-start) + "ms"); + + EmsBean bean1 = jbossConnection.getBean("jboss.mq.destination:service=Queue,name=A"); //"jboss.mq:service=MessageCache"); + System.out.println("QUEUE SEARCH: " + bean1); + + List beans = jbossConnection.queryBeans("jboss:service=*"); + System.out.println("Found " + beans.size() + " beans from query."); + EmsBean bean = jbossConnection.getBean("jboss:service=TransactionManager"); //"jboss.mq:service=MessageCache"); //jbossConnection.getBean("jboss.system:type=ServerInfo"); EmsAttribute attribute = bean.getAttribute("TransactionCount"); //"TotalCacheSize"); ! /* for (int i=0;i<20;i++) { try { *************** *** 71,75 **** System.out.println("Exc: " + e.getClass().getName()); } ! } } --- 79,83 ---- System.out.println("Exc: " + e.getClass().getName()); } ! }*/ } |
From: Greg H. <gh...@us...> - 2006-04-11 17:39:25
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean/operation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8861/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean/operation Modified Files: Tag: ems_module_separation DOperation.java Log Message: Various fixes and tweaks. New ability to reconnect provided by exposing the proxy on the connection to be reestablished for the providers. Only done for jboss so far. Index: DOperation.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean/operation/Attic/DOperation.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** DOperation.java 16 Nov 2005 20:00:31 -0000 1.1.2.3 --- DOperation.java 11 Apr 2006 17:39:13 -0000 1.1.2.4 *************** *** 142,145 **** --- 142,146 ---- t.start(); + // TODO: The timeout is nice, but providing a method that actually returns a future would be nice try { t.join(MAX_EXECUTION_TIME); *************** *** 154,158 **** if (f.e != null) { ! throw new EmsInvocationException("Exception on invocation of [" + getName() + "]",f.e); } else { return f.results; --- 155,159 ---- if (f.e != null) { ! throw new EmsInvocationException("Exception on invocation of [" + getName() + "]" + f.e.toString(),f.e); } else { return f.results; |
From: Greg H. <gh...@us...> - 2006-04-11 17:39:21
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8861/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/proxy Modified Files: Tag: ems_module_separation GenericMBeanServerProxy.java JMXRemotingMBeanServerProxy.java JSR77ManagementMBeanServerProxy.java StatsProxy.java Log Message: Various fixes and tweaks. New ability to reconnect provided by exposing the proxy on the connection to be reestablished for the providers. Only done for jboss so far. Index: GenericMBeanServerProxy.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/proxy/Attic/GenericMBeanServerProxy.java,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** GenericMBeanServerProxy.java 12 Dec 2005 14:12:59 -0000 1.1.2.5 --- GenericMBeanServerProxy.java 11 Apr 2006 17:39:13 -0000 1.1.2.6 *************** *** 17,30 **** package org.mc4j.ems.impl.jmx.connection.support.providers.proxy; ! import org.mc4j.ems.connection.LoadException; import org.mc4j.ems.connection.EmsConnectException; import org.mc4j.ems.connection.EmsUnsupportedTypeException; import javax.management.MBeanServer; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; ! import java.io.NotSerializableException; --- 17,34 ---- package org.mc4j.ems.impl.jmx.connection.support.providers.proxy; ! import org.apache.commons.logging.Log; ! import org.apache.commons.logging.LogFactory; import org.mc4j.ems.connection.EmsConnectException; import org.mc4j.ems.connection.EmsUnsupportedTypeException; + import org.mc4j.ems.connection.LoadException; + import org.mc4j.ems.connection.support.ConnectionProvider; import javax.management.MBeanServer; + import java.io.NotSerializableException; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; ! import java.rmi.NoSuchObjectException; *************** *** 35,40 **** --- 39,46 ---- */ public class GenericMBeanServerProxy implements InvocationHandler, StatsProxy { + private static Log log = LogFactory.getLog(GenericMBeanServerProxy.class); private Object remoteServer; + private ConnectionProvider provider; private long roundTrips; *************** *** 42,45 **** --- 48,53 ---- private long failures; + private boolean reconnecting = false; + /** Creates a new instance of Proxy */ public GenericMBeanServerProxy(Object remoteServer) { *************** *** 47,50 **** --- 55,77 ---- } + public GenericMBeanServerProxy() { + } + + public ConnectionProvider getProvider() { + return provider; + } + + public void setProvider(ConnectionProvider provider) { + this.provider = provider; + } + + public Object getRemoteServer() { + return remoteServer; + } + + public void setRemoteServer(Object remoteServer) { + this.remoteServer = remoteServer; + } + public Object invoke( *************** *** 88,101 **** return method.invoke(this.remoteServer, args); } catch(InvocationTargetException e) { if (e.getCause() != null) { Throwable t = e.getCause(); if (t instanceof java.rmi.ConnectException) { ! throw new EmsConnectException("RMI Connection failure",t); } else if (t instanceof java.io.IOException) { ! throw new EmsConnectException("IO Connection failure",t); } else if (t instanceof NotSerializableException) { ! throw new EmsUnsupportedTypeException("Value was not serializable",t); } else { ! throw new EmsConnectException("Connection failure", t); } } else { --- 115,146 ---- return method.invoke(this.remoteServer, args); } catch(InvocationTargetException e) { + failures++; if (e.getCause() != null) { Throwable t = e.getCause(); if (t instanceof java.rmi.ConnectException) { ! throw new EmsConnectException(t); ! } else if (t instanceof NoSuchObjectException) { ! // This happens when the server comes back up and the stub is stale ! // try to reconnect if this provider supports it (if it told the proxy what the provider was) ! if (provider != null && !reconnecting) { ! try { ! log.info("Reestablishing RMI stub " + this.provider.getConnectionSettings().getServerUrl()); ! reconnecting = true; ! provider.connect(); ! // Retry the request once ! return this.invoke(proxy, m, args); ! } catch(Exception f) { ! log.warn("Unable to reestablish RMI stub to restarted server.",f); ! } finally{ reconnecting = false; } ! } ! // The reconnect failed, throw the original exception ! // If the retry fails, it will throw its own exception ! throw new EmsConnectException(t); } else if (t instanceof java.io.IOException) { ! throw new EmsConnectException(t); } else if (t instanceof NotSerializableException) { ! throw new EmsUnsupportedTypeException("Value was not serializable " + t.getLocalizedMessage(),t); } else { ! throw new EmsConnectException("Connection failure " + t.getLocalizedMessage(), t); } } else { Index: JSR77ManagementMBeanServerProxy.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/proxy/Attic/JSR77ManagementMBeanServerProxy.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** JSR77ManagementMBeanServerProxy.java 26 May 2005 17:27:25 -0000 1.1.2.1 --- JSR77ManagementMBeanServerProxy.java 11 Apr 2006 17:39:13 -0000 1.1.2.2 *************** *** 29,36 **** * @version $Revision$($Author$ / $Date$) */ ! public class JSR77ManagementMBeanServerProxy implements InvocationHandler { private Management mejb; private static final Class[] INTERFACES = { MBeanServer.class }; --- 29,40 ---- * @version $Revision$($Author$ / $Date$) */ ! public class JSR77ManagementMBeanServerProxy implements InvocationHandler, StatsProxy { private Management mejb; + private long roundTrips; + + private long failures; + private static final Class[] INTERFACES = { MBeanServer.class }; *************** *** 41,44 **** --- 45,51 ---- } + public JSR77ManagementMBeanServerProxy(Object omejb) { + this((Management) omejb); + } public Object invoke( *************** *** 46,54 **** throws Throwable { - // SwingUtility.eventThreadAlert(); - // - // ConnectionInfoAction.addHit(); - - Class serverClass = Management.class; // this.remoteServer.getClass(); --- 53,56 ---- *************** *** 57,66 **** // TODO CSC: should all IOExceptions been catched here and thrown as an MC4JIOException (RuntimeException) // to avoid the occurence of an UndeclaredThrowableExcpetion??? ! return method.invoke(this.mejb, args); } // TODO GH: Think about notification listers and how management ejbs have a seperate registry ! public static MBeanServer buildServerProxy(Object server) { Object proxy = --- 59,74 ---- // TODO CSC: should all IOExceptions been catched here and thrown as an MC4JIOException (RuntimeException) // to avoid the occurence of an UndeclaredThrowableExcpetion??? ! try { ! roundTrips++; ! return method.invoke(this.mejb, args); ! } catch(Exception e) { ! failures++; ! throw e; ! } } // TODO GH: Think about notification listers and how management ejbs have a seperate registry ! public MBeanServer buildServerProxy() { Object proxy = *************** *** 68,74 **** JSR77ManagementMBeanServerProxy.class.getClassLoader(), JSR77ManagementMBeanServerProxy.INTERFACES, ! new JSR77ManagementMBeanServerProxy((Management) server)); return (MBeanServer) proxy; } } --- 76,91 ---- JSR77ManagementMBeanServerProxy.class.getClassLoader(), JSR77ManagementMBeanServerProxy.INTERFACES, ! this); return (MBeanServer) proxy; } + + + public long getRoundTrips() { + return roundTrips; + } + + public long getFailures() { + return failures; + } } Index: StatsProxy.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/proxy/Attic/StatsProxy.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** StatsProxy.java 12 Dec 2005 14:12:59 -0000 1.1.2.1 --- StatsProxy.java 11 Apr 2006 17:39:13 -0000 1.1.2.2 *************** *** 16,26 **** --- 16,45 ---- package org.mc4j.ems.impl.jmx.connection.support.providers.proxy; + import javax.management.MBeanServer; + /** + * An interface for proxies to declare their capability to track and provide statistics + * on the network traffic. + * * @author Greg Hinkle (gh...@us...), Nov 22, 2005 * @version $Revision$($Author$ / $Date$) */ public interface StatsProxy { + + + /** + * @return a newly built dynamic proxy that will manage the connection + */ + MBeanServer buildServerProxy(); + + + /** + * @return the count of server calls made by this proxied connection + */ long getRoundTrips(); + /** + * @return the count of server calls that threw an exception + */ long getFailures(); } Index: JMXRemotingMBeanServerProxy.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/proxy/Attic/JMXRemotingMBeanServerProxy.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** JMXRemotingMBeanServerProxy.java 26 May 2005 17:27:25 -0000 1.1.2.1 --- JMXRemotingMBeanServerProxy.java 11 Apr 2006 17:39:13 -0000 1.1.2.2 *************** *** 31,38 **** * @version $Revision$($Author$ / $Date$) */ ! public class JMXRemotingMBeanServerProxy implements InvocationHandler { private MBeanServerConnection remoteServer; private static final Class[] INTERFACES = { MBeanServer.class }; --- 31,42 ---- * @version $Revision$($Author$ / $Date$) */ ! public class JMXRemotingMBeanServerProxy implements InvocationHandler, StatsProxy { private MBeanServerConnection remoteServer; + private long roundTrips; + + private long failures; + private static final Class[] INTERFACES = { MBeanServer.class }; *************** *** 48,55 **** throws Throwable { - // SwingUtility.eventThreadAlert(); - - // ConnectionInfoAction.addHit(); - Class serverClass = MBeanServerConnection.class; // this.remoteServer.getClass(); --- 52,55 ---- *************** *** 58,63 **** --- 58,65 ---- // TODO GH: Throw as Runtime? try { + roundTrips++; return method.invoke(this.remoteServer, args); } catch(InvocationTargetException ite) { + failures++; Throwable t = ite.getTargetException(); if (t != null) *************** *** 68,72 **** } ! public static MBeanServer buildServerProxy(Object server) { Object proxy = --- 70,74 ---- } ! public MBeanServer buildServerProxy() { Object proxy = *************** *** 74,80 **** JMXRemotingMBeanServerProxy.class.getClassLoader(), JMXRemotingMBeanServerProxy.INTERFACES, ! new JMXRemotingMBeanServerProxy((MBeanServerConnection) server)); return (MBeanServer) proxy; } } --- 76,90 ---- JMXRemotingMBeanServerProxy.class.getClassLoader(), JMXRemotingMBeanServerProxy.INTERFACES, ! this); return (MBeanServer) proxy; } + + public long getRoundTrips() { + return roundTrips; + } + + public long getFailures() { + return failures; + } } |
From: Greg H. <gh...@us...> - 2006-04-11 17:39:19
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean/attribute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8861/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean/attribute Modified Files: Tag: ems_module_separation DAttribute.java Log Message: Various fixes and tweaks. New ability to reconnect provided by exposing the proxy on the connection to be reestablished for the providers. Only done for jboss so far. Index: DAttribute.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean/attribute/Attic/DAttribute.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** DAttribute.java 12 Dec 2005 14:12:59 -0000 1.1.2.3 --- DAttribute.java 11 Apr 2006 17:39:13 -0000 1.1.2.4 *************** *** 46,49 **** --- 46,50 ---- import java.util.Map; import java.util.Set; + import java.util.Collections; /** *************** *** 63,71 **** protected Set<AttributeChangeListener> changeListeners; protected Object currentValue; protected ValueHistory valueHistory; ! protected List<Throwable> failures; --- 64,73 ---- protected Set<AttributeChangeListener> changeListeners; + protected long lastRetrieved; protected Object currentValue; protected ValueHistory valueHistory; ! protected LinkedList<Throwable> failures; *************** *** 200,210 **** supportedType = false; registerFailure(e); ! throw new EmsException("Could not load attribute value",e); } catch (InstanceNotFoundException e) { registerFailure(e); ! throw new EmsException("Could not load attribute value",e); } catch (MBeanException e) { registerFailure(e); ! throw new EmsException("Could not load attribute value",e); } catch (AttributeNotFoundException e) { registerFailure(e); --- 202,216 ---- supportedType = false; registerFailure(e); ! throw new EmsException("Could not load attribute value " + e.toString(),e); } catch (InstanceNotFoundException e) { registerFailure(e); ! throw new EmsException("Could not load attribute value, bean instance not found " + bean.getObjectName().toString(),e); } catch (MBeanException e) { registerFailure(e); ! Throwable t = e.getTargetException(); ! if (t != null) ! throw new EmsException("Could not load attribute value, target bean threw exception " + t.getLocalizedMessage(),t); ! else ! throw new EmsException("Could not load attribute value " + e.getLocalizedMessage(), e); } catch (AttributeNotFoundException e) { registerFailure(e); *************** *** 216,224 **** supportedType = false; registerFailure(t.getCause()); ! throw new EmsException("Could not load attribute value",t.getCause()); } else ! throw new EmsException("Could not load attribute value",t); } ! throw new EmsException("Could not load attribute value",e); } catch (RuntimeException re) { supportedType = false; --- 222,230 ---- supportedType = false; registerFailure(t.getCause()); ! throw new EmsException("Could not load attribute value " + t.getLocalizedMessage(),t.getCause()); } else ! throw new EmsException("Could not load attribute value " + t.getLocalizedMessage(),t); } ! throw new EmsException("Could not load attribute value " + e.getLocalizedMessage(),e); } catch (RuntimeException re) { supportedType = false; *************** *** 227,237 **** // Getting weblogic.management.NoAccessRuntimeException on wl9 registerFailure(re); ! throw new EmsException("Could not load attribute value",re); } catch (NoClassDefFoundError ncdfe) { supportedType = false; registerFailure(ncdfe); ! throw new EmsException("Could not load attribute value",ncdfe); } catch (Throwable t) { ! throw new EmsException("Could not load attribute value",t); } alterValue(newValue); --- 233,243 ---- // Getting weblogic.management.NoAccessRuntimeException on wl9 registerFailure(re); ! throw new EmsException("Could not load attribute value " + re.getLocalizedMessage(),re); } catch (NoClassDefFoundError ncdfe) { supportedType = false; registerFailure(ncdfe); ! throw new EmsException("Could not load attribute value " + ncdfe.getLocalizedMessage(),ncdfe); } catch (Throwable t) { ! throw new EmsException("Could not load attribute value " + t.getLocalizedMessage(),t); } alterValue(newValue); *************** *** 248,252 **** */ public List<Throwable> getFailures() { ! return failures; } --- 254,258 ---- */ public List<Throwable> getFailures() { ! return Collections.unmodifiableList(failures); } *************** *** 255,259 **** failures = new LinkedList<Throwable>(); failures.add(t); ! log.warn("Attribute access failure",t); } --- 261,270 ---- failures = new LinkedList<Throwable>(); failures.add(t); ! ! // Bounding this list to make sure memory doesn't grow ! if (failures.size() > 2) ! failures.removeFirst(); ! ! log.warn("Attribute access failure " + t.getLocalizedMessage(),t); } |
From: Greg H. <gh...@us...> - 2006-04-11 17:39:18
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8861/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers Modified Files: Tag: ems_module_separation AbstractConnectionProvider.java JBossConnectionProvider.java JMXRemotingConnectionProvider.java Oc4jConnectionProvider.java PramatiConnectionProvider.java WeblogicConnectionProvider.java WebsphereConnectionProvider.java Log Message: Various fixes and tweaks. New ability to reconnect provided by exposing the proxy on the connection to be reestablished for the providers. Only done for jboss so far. Index: WeblogicConnectionProvider.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/Attic/WeblogicConnectionProvider.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** WeblogicConnectionProvider.java 27 Oct 2005 07:03:06 -0000 1.1.2.2 --- WeblogicConnectionProvider.java 11 Apr 2006 17:39:14 -0000 1.1.2.3 *************** *** 19,32 **** import org.mc4j.ems.impl.jmx.connection.support.providers.proxy.GenericMBeanServerProxy; - import org.mc4j.ems.connection.EmsConnection; - import javax.management.MBeanServer; - import javax.naming.CommunicationException; import javax.naming.Context; import javax.naming.InitialContext; - import javax.naming.NamingException; import java.lang.reflect.Method; - import java.lang.reflect.InvocationTargetException; import java.util.Hashtable; --- 19,27 ---- *************** *** 43,56 **** ! public void doConnect() { Context ctx = null; System.setProperty("jmx.serial.form", "1.0"); ! ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); ! ! Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); ! try { // Class.forName(super.initialContextFactory, true, loader); --- 38,50 ---- ! public void doConnect() throws Exception { Context ctx = null; System.setProperty("jmx.serial.form", "1.0"); ! ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); try { + Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); + // Class.forName(super.initialContextFactory, true, loader); *************** *** 62,72 **** props.put(Context.SECURITY_CREDENTIALS, connectionSettings.getCredentials()); - // ClassLoader foo = Thread.currentThread().getContextClassLoader(); - // Thread.currentThread().setContextClassLoader(loader); - ctx = new InitialContext(props); ! // Thread.currentThread().setContextClassLoader(foo); ! //Class homeClass = Class.forName("weblogic.management.MBeanHome"); //Field field = homeClass.getField("ADMIN_JNDI_NAME"); --- 56,62 ---- props.put(Context.SECURITY_CREDENTIALS, connectionSettings.getCredentials()); ctx = new InitialContext(props); ! //Class homeClass = Class.forName("weblogic.management.MBeanHome"); //Field field = homeClass.getField("ADMIN_JNDI_NAME"); *************** *** 81,102 **** Object mbeanServerObject = method.invoke(home, new Object[] { } ); ! this.mbeanServer = ! (MBeanServer) GenericMBeanServerProxy.buildServerProxy(mbeanServerObject); - } catch (CommunicationException e) { - // NotifyDescriptor d = - // new NotifyDescriptor.Message("Unable to connect to server at [" + - // this.connectionSettings.getServerUrl() + - // "]. \nCheck to make sure the server is running on the specified host and port.", - // NotifyDescriptor.ERROR_MESSAGE); - // DialogDisplayer.getDefault().notify(d); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (NamingException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); } finally { Thread.currentThread().setContextClassLoader(contextClassLoader); --- 71,78 ---- Object mbeanServerObject = method.invoke(home, new Object[] { } ); ! GenericMBeanServerProxy proxy = new GenericMBeanServerProxy(mbeanServerObject); ! setStatsProxy(proxy); ! this.mbeanServer = proxy.buildServerProxy(); } finally { Thread.currentThread().setContextClassLoader(contextClassLoader); Index: Oc4jConnectionProvider.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/Attic/Oc4jConnectionProvider.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** Oc4jConnectionProvider.java 27 Oct 2005 07:03:06 -0000 1.1.2.2 --- Oc4jConnectionProvider.java 11 Apr 2006 17:39:13 -0000 1.1.2.3 *************** *** 19,22 **** --- 19,24 ---- + import org.mc4j.ems.impl.jmx.connection.support.providers.proxy.GenericMBeanServerProxy; + import javax.management.MBeanServer; import javax.management.j2ee.Management; *************** *** 52,56 **** * */ ! protected void doConnect() { log("Oc4jConnectionProvider"); --- 54,58 ---- * */ ! protected void doConnect() throws Exception { log("Oc4jConnectionProvider"); *************** *** 71,94 **** Context oc4jctx = new InitialContext(env); ! /* Object obj = (ManagementHome) oc4jctx.lookup(connectionSettings.getJndiName()); ManagementHome mgmtHome = (ManagementHome) PortableRemoteObject.narrow(obj, ManagementHome.class); Management oc4jmbs = mgmtHome.create(); ! this.mbeanServer = (MBeanServer) GenericMBeanServerProxy.buildServerProxy(oc4jmbs); this.mejb = oc4jmbs; ! */ super.connect(); ! } catch (Exception e) { ! e.printStackTrace(); ! /*NotifyDescriptor d = ! new NotifyDescriptor.Message("Unable to connect to OC4J server at [" + ! this.connectionSettings.getServerUrl() + ! "]. \nCheck to make sure the OC4J server is running on the specified host and port and " + ! "that the user and password you supplied were correct.", ! NotifyDescriptor.ERROR_MESSAGE); ! DialogDisplayer.getDefault().notify(d); ! IOProvider.getDefault().getStdOut().println( ! "Error connecting to OC4J: " + ExceptionUtility.printStackTracesToString(e)); ! */ } finally { Thread.currentThread().setContextClassLoader(contextClassLoader); } --- 73,88 ---- Context oc4jctx = new InitialContext(env); ! ! Object obj = (ManagementHome) oc4jctx.lookup(connectionSettings.getJndiName()); ManagementHome mgmtHome = (ManagementHome) PortableRemoteObject.narrow(obj, ManagementHome.class); Management oc4jmbs = mgmtHome.create(); ! GenericMBeanServerProxy proxy = new GenericMBeanServerProxy(getMBeanServer()); ! setStatsProxy(proxy); ! this.mbeanServer = proxy.buildServerProxy(); this.mejb = oc4jmbs; ! super.connect(); ! } finally { Thread.currentThread().setContextClassLoader(contextClassLoader); } *************** *** 105,111 **** } ! // public Management getMEJB() { ! // return this.mejb; ! // } public MBeanServer getMBeanServer() { --- 99,105 ---- } ! public Management getMEJB() { ! return this.mejb; ! } public MBeanServer getMBeanServer() { Index: PramatiConnectionProvider.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/Attic/PramatiConnectionProvider.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** PramatiConnectionProvider.java 27 Oct 2005 07:03:06 -0000 1.1.2.2 --- PramatiConnectionProvider.java 11 Apr 2006 17:39:13 -0000 1.1.2.3 *************** *** 18,21 **** --- 18,22 ---- import org.mc4j.ems.impl.jmx.connection.support.providers.proxy.JMXRemotingMBeanServerProxy; + import org.mc4j.ems.impl.jmx.connection.support.providers.proxy.StatsProxy; import javax.management.MBeanServer; *************** *** 25,34 **** import javax.management.remote.JMXServiceURL; import javax.naming.Context; ! import java.rmi.ConnectException; import java.util.HashMap; - import java.util.Iterator; import java.util.Map; - import java.net.MalformedURLException; - import java.io.IOException; public class PramatiConnectionProvider extends AbstractConnectionProvider { --- 26,32 ---- import javax.management.remote.JMXServiceURL; import javax.naming.Context; ! import java.io.IOException; import java.util.HashMap; import java.util.Map; public class PramatiConnectionProvider extends AbstractConnectionProvider { *************** *** 41,115 **** private static final String PRAMATI_PROTOCOL_PROVIDER_PACKAGE = "com.pramati.jmx.connector"; - - protected void doConnect() { - try { - ClassLoader currentLoader = Thread.currentThread().getContextClassLoader(); - Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); - ! // Create an RMI connector client ! JMXServiceURL url = new JMXServiceURL(this.connectionSettings.getServerUrl()); ! HashMap env = new HashMap(); ! /*if ((connectionSettings.getInitialContextName() != null) && ! (connectionSettings.getInitialContextName().trim().length() > 0)) { ! env.put(Context.INITIAL_CONTEXT_FACTORY, connectionSettings.getInitialContextName()); ! } else { ! env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.rmi.registry.RegistryContextFactory"); ! }*/ ! env.put(Context.SECURITY_PRINCIPAL, connectionSettings.getPrincipal()); ! env.put(Context.SECURITY_CREDENTIALS, connectionSettings.getCredentials()); ! // Set and custom, advanced properties ! if (connectionSettings.getAdvancedProperties() != null) { ! for (Iterator iterator = connectionSettings.getAdvancedProperties().entrySet().iterator(); iterator.hasNext();) { ! Map.Entry entry = (Map.Entry) iterator.next(); ! String key = (String) entry.getKey(); ! String value = (String) entry.getValue(); ! env.put(key, value); ! } } ! //<prashant> Change here </prashant> ! env.put(PROTOCOL_PROVIDER_PACKAGE, PRAMATI_PROTOCOL_PROVIDER_PACKAGE);//Is this an advanced Property? ! // Set the credential ! String[] credentials = ! new String[] { ! this.connectionSettings.getPrincipal(), ! this.connectionSettings.getCredentials() }; ! env.put(JMXConnector.CREDENTIALS, credentials); ! this.jmxConnector = JMXConnectorFactory.connect(url, env); ! serverConnection = this.jmxConnector.getMBeanServerConnection(); ! //serverConnection.queryNames(null,null); ! this.mbeanServer = JMXRemotingMBeanServerProxy.buildServerProxy(this.serverConnection); - super.connect(); - } catch (ConnectException ce) { - /*NotifyDescriptor d = - new NotifyDescriptor.Message("Unable to connect to server at [" + - this.connectionSettings.getServerUrl() + - "]. \nCheck to make sure the server is running on the specified host and port.", - NotifyDescriptor.ERROR_MESSAGE); - DialogDisplayer.getDefault().notify(d);*/ - } catch (SecurityException se) { - // NotifyDescriptor d = - // new NotifyDescriptor.Message("Invalid username and password combination at [" + - // this.connectionSettings.getServerUrl() + - // "]. \nCheck to make sure the server is running on the specified host and port.", - // NotifyDescriptor.ERROR_MESSAGE); - // DialogDisplayer.getDefault().notify(d); - } catch (MalformedURLException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } } --- 39,94 ---- private static final String PRAMATI_PROTOCOL_PROVIDER_PACKAGE = "com.pramati.jmx.connector"; ! protected void doConnect() throws Exception { ! ClassLoader currentLoader = Thread.currentThread().getContextClassLoader(); ! Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); ! // Create an RMI connector client ! JMXServiceURL url = new JMXServiceURL(this.connectionSettings.getServerUrl()); ! HashMap<String, Object> env = new HashMap<String, Object>(); ! /*if ((connectionSettings.getInitialContextName() != null) && ! (connectionSettings.getInitialContextName().trim().length() > 0)) { ! env.put(Context.INITIAL_CONTEXT_FACTORY, connectionSettings.getInitialContextName()); ! } else { ! env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.rmi.registry.RegistryContextFactory"); ! }*/ + env.put(Context.SECURITY_PRINCIPAL, connectionSettings.getPrincipal()); + env.put(Context.SECURITY_CREDENTIALS, connectionSettings.getCredentials()); ! // Set and custom, advanced properties ! if (connectionSettings.getAdvancedProperties() != null) { ! for (Map.Entry<Object, Object> entry : connectionSettings.getAdvancedProperties().entrySet()) { ! String key = (String) entry.getKey(); ! String value = (String) entry.getValue(); ! env.put(key, value); } ! } ! //<prashant> Change here </prashant> ! env.put(PROTOCOL_PROVIDER_PACKAGE, PRAMATI_PROTOCOL_PROVIDER_PACKAGE);//Is this an advanced Property? ! // Set the credential ! String[] credentials = ! new String[]{ ! this.connectionSettings.getPrincipal(), ! this.connectionSettings.getCredentials()}; ! env.put(JMXConnector.CREDENTIALS, credentials); ! this.jmxConnector = JMXConnectorFactory.connect(url, env); ! serverConnection = this.jmxConnector.getMBeanServerConnection(); ! //serverConnection.queryNames(null,null); ! ! StatsProxy proxy = new JMXRemotingMBeanServerProxy(serverConnection); ! setStatsProxy(proxy); ! this.mbeanServer = proxy.buildServerProxy(); ! ! super.connect(); } Index: WebsphereConnectionProvider.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/Attic/WebsphereConnectionProvider.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** WebsphereConnectionProvider.java 27 Oct 2005 07:03:06 -0000 1.1.2.2 --- WebsphereConnectionProvider.java 11 Apr 2006 17:39:14 -0000 1.1.2.3 *************** *** 21,34 **** import javax.management.MBeanServer; import javax.management.j2ee.Management; - import javax.management.j2ee.ManagementHome; import javax.naming.Context; - import javax.naming.InitialContext; import javax.naming.NamingException; - import javax.rmi.PortableRemoteObject; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.net.URI; - import java.rmi.RemoteException; - import java.util.Hashtable; import java.util.Properties; --- 21,29 ---- *************** *** 42,45 **** --- 37,41 ---- public class WebsphereConnectionProvider extends AbstractConnectionProvider { + protected GenericMBeanServerProxy statsProxy; protected MBeanServer mbeanServer; private Management mejb; *************** *** 48,52 **** ! protected void doConnect() { Context ctx = null; --- 44,48 ---- ! protected void doConnect() throws Exception { Context ctx = null; *************** *** 85,94 **** // TODO GH: LATEST! This works from a SUN VM... // Autodetect the vm and suggest the correct factory ! Hashtable env = new Hashtable(); ! env.put(Context.INITIAL_CONTEXT_FACTORY, ! "com.sun.jndi.cosnaming.CNCtxFactory"); ! env.put(Context.PROVIDER_URL, "corbaname:iiop:localhost:2809/NameServiceServerRoot"); //env.put(Context.PROVIDER_URL, "iiop://localhost:2809/NameServiceServerRoot"); ! ctx = new InitialContext(env); //this.mejb = retrieveMEJB(ctx); --- 81,90 ---- // TODO GH: LATEST! This works from a SUN VM... // Autodetect the vm and suggest the correct factory ! // Hashtable env = new Hashtable(); ! // env.put(Context.INITIAL_CONTEXT_FACTORY, ! // "com.sun.jndi.cosnaming.CNCtxFactory"); ! // env.put(Context.PROVIDER_URL, "corbaname:iiop:localhost:2809/NameServiceServerRoot"); //env.put(Context.PROVIDER_URL, "iiop://localhost:2809/NameServiceServerRoot"); ! // ctx = new InitialContext(env); //this.mejb = retrieveMEJB(ctx); *************** *** 152,157 **** createMethod.invoke(null, new Object[] { props }); ! this.mbeanServer = ! (MBeanServer) GenericMBeanServerProxy.buildServerProxy(adminClient); //this.mejb = retrieveMEJB(ctx); --- 148,153 ---- createMethod.invoke(null, new Object[] { props }); ! this.statsProxy = new GenericMBeanServerProxy(adminClient); ! this.mbeanServer = statsProxy.buildServerProxy(); //this.mejb = retrieveMEJB(ctx); *************** *** 160,172 **** // TODO GH: Customize exception and error messages to help // with typical problems (jsse jars missing, passwords, etc.) - } catch (Exception e) { - // ErrorManager.getDefault().notify(e); - /*NotifyDescriptor d = - new NotifyDescriptor.Message("Unable to connect to server at [" + - this.connectionSettings.getServerUrl() + - "]. \nCheck to make sure the server is running on the specified host and port.", - NotifyDescriptor.ERROR_MESSAGE); - DialogDisplayer.getDefault().notify(d); - */ } finally { Thread.currentThread().setContextClassLoader(contextClassLoader); --- 156,159 ---- *************** *** 182,185 **** --- 169,173 ---- + // public Management getMEJB() { // return mejb; *************** *** 208,210 **** --- 196,207 ---- + public long getRoundTrips() { + return statsProxy.getRoundTrips(); + } + + public long getFailures() { + return statsProxy.getFailures(); + } + + } Index: AbstractConnectionProvider.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/Attic/AbstractConnectionProvider.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** AbstractConnectionProvider.java 12 Dec 2005 14:12:59 -0000 1.1.2.3 --- AbstractConnectionProvider.java 11 Apr 2006 17:39:13 -0000 1.1.2.4 *************** *** 23,26 **** --- 23,27 ---- import org.mc4j.ems.connection.support.ConnectionListener; import org.mc4j.ems.impl.jmx.connection.DConnection; + import org.mc4j.ems.impl.jmx.connection.support.providers.proxy.StatsProxy; import javax.management.MBeanServer; *************** *** 46,53 **** --- 47,58 ---- protected boolean connectionFailure = false; + protected DConnection existingConnection; + protected List<ConnectionListener> connectionListeners = new ArrayList<ConnectionListener>(); private Timer refreshTimer; + private StatsProxy statsProxy; + protected int connectionRoundTrips; *************** *** 97,111 **** doConnect(); } catch (Exception e) { ! throw new EmsConnectException("Could not start connection [" + connectionSettings.getServerUrl() + "]", e); } ! DConnection connection = new DConnection("unknown",this); ! for (ConnectionListener listener : connectionListeners) { listener.connect(); } ! return connection; } --- 102,120 ---- doConnect(); } catch (Exception e) { ! throw new EmsConnectException("Could not connect [" + connectionSettings.getServerUrl() + "] " + e.toString(), e); } ! if (existingConnection == null) { ! DConnection connection = new DConnection("unknown",this); + this.existingConnection = connection; + } else { + this.existingConnection.setConnectionProvider(this); + } for (ConnectionListener listener : connectionListeners) { listener.connect(); } ! return this.existingConnection; } *************** *** 123,127 **** doDisconnect(); } catch (Exception e) { ! throw new EmsConnectException("Could not start connection", e); } --- 132,136 ---- doDisconnect(); } catch (Exception e) { ! throw new EmsConnectException("Could not close connection " + e.toString(), e); } *************** *** 147,156 **** public long getRoundTrips() { ! return 0; } public long getFailures() { ! return 0; } } --- 156,178 ---- public long getRoundTrips() { ! if (statsProxy != null) ! return statsProxy.getRoundTrips(); ! else ! return 0; } public long getFailures() { ! if (statsProxy != null) ! return statsProxy.getFailures(); ! else ! return 0; } + public StatsProxy getStatsProxy() { + return statsProxy; + } + + public void setStatsProxy(StatsProxy statsProxy) { + this.statsProxy = statsProxy; + } } Index: JMXRemotingConnectionProvider.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/Attic/JMXRemotingConnectionProvider.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** JMXRemotingConnectionProvider.java 10 Nov 2005 01:55:04 -0000 1.1.2.3 --- JMXRemotingConnectionProvider.java 11 Apr 2006 17:39:13 -0000 1.1.2.4 *************** *** 22,25 **** --- 22,26 ---- import org.mc4j.ems.impl.jmx.connection.support.providers.proxy.JMXRemotingMBeanServerProxy; import org.mc4j.ems.impl.jmx.connection.support.providers.proxy.JSR77ManagementMBeanServerProxy; + import org.mc4j.ems.impl.jmx.connection.support.providers.proxy.StatsProxy; import javax.management.MBeanServer; *************** *** 28,38 **** --- 29,46 ---- import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL; + import javax.management.remote.rmi.RMIConnector; + import javax.management.remote.rmi.RMIServer; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.rmi.PortableRemoteObject; + import javax.rmi.ssl.SslRMIClientSocketFactory; import java.io.IOException; import java.lang.reflect.Method; import java.net.MalformedURLException; + import java.rmi.NotBoundException; + import java.rmi.RemoteException; + import java.rmi.registry.LocateRegistry; + import java.rmi.registry.Registry; import java.util.Hashtable; import java.util.Map; *************** *** 60,63 **** --- 68,73 ---- protected void doConnect() { try { + + ClassLoader currentLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); *************** *** 125,138 **** env.put(JMXConnector.CREDENTIALS, credentials); - this.jmxConnector = JMXConnectorFactory.connect(url, env); - serverConnection = this.jmxConnector.getMBeanServerConnection(); //serverConnection.queryNames(null,null); if (connectionSettings.getConnectionType().isUseManagementHome()) { ! this.mbeanServer = JSR77ManagementMBeanServerProxy.buildServerProxy(this.mejb); } else { ! this.mbeanServer = JMXRemotingMBeanServerProxy.buildServerProxy(this.serverConnection); } } catch (MalformedURLException e) { throw new EmsConnectException("Malformed url", e); --- 135,160 ---- env.put(JMXConnector.CREDENTIALS, credentials); + testSsl(); + + if (ssl) { + this.jmxConnector = new RMIConnector(sslStub, null); + } else { + this.jmxConnector = JMXConnectorFactory.connect(url, env); + serverConnection = this.jmxConnector.getMBeanServerConnection(); + } //serverConnection.queryNames(null,null); + + + StatsProxy proxy = null; if (connectionSettings.getConnectionType().isUseManagementHome()) { ! proxy = new JSR77ManagementMBeanServerProxy(this.mejb); } else { ! proxy = new JMXRemotingMBeanServerProxy(serverConnection); } + setStatsProxy(proxy); + this.mbeanServer = proxy.buildServerProxy(); + } catch (MalformedURLException e) { throw new EmsConnectException("Malformed url", e); *************** *** 145,148 **** --- 167,214 ---- } + + RMIServer sslStub; + boolean ssl = false; + + private boolean testSsl() { + JMXServiceURL url = null; + String host = null; + int port = 0; + String start = "/jndi/rmi://"; + String end = "/jmxrmi"; + try { + url = new JMXServiceURL(this.connectionSettings.getServerUrl()); + String path = url.getURLPath(); + if (path.startsWith(start)) { + String hostAndPort = path.substring(start.length(), path.length() - end.length()); + String[] hp = hostAndPort.split(":"); + host = hp[0]; + port = Integer.parseInt(hp[1]); + } + + // Try SSL + Registry registry = LocateRegistry.getRegistry(host,port, new SslRMIClientSocketFactory()); + sslStub = (RMIServer) registry.lookup("jmxrmi"); + ssl = true; + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + // Try regular + try { + Registry registry = LocateRegistry.getRegistry(url.getHost(),url.getPort()); + sslStub = (RMIServer) registry.lookup("jmxrmi"); + } catch (RemoteException e1) { + e1.printStackTrace(); + } catch (NotBoundException e1) { + e1.printStackTrace(); + } + + } catch (NotBoundException e) { + e.printStackTrace(); + } + return ssl; + } + public void doDisconnect() throws IOException { this.jmxConnector.close(); Index: JBossConnectionProvider.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/Attic/JBossConnectionProvider.java,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** JBossConnectionProvider.java 12 Dec 2005 14:12:59 -0000 1.1.2.7 --- JBossConnectionProvider.java 11 Apr 2006 17:39:13 -0000 1.1.2.8 *************** *** 17,27 **** package org.mc4j.ems.impl.jmx.connection.support.providers; - import org.mc4j.ems.impl.jmx.connection.support.providers.proxy.GenericMBeanServerProxy; - import org.mc4j.ems.connection.ConnectionException; - import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; import javax.management.MBeanServer; - import javax.naming.CommunicationException; import javax.naming.Context; import javax.naming.InitialContext; --- 17,26 ---- package org.mc4j.ems.impl.jmx.connection.support.providers; import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; + import org.mc4j.ems.connection.ConnectionException; + import org.mc4j.ems.impl.jmx.connection.support.providers.proxy.GenericMBeanServerProxy; import javax.management.MBeanServer; import javax.naming.Context; import javax.naming.InitialContext; *************** *** 43,48 **** public class JBossConnectionProvider extends AbstractConnectionProvider { - private GenericMBeanServerProxy statsProxy; private MBeanServer mbeanServer; // private Management mejb; --- 42,47 ---- public class JBossConnectionProvider extends AbstractConnectionProvider { private MBeanServer mbeanServer; + private GenericMBeanServerProxy proxy; // private Management mejb; *************** *** 63,67 **** // MBeanServerFactory uses it to find their class - // ClassLoader childLoader = new URLClassLoader(new URL[] {}, this.getClass().getClassLoader()); ClassLoader childLoader = this.getClass().getClassLoader(); Thread.currentThread().setContextClassLoader(childLoader); --- 62,65 ---- *************** *** 79,92 **** //RMIConnectorImpl connector = new RMIConnectorImpl(rmiAdaptor); ! ! this.statsProxy = new GenericMBeanServerProxy(rmiAdaptor); ! this.mbeanServer = statsProxy.buildServerProxy(); ! //this.mgmt = retrieveMEJB(); // Set the context classloader back to what it was - } catch (CommunicationException ce) { - // TODO handle communication failures - throw ce; } finally { Thread.currentThread().setContextClassLoader(currentLoader); --- 77,92 ---- //RMIConnectorImpl connector = new RMIConnectorImpl(rmiAdaptor); ! if (this.proxy != null) { ! // This is a reconnect ! proxy.setRemoteServer(rmiAdaptor); ! } else { ! this.proxy = new GenericMBeanServerProxy(rmiAdaptor); ! this.proxy.setProvider(this); ! setStatsProxy(proxy); ! this.mbeanServer = proxy.buildServerProxy(); ! } //this.mgmt = retrieveMEJB(); // Set the context classloader back to what it was } finally { Thread.currentThread().setContextClassLoader(currentLoader); *************** *** 116,119 **** --- 116,121 ---- Principal p = (Principal) simplePrincipalClass.getConstructor(String.class).newInstance(connectionSettings.getPrincipal()); SetPrincipalInfoAction.setPrincipalInfo(p,connectionSettings.getCredentials()); + } catch (ClassNotFoundException e1) { + throw new ConnectionException("Secured connection not available with this version of JBoss " + e1.toString(),e1); } catch (Exception e1) { throw new ConnectionException("Unable to make secured connection to JBoss due to missing or unexpected security classes",e1); *************** *** 168,171 **** --- 170,174 ---- static void setPrincipalInfo(Principal principal, Object credential) { SetPrincipalInfoAction action = new SetPrincipalInfoAction(principal, credential); + //noinspection unchecked AccessController.doPrivileged(action); } *************** *** 192,203 **** - public long getRoundTrips() { - return statsProxy.getRoundTrips(); - } - - public long getFailures() { - return statsProxy.getFailures(); - } - public void doDisconnect() { --- 195,198 ---- |
From: Greg H. <gh...@us...> - 2006-04-11 17:39:17
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8861/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection Modified Files: Tag: ems_module_separation DConnection.java Log Message: Various fixes and tweaks. New ability to reconnect provided by exposing the proxy on the connection to be reestablished for the providers. Only done for jboss so far. Index: DConnection.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/Attic/DConnection.java,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** DConnection.java 12 Dec 2005 14:13:00 -0000 1.1.2.7 --- DConnection.java 11 Apr 2006 17:39:14 -0000 1.1.2.8 *************** *** 64,72 **** ! protected SortedMap<ObjectName, EmsBean> beanMap; protected boolean loaded; ! protected PooledConnectionTracker tracker; protected List<MBeanRegistrationListener> registrationListeners = new ArrayList<MBeanRegistrationListener>(); --- 64,73 ---- ! protected SortedMap<DObjectName, EmsBean> beanMap; protected boolean loaded; ! // TODO Do this with 1.4 support ! // protected PooledConnectionTracker tracker; protected List<MBeanRegistrationListener> registrationListeners = new ArrayList<MBeanRegistrationListener>(); *************** *** 75,85 **** this.connectionName = connectionName; this.connectionProvider = (AbstractConnectionProvider) connectionProvider; ! beanMap = new TreeMap<ObjectName, EmsBean>(new ObjectNameComparator()); // this.tracker = new PooledConnectionTracker(this); } public ConnectionTracker getTracker() { ! return tracker; } --- 76,91 ---- this.connectionName = connectionName; this.connectionProvider = (AbstractConnectionProvider) connectionProvider; ! beanMap = new TreeMap<DObjectName, EmsBean>(new DObjectNameComparator()); // this.tracker = new PooledConnectionTracker(this); } + public void setConnectionProvider(AbstractConnectionProvider connectionProvider) { + this.connectionProvider = connectionProvider; + } + public ConnectionTracker getTracker() { ! // return tracker; ! return null; } *************** *** 89,98 **** loadSynchronous(false); } catch (Exception e) { ! log.warn("Could not refresh connection " + connectionProvider.getConnectionSettings().getServerUrl(), e); } } public void close() { ! tracker.stopTracker(); connectionProvider.disconnect(); } --- 95,105 ---- loadSynchronous(false); } catch (Exception e) { ! log.warn("Could not refresh connection [" + connectionProvider.getConnectionSettings().getServerUrl() + "] " + e.toString(), e); } } public void close() { ! ! // tracker.stopTracker(); connectionProvider.disconnect(); } *************** *** 136,140 **** log.info("Found " + objectNames.size() + " MBeans, starting load"); ! Set<ObjectName> currentKeys = new HashSet<ObjectName>(this.beanMap.keySet()); for (ObjectName objectName : objectNames) { --- 143,147 ---- log.info("Found " + objectNames.size() + " MBeans, starting load"); ! Set<DObjectName> currentKeys = new HashSet<DObjectName>(this.beanMap.keySet()); for (ObjectName objectName : objectNames) { *************** *** 155,160 **** } ! for (ObjectName name : currentKeys) { ! if (!retrievedBeansMap.containsKey(name)) { removedBeans.add(beanMap.remove(name)); } --- 162,167 ---- } ! for (DObjectName name : currentKeys) { ! if (!retrievedBeansMap.containsKey(name.getObjectName())) { removedBeans.add(beanMap.remove(name)); } *************** *** 180,187 **** private DMBean mapBean(ConnectionProvider provider, ObjectName objectName, boolean loadSynchronous) { DMBean bean = null; // If the bean is unkown to the internal map, create our local representation and add it synchronized (this) { ! if (!this.beanMap.keySet().contains(objectName)) { if (isJMX12) { bean = new DAdvancedBean(connectionProvider, objectName); --- 187,195 ---- private DMBean mapBean(ConnectionProvider provider, ObjectName objectName, boolean loadSynchronous) { DMBean bean = null; + DObjectName dObjectName = new DObjectName(objectName); // If the bean is unkown to the internal map, create our local representation and add it synchronized (this) { ! if (!this.beanMap.keySet().contains(dObjectName)) { if (isJMX12) { bean = new DAdvancedBean(connectionProvider, objectName); *************** *** 189,193 **** bean = new DMBean(connectionProvider, objectName); } ! beanMap.put(objectName, bean); } } --- 197,201 ---- bean = new DMBean(connectionProvider, objectName); } ! beanMap.put(dObjectName, bean); } } *************** *** 205,209 **** if (bean == null) { ! return (DMBean) this.beanMap.get(objectName); } else { return bean; --- 213,217 ---- if (bean == null) { ! return (DMBean) this.beanMap.get(dObjectName); } else { return bean; *************** *** 267,271 **** protected EmsBean getBean(ObjectName objectName) { ! return this.beanMap.get(objectName); } --- 275,279 ---- protected EmsBean getBean(ObjectName objectName) { ! return this.beanMap.get(new DObjectName(objectName)); } *************** *** 378,380 **** --- 386,439 ---- } } + + public ConnectionProvider getConnectionProvider() { + return connectionProvider; + } + + /** + * Some object name implementations are not equal if the properties are in different orders. + * The RI compares cannonical property forms as expected, JBoss is broken. + * + * This class is a key to search and get around that potential issue by always key on + * the cannoical form, but ordering by the default form. + */ + public static class DObjectName { + + private ObjectName objectName; + + public DObjectName(ObjectName objectName) { + this.objectName = objectName; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + final DObjectName that = (DObjectName) o; + + return objectName.getCanonicalName().equals(that.objectName.getCanonicalName()); + } + + public int hashCode() { + return objectName.getCanonicalName().hashCode(); + } + + public int compareTo(DObjectName o) { + return toString().compareTo(o.toString()); + } + + public String toString() { + return objectName.toString(); + } + + public ObjectName getObjectName() { + return objectName; + } + } + + public static class DObjectNameComparator implements Comparator<DObjectName> { + public int compare(DObjectName o1, DObjectName o2) { + return o1.getObjectName().getCanonicalName().compareTo(o2.getObjectName().getCanonicalName()); + } + } } |
From: Greg H. <gh...@us...> - 2006-04-11 17:39:17
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8861/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean Modified Files: Tag: ems_module_separation DMBean.java Log Message: Various fixes and tweaks. New ability to reconnect provided by exposing the proxy on the connection to be reestablished for the providers. Only done for jboss so far. Index: DMBean.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean/Attic/DMBean.java,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** DMBean.java 12 Dec 2005 14:12:59 -0000 1.1.2.7 --- DMBean.java 11 Apr 2006 17:39:13 -0000 1.1.2.8 *************** *** 62,65 **** --- 62,66 ---- protected ObjectName objectName; + protected EmsBeanName beanName; *************** *** 155,160 **** --- 156,163 ---- this.notifications.put(notificationInfo.getName(), notification); } + loaded = true; } catch (InstanceNotFoundException infe) { this.deleted = true; + } catch (Exception e) { unsupportedType = true; *************** *** 198,201 **** --- 201,206 ---- public List<EmsAttribute> refreshAttributes() { + if (info == null) + loadSynchronous(); MBeanAttributeInfo[] infos = this.info.getAttributes(); *************** *** 335,339 **** e.printStackTrace(); } catch (InstanceNotFoundException e) { ! throw new EmsBeanNotFoundException("Could not unregister bean [" + getObjectName().getCanonicalName() + "]", e); } } --- 340,344 ---- e.printStackTrace(); } catch (InstanceNotFoundException e) { ! throw new EmsBeanNotFoundException("Could not unregister bean, instance not found [" + getObjectName().getCanonicalName() + "]", e); } } |
From: Greg H. <gh...@us...> - 2006-04-11 17:37:27
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/bean In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7221/modules/ems/src/ems/org/mc4j/ems/connection/bean Modified Files: Tag: ems_module_separation EmsBean.java Log Message: Various fixes and tweaks. New ability to reconnect provided by exposing the proxy on the connection to be reestablished for the providers. Only done for jboss so far. |
From: Greg H. <gh...@us...> - 2006-04-11 17:37:27
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/support/metadata In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7221/modules/ems/src/ems/org/mc4j/ems/connection/support/metadata Modified Files: Tag: ems_module_separation JBossConnectionTypeDescriptor.java Log Message: Various fixes and tweaks. New ability to reconnect provided by exposing the proxy on the connection to be reestablished for the providers. Only done for jboss so far. Index: JBossConnectionTypeDescriptor.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/support/metadata/Attic/JBossConnectionTypeDescriptor.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** JBossConnectionTypeDescriptor.java 10 Nov 2005 01:55:03 -0000 1.1.2.3 --- JBossConnectionTypeDescriptor.java 11 Apr 2006 17:37:19 -0000 1.1.2.4 *************** *** 79,101 **** new String[] { // 3.x + jars ! "jboss-jmx.jar", ! "jboss-common.jar", ! "jboss-system.jar", ! "jbossall-client.jar", ! "log4j.jar", ! "jboss.jar", ! "concurrent.jar", ! "jboss-jsr77-client.jar", // 3.2.3 jars ! "jboss-transaction.jar", "lib/xercesImpl.jar", "lib/xml-apis.jar", // 4.0 jars ! "dom4j.jar", ! "jnp-client.jar", ! "jmx-rmi-connector-client.jar", ! "jboss-j2ee.jar", ! "jboss-management.jar", ! "jbosssx.jar", "lib/endorsed/xercesImpl.jar", "lib/endorsed/xml-apis.jar" --- 79,101 ---- new String[] { // 3.x + jars ! "lib/jboss-jmx.jar", ! "client/jboss-common.jar", ! "lib/jboss-system.jar", ! "client/jbossall-client.jar", ! "client/log4j.jar", ! "*/*/lib/jboss.jar", ! "client/concurrent.jar", ! "client/jboss-jsr77-client.jar", // 3.2.3 jars ! "*/*/lib/jboss-transaction.jar", "lib/xercesImpl.jar", "lib/xml-apis.jar", // 4.0 jars ! "lib/dom4j.jar", ! "client/jnp-client.jar", ! "client/jmx-rmi-connector-client.jar", ! "client/jboss-j2ee.jar", ! "*/*/lib/jboss-management.jar", ! "client/jbosssx.jar", "lib/endorsed/xercesImpl.jar", "lib/endorsed/xml-apis.jar" |
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7221/modules/ems/src/ems/org/mc4j/ems/connection Modified Files: Tag: ems_module_separation ConnectionFactory.java EmsConnectException.java EmsConnection.java EmsException.java Log Message: Various fixes and tweaks. New ability to reconnect provided by exposing the proxy on the connection to be reestablished for the providers. Only done for jboss so far. Index: EmsConnectException.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/Attic/EmsConnectException.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** EmsConnectException.java 27 Oct 2005 07:03:06 -0000 1.1.2.1 --- EmsConnectException.java 11 Apr 2006 17:37:19 -0000 1.1.2.2 *************** *** 30,32 **** --- 30,36 ---- super(message, cause); } + + public EmsConnectException(Throwable cause) { + super(cause); + } } Index: EmsConnection.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/Attic/EmsConnection.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** EmsConnection.java 12 Dec 2005 14:12:59 -0000 1.1.2.6 --- EmsConnection.java 11 Apr 2006 17:37:19 -0000 1.1.2.7 *************** *** 18,21 **** --- 18,22 ---- import org.mc4j.ems.connection.bean.EmsBean; + import org.mc4j.ems.connection.support.ConnectionProvider; import java.util.List; *************** *** 81,83 **** --- 82,91 ---- */ long getFailures(); + + /** + * + * @since 1.0.6 + * @return + */ + public ConnectionProvider getConnectionProvider(); } Index: ConnectionFactory.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/Attic/ConnectionFactory.java,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -C2 -d -r1.1.2.8 -r1.1.2.9 *** ConnectionFactory.java 12 Dec 2005 14:12:59 -0000 1.1.2.8 --- ConnectionFactory.java 11 Apr 2006 17:37:19 -0000 1.1.2.9 *************** *** 26,29 **** --- 26,30 ---- import java.io.File; import java.io.FilenameFilter; + import java.io.FileFilter; import java.util.ArrayList; import java.util.Arrays; *************** *** 36,39 **** --- 37,48 ---- public class ConnectionFactory { + private static final String BROAD_SEARCH_PROPERTY = "mc4j.ems.fileSearchBroad"; + private static final int DEFAULT_SEARCH_DEPTH = 6; + private static final String SEARCH_DEPTH_PROPERTY = "mc4j.ems.fileSearchDepth"; + + private boolean broadSearch = false; + private int searchDepth = DEFAULT_SEARCH_DEPTH; + + private static Log log = LogFactory.getLog(ConnectionFactory.class); *************** *** 62,65 **** --- 71,83 ---- } + public ConnectionFactory() { + if (System.getProperty(BROAD_SEARCH_PROPERTY) != null) { + broadSearch = Boolean.valueOf(System.getProperty(BROAD_SEARCH_PROPERTY)); + } + if (System.getProperty(SEARCH_DEPTH_PROPERTY) != null) { + searchDepth = Integer.parseInt(System.getProperty(SEARCH_DEPTH_PROPERTY)); + } + } + public EmsConnection connect(ConnectionSettings connectionSettings) { *************** *** 113,116 **** --- 131,135 ---- public void discoverServerClasses(ConnectionSettings connectionSettings) { if (connectionSettings.getLibraryURI() != null) { + long start = System.currentTimeMillis(); String[] serverFiles = connectionSettings.getConnectionType().getConnectionClasspathEntries(); *************** *** 127,134 **** for (String serverFile : serverFiles) { log.debug("Searching for library " + serverFile); File[] matchedFiles = null; try { ! if (serverFile.indexOf('/') > 0) { matchedFiles = findDeepFiles(serverInstall, serverFile); } else { --- 146,158 ---- for (String serverFile : serverFiles) { + if (broadSearch && serverFile.indexOf('/') >= 0) { + serverFile = serverFile.substring(serverFile.lastIndexOf('/')+1); + } + + log.debug("Searching for library " + serverFile); File[] matchedFiles = null; try { ! if (serverFile.indexOf('/') >= 0) { matchedFiles = findDeepFiles(serverInstall, serverFile); } else { *************** *** 157,165 **** else connectionSettings.getClassPathEntries().addAll(foundFiles); } } ! public static File findFile(File directory, String filename) { File[] children = directory.listFiles(); if (children == null) --- 181,197 ---- else connectionSettings.getClassPathEntries().addAll(foundFiles); + + log.info("Discovered libraries in " + (System.currentTimeMillis() - start) + " ms"); } } ! private File findFile(File directory, String filename) { ! return findFile(directory, filename, 1); ! } ! ! private File findFile(File directory, String filename, int depth) { ! if (depth > searchDepth) ! return null; File[] children = directory.listFiles(); if (children == null) *************** *** 167,171 **** for (File child : children) { if (child.isDirectory()) { ! File result = findFile(child, filename); if (result != null) return result; --- 199,203 ---- for (File child : children) { if (child.isDirectory()) { ! File result = findFile(child, filename, depth + 1); if (result != null) return result; *************** *** 179,183 **** ! public static File[] findDeepFiles(File directory, String filename) { int in = filename.indexOf("/"); if (in < 0) { --- 211,217 ---- ! private File[] findDeepFiles(File directory, String filename) { ! if (filename.startsWith("/")) ! filename = filename.substring(1); int in = filename.indexOf("/"); if (in < 0) { *************** *** 197,211 **** String restOfName = filename.substring(in + 1, filename.length()); ! File childDir = getChild(directory, dir); ! if (childDir == null) { log.debug("Could not find " + directory.getAbsolutePath() + " :: " + restOfName); return null; } else { ! return findDeepFiles(childDir, restOfName); } } } ! public static File getChild(File directory, final String childName) { if (directory == null) return null; --- 231,266 ---- String restOfName = filename.substring(in + 1, filename.length()); ! if (dir.equals("*")) { ! File[] children = directory.listFiles(new DirectoryFilter()); ! if (children != null) { ! for (File child : children) { ! File[] childDir = findDeepFiles(child, restOfName); ! if (childDir != null) { ! return childDir; ! } ! } ! } log.debug("Could not find " + directory.getAbsolutePath() + " :: " + restOfName); return null; } else { ! File childDir = getChild(directory, dir); ! if (childDir == null) { ! log.debug("Could not find " + directory.getAbsolutePath() + " :: " + restOfName); ! return null; ! } else { ! return findDeepFiles(childDir, restOfName); ! } } } } ! private static class DirectoryFilter implements FileFilter { ! public boolean accept(File pathname) { ! return pathname.isDirectory(); ! } ! ! } ! ! public File getChild(File directory, final String childName) { if (directory == null) return null; Index: EmsException.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/Attic/EmsException.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** EmsException.java 26 May 2005 17:27:24 -0000 1.1.2.1 --- EmsException.java 11 Apr 2006 17:37:19 -0000 1.1.2.2 *************** *** 31,33 **** --- 31,37 ---- } + public EmsException(Throwable cause) { + super(cause); + } + } |
From: Talluri, C. <Cha...@FM...> - 2005-12-19 16:13:17
|
> If local server is not started I am getting following error if I try > to connect to any external websphere 5.x server=20 >=20 > javax.naming.CommunicationException: Cannot connect to ORB. Root > exception is org.omg.CORBA.COMM_FAILURE: WRITE_ERROR_SEND_1 vmcid: > 0x49421000 minor code: 50 completed: No > at > com.ibm.ws.orbimpl.transport.HTTPOutputStream.write(HTTPOutputStream.j > ava:178) > at > com.ibm.rmi.iiop.IIOPOutputStream.writeTo(IIOPOutputStream.java:314) > at com.ibm.rmi.iiop.Connection.send(Connection.java:1504) > at com.ibm.rmi.iiop.Connection._locate(Connection.java:270) > at com.ibm.rmi.iiop.Connection.locate(Connection.java:249) > at com.ibm.rmi.iiop.GIOPImpl.locate(GIOPImpl.java:186) > at com.ibm.rmi.corba.Corbaloc.locateUsingINS(Corbaloc.java:306) > at com.ibm.rmi.corba.Corbaloc.resolve(Corbaloc.java:377) > at com.ibm.rmi.corba.ORB.objectURLToObject(ORB.java:3368) > at com.ibm.CORBA.iiop.ORB.objectURLToObject(ORB.java:3237) > at com.ibm.rmi.corba.ORB.string_to_object(ORB.java:3254) > at > com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:386) > at > com.sun.jndi.cosnaming.CNCtx.initUsingCorbanameUrl(CNCtx.java:369) > at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:288) > at > com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:237) > at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:85) > at > com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.jav > a:49) > at > javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:67 > 4) > at > javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:256) > at javax.naming.InitialContext.init(InitialContext.java:232) > at javax.naming.InitialContext.<init>(InitialContext.java:208) > at > org.mc4j.console.connection.WebsphereConnectionNode.connect(WebsphereC > onnectionNode.java:93) > at > org.mc4j.console.connection.ReconnectAction.performAction(ReconnectAct > ion.java:47) > at > org.openide.util.actions.NodeAction$3.run(NodeAction.java:440) > at > org.openide.util.actions.CallableSystemAction$ActionRunnable.actionPer > formed(CallableSystemAction.java:247) > at > org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:74) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j > ava:79) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess > orImpl.java(Compiled Code)) > at java.lang.reflect.Method.invoke(Method.java(Compiled Code)) > at > org.openide.util.actions.CallableSystemAction.invokeAction(CallableSys > temAction.java:179) > at > org.openide.util.actions.CallableSystemAction.access$000(CallableSyste > mAction.java:31) > at > org.openide.util.actions.CallableSystemAction$ActionRunnable.doRun(Cal > lableSystemAction.java:241) > at > org.openide.util.actions.CallableSystemAction$2.run(CallableSystemActi > on.java:111) > at org.openide.util.Task.run(Task.java:136) > at > org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330) > [catch] at > org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java: > 686) > =3D=3D> > org.omg.CORBA.COMM_FAILURE: WRITE_ERROR_SEND_1 vmcid: 0x49421000 > minor code: 50 completed: No > at > com.ibm.ws.orbimpl.transport.HTTPOutputStream.write(HTTPOutputStream.j > ava:178) > at > com.ibm.rmi.iiop.IIOPOutputStream.writeTo(IIOPOutputStream.java:314) > at com.ibm.rmi.iiop.Connection.send(Connection.java:1504) > at com.ibm.rmi.iiop.Connection._locate(Connection.java:270) > at com.ibm.rmi.iiop.Connection.locate(Connection.java:249) > at com.ibm.rmi.iiop.GIOPImpl.locate(GIOPImpl.java:186) > at com.ibm.rmi.corba.Corbaloc.locateUsingINS(Corbaloc.java:306) > at com.ibm.rmi.corba.Corbaloc.resolve(Corbaloc.java:377) > at com.ibm.rmi.corba.ORB.objectURLToObject(ORB.java:3368) > at com.ibm.CORBA.iiop.ORB.objectURLToObject(ORB.java:3237) > at com.ibm.rmi.corba.ORB.string_to_object(ORB.java:3254) > at > com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:386) > at > com.sun.jndi.cosnaming.CNCtx.initUsingCorbanameUrl(CNCtx.java:369) > at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:288) > at > com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:237) > at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:85) > at > com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.jav > a:49) > at > javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:67 > 4) > at > javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:256) > at javax.naming.InitialContext.init(InitialContext.java:232) > at javax.naming.InitialContext.<init>(InitialContext.java:208) > at > org.mc4j.console.connection.WebsphereConnectionNode.connect(WebsphereC > onnectionNode.java:93) > at > org.mc4j.console.connection.ReconnectAction.performAction(ReconnectAct > ion.java:47) > at > org.openide.util.actions.NodeAction$3.run(NodeAction.java:440) > at > org.openide.util.actions.CallableSystemAction$ActionRunnable.actionPer > formed(CallableSystemAction.java:247) > at > org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:74) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j > ava:79) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess > orImpl.java(Compiled Code)) > at java.lang.reflect.Method.invoke(Method.java(Compiled Code)) > at > org.openide.util.actions.CallableSystemAction.invokeAction(CallableSys > temAction.java:179) > at > org.openide.util.actions.CallableSystemAction.access$000(CallableSyste > mAction.java:31) > at > org.openide.util.actions.CallableSystemAction$ActionRunnable.doRun(Cal > lableSystemAction.java:241) > at > org.openide.util.actions.CallableSystemAction$2.run(CallableSystemActi > on.java:111) > at org.openide.util.Task.run(Task.java:136) > at > org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330) > [catch] at > org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java: > 686) >=20 > If my local server is started it works fine >=20 > -Thanks > Chandra Talluri >=20 > Email Confidentiality Notice: The information in this email and > subsequent attachments may contain confidential information that is > intended solely for the attention and use of the named addressee(s). > This message or any part thereof must not be disclosed, copied, > distributed or retained by any person without authorization from > Fidelity Investments >=20 |
From: Greg H. <gh...@us...> - 2005-12-12 14:14:32
|
Update of /cvsroot/mc4j/mc4j/modules/ems In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22486/modules/ems Modified Files: Tag: ems_module_separation build.xml Log Message: New statistics tracking for MBeanServer communications (roundtrips + failures) Support for Secured JBoss invoker prior to JndiLoginInitialContextFactory Index: build.xml =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/Attic/build.xml,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** build.xml 17 Nov 2005 19:57:49 -0000 1.1.2.7 --- build.xml 12 Dec 2005 14:14:12 -0000 1.1.2.8 *************** *** 31,35 **** <property name="module.jar" value="org-mc4j-ems.jar"/> ! <property name="release.version" value="1.0.4"/> --- 31,35 ---- <property name="module.jar" value="org-mc4j-ems.jar"/> ! <property name="release.version" value="1.0.5"/> |
From: Greg H. <gh...@us...> - 2005-12-12 14:13:25
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/settings In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22177/modules/ems/src/ems/org/mc4j/ems/connection/settings Modified Files: Tag: ems_module_separation ConnectionSettings.java Log Message: New statistics tracking for MBeanServer communications (roundtrips + failures) Support for Secured JBoss invoker prior to JndiLoginInitialContextFactory Index: ConnectionSettings.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/settings/Attic/ConnectionSettings.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** ConnectionSettings.java 10 Nov 2005 01:55:03 -0000 1.1.2.3 --- ConnectionSettings.java 12 Dec 2005 14:12:59 -0000 1.1.2.4 *************** *** 33,37 **** * @version $Revision$($Author$ / $Date$) */ ! public class ConnectionSettings implements Serializable { --- 33,37 ---- * @version $Revision$($Author$ / $Date$) */ ! public class ConnectionSettings implements Serializable, Comparable { *************** *** 47,50 **** --- 47,52 ---- private Properties advancedProperties; + private Properties controlProperties = new Properties(); + private boolean autoConnect; *************** *** 62,66 **** * Version 2: 1.3 */ ! private static final long serialVersionUID = 2; --- 64,68 ---- * Version 2: 1.3 */ ! private static final long serialVersionUID = 3; *************** *** 77,81 **** new java.io.ObjectStreamField("principal", java.lang.String.class), new java.io.ObjectStreamField("serverUrl", java.lang.String.class), ! new java.io.ObjectStreamField("advancedProperties", Properties.class)}; --- 79,84 ---- new java.io.ObjectStreamField("principal", java.lang.String.class), new java.io.ObjectStreamField("serverUrl", java.lang.String.class), ! new java.io.ObjectStreamField("advancedProperties", Properties.class), ! new java.io.ObjectStreamField("controlProperties", Properties.class)}; *************** *** 306,309 **** --- 309,324 ---- } + public int compareTo(Object o) { + return getConnectionName().compareTo(((ConnectionSettings)o).getConnectionName()); + } + + + public Properties getControlProperties() { + return controlProperties; + } + + public void setControlProperties(Properties controlProperties) { + this.controlProperties = controlProperties; + } public String toString() { |
From: Greg H. <gh...@us...> - 2005-12-12 14:13:25
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22177/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection Modified Files: Tag: ems_module_separation DConnection.java Log Message: New statistics tracking for MBeanServer communications (roundtrips + failures) Support for Secured JBoss invoker prior to JndiLoginInitialContextFactory Index: DConnection.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/Attic/DConnection.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** DConnection.java 17 Nov 2005 19:57:49 -0000 1.1.2.6 --- DConnection.java 12 Dec 2005 14:13:00 -0000 1.1.2.7 *************** *** 355,358 **** --- 355,367 ---- } + + public long getRoundTrips() { + return connectionProvider.getRoundTrips(); + } + + public long getFailures() { + return connectionProvider.getFailures(); + } + public Object buildObjectName(String objectName) throws EmsMalformedObjectNameException { try { |
From: Greg H. <gh...@us...> - 2005-12-12 14:13:25
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/test/org/mc4j/ems/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22177/modules/ems/src/test/org/mc4j/ems/test Modified Files: Tag: ems_module_separation MultiConnectionTest.java Log Message: New statistics tracking for MBeanServer communications (roundtrips + failures) Support for Secured JBoss invoker prior to JndiLoginInitialContextFactory Index: MultiConnectionTest.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/test/org/mc4j/ems/test/Attic/MultiConnectionTest.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** MultiConnectionTest.java 17 Nov 2005 18:44:29 -0000 1.1.2.3 --- MultiConnectionTest.java 12 Dec 2005 14:13:00 -0000 1.1.2.4 *************** *** 43,48 **** // jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss-3.2.3"); // jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss-3.2.5"); ! jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss 4/"); jboss.setPrincipal("admin"); jboss.setCredentials("admin"); --- 43,49 ---- // jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss-3.2.3"); + jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss-3.2.4"); // jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss-3.2.5"); ! // jboss.setLibraryURI("/Users/ghinkle/development/tools/jboss 4/"); jboss.setPrincipal("admin"); jboss.setCredentials("admin"); |
From: Greg H. <gh...@us...> - 2005-12-12 14:13:25
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22177/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean Modified Files: Tag: ems_module_separation DMBean.java Log Message: New statistics tracking for MBeanServer communications (roundtrips + failures) Support for Secured JBoss invoker prior to JndiLoginInitialContextFactory Index: DMBean.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean/Attic/DMBean.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** DMBean.java 17 Nov 2005 19:57:49 -0000 1.1.2.6 --- DMBean.java 12 Dec 2005 14:12:59 -0000 1.1.2.7 *************** *** 189,193 **** public SortedSet<EmsAttribute> getAttributes() { ! if (!loaded) loadSynchronous(); return new TreeSet<EmsAttribute>(this.attributes.values()); --- 189,193 ---- public SortedSet<EmsAttribute> getAttributes() { ! if (!loaded) loadSynchronous(); return new TreeSet<EmsAttribute>(this.attributes.values()); *************** *** 351,353 **** --- 351,357 ---- } + + public String toString() { + return this.getBeanName().toString(); + } } |
From: Greg H. <gh...@us...> - 2005-12-12 14:13:25
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22177/modules/ems/src/ems/org/mc4j/ems/connection Modified Files: Tag: ems_module_separation ConnectionFactory.java EmsConnection.java Log Message: New statistics tracking for MBeanServer communications (roundtrips + failures) Support for Secured JBoss invoker prior to JndiLoginInitialContextFactory Index: EmsConnection.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/Attic/EmsConnection.java,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** EmsConnection.java 17 Nov 2005 19:57:48 -0000 1.1.2.5 --- EmsConnection.java 12 Dec 2005 14:12:59 -0000 1.1.2.6 *************** *** 67,69 **** --- 67,83 ---- */ Object buildObjectName(String objectName) throws EmsMalformedObjectNameException ; + + /** + * + * @return + * @since 1.0.5 + */ + long getRoundTrips(); + + /** + * + * @return + * @since 1.0.5 + */ + long getFailures(); } |
From: Greg H. <gh...@us...> - 2005-12-12 14:13:22
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean/attribute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22177/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean/attribute Modified Files: Tag: ems_module_separation DAttribute.java Log Message: New statistics tracking for MBeanServer communications (roundtrips + failures) Support for Secured JBoss invoker prior to JndiLoginInitialContextFactory Index: DAttribute.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/bean/attribute/Attic/DAttribute.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** DAttribute.java 27 Oct 2005 07:03:06 -0000 1.1.2.2 --- DAttribute.java 12 Dec 2005 14:12:59 -0000 1.1.2.3 *************** *** 17,38 **** package org.mc4j.ems.impl.jmx.connection.bean.attribute; import org.mc4j.ems.connection.bean.attribute.AttributeChangeEvent; import org.mc4j.ems.connection.bean.attribute.AttributeChangeListener; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; - import org.mc4j.ems.connection.EmsException; import org.mc4j.ems.impl.jmx.connection.bean.DMBean; - import org.mc4j.ems.store.CompleteValueHistory; import org.mc4j.ems.store.Value; import org.mc4j.ems.store.ValueHistory; ! import org.apache.commons.logging.Log; ! import org.apache.commons.logging.LogFactory; ! import javax.management.*; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.UndeclaredThrowableException; import java.math.BigDecimal; import java.math.BigInteger; ! import java.util.*; ! import java.io.NotSerializableException; /** --- 17,49 ---- package org.mc4j.ems.impl.jmx.connection.bean.attribute; + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; + import org.mc4j.ems.connection.EmsException; import org.mc4j.ems.connection.bean.attribute.AttributeChangeEvent; import org.mc4j.ems.connection.bean.attribute.AttributeChangeListener; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.mc4j.ems.impl.jmx.connection.bean.DMBean; import org.mc4j.ems.store.Value; import org.mc4j.ems.store.ValueHistory; ! import org.mc4j.ems.store.CompleteValueHistory; ! import javax.management.Attribute; ! import javax.management.AttributeNotFoundException; ! import javax.management.InstanceNotFoundException; ! import javax.management.MBeanAttributeInfo; ! import javax.management.MBeanException; ! import javax.management.MBeanServer; ! import javax.management.ReflectionException; ! import java.io.NotSerializableException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.UndeclaredThrowableException; import java.math.BigDecimal; import java.math.BigInteger; ! import java.util.HashMap; ! import java.util.HashSet; ! import java.util.LinkedList; ! import java.util.List; ! import java.util.Map; ! import java.util.Set; /** *************** *** 62,70 **** this.info = info; this.bean = bean; ! // TODO GH: configurable or customizable ! this.valueHistory = new CompleteValueHistory(); } // TODO GH: Should you be able to register for a certain frequency? and then be guaranteed that the // notifications won't be faster than that? Then the requests could be grouped as well --- 73,110 ---- this.info = info; this.bean = bean; + init(); + } ! ! /** ! * Initializes internal storage settings for the value history ! */ ! protected void init() { ! if (Boolean.valueOf(getControlProperty(CONTROL_ATTRIBUTE_HISTORY,"true"))) { ! ! String historyClass = getControlProperty(CONTROL_ATTRIBUTE_HISTORY_CLASS, null); ! ! if (historyClass != null) { ! try { ! this.valueHistory = (ValueHistory) Class.forName(historyClass).newInstance(); ! ! } catch (InstantiationException e) { ! throw new EmsException("Could not instantiate value history class",e); ! } catch (IllegalAccessException e) { ! throw new EmsException("Could not access value history class",e); ! } catch (ClassNotFoundException e) { ! throw new EmsException("Configured ValueHistory class not found",e); ! } ! } else { ! this.valueHistory = new CompleteValueHistory(Integer.valueOf(getControlProperty(CONTROL_ATTRIBUTE_HISTORY_DEPTH,"1"))); ! } ! } } + private String getControlProperty(String property,String defaultValue) { + return bean.getConnectionProvider().getConnectionSettings().getControlProperties().getProperty(property,defaultValue); + } + + // TODO GH: Should you be able to register for a certain frequency? and then be guaranteed that the // notifications won't be faster than that? Then the requests could be grouped as well *************** *** 169,173 **** } catch (AttributeNotFoundException e) { registerFailure(e); ! throw new EmsException("Could not load attribute value",e); } catch(UndeclaredThrowableException e) { if (e.getUndeclaredThrowable() instanceof InvocationTargetException) { --- 209,213 ---- } catch (AttributeNotFoundException e) { registerFailure(e); ! throw new EmsException("Could not load attribute value, attribute [" + getName() + "] not found",e); } catch(UndeclaredThrowableException e) { if (e.getUndeclaredThrowable() instanceof InvocationTargetException) { |
From: Greg H. <gh...@us...> - 2005-12-12 14:13:19
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/store In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22177/modules/ems/src/ems/org/mc4j/ems/store Modified Files: Tag: ems_module_separation CompleteValueHistory.java ValueHistory.java Log Message: New statistics tracking for MBeanServer communications (roundtrips + failures) Support for Secured JBoss invoker prior to JndiLoginInitialContextFactory Index: CompleteValueHistory.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/store/Attic/CompleteValueHistory.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** CompleteValueHistory.java 26 May 2005 17:27:24 -0000 1.1.2.1 --- CompleteValueHistory.java 12 Dec 2005 14:12:59 -0000 1.1.2.2 *************** *** 32,36 **** protected List<Value> values = new LinkedList<Value>(); ! protected long historySize; public CompleteValueHistory() { --- 32,36 ---- protected List<Value> values = new LinkedList<Value>(); ! protected int historySize; public CompleteValueHistory() { *************** *** 38,50 **** } ! public CompleteValueHistory(long historySize) { this.historySize = historySize; } ! public long getHistorySize() { return values.size(); } ! public void setMaximumHistorySize(long historySize) { this.historySize = historySize; } --- 38,50 ---- } ! public CompleteValueHistory(int historySize) { this.historySize = historySize; } ! public int getHistorySize() { return values.size(); } ! public void setMaximumHistorySize(int historySize) { this.historySize = historySize; } Index: ValueHistory.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/store/Attic/ValueHistory.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** ValueHistory.java 26 May 2005 17:27:24 -0000 1.1.2.1 --- ValueHistory.java 12 Dec 2005 14:12:59 -0000 1.1.2.2 *************** *** 8,12 **** */ public interface ValueHistory { ! long getHistorySize(); List<Value> getValues(); --- 8,12 ---- */ public interface ValueHistory { ! int getHistorySize(); List<Value> getValues(); |
From: Greg H. <gh...@us...> - 2005-12-12 14:13:19
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22177/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/proxy Modified Files: Tag: ems_module_separation GenericMBeanServerProxy.java Added Files: Tag: ems_module_separation StatsProxy.java Log Message: New statistics tracking for MBeanServer communications (roundtrips + failures) Support for Secured JBoss invoker prior to JndiLoginInitialContextFactory Index: GenericMBeanServerProxy.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/proxy/Attic/GenericMBeanServerProxy.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** GenericMBeanServerProxy.java 17 Nov 2005 18:44:29 -0000 1.1.2.4 --- GenericMBeanServerProxy.java 12 Dec 2005 14:12:59 -0000 1.1.2.5 *************** *** 34,41 **** * @version $Revision$($Author$ / $Date$) */ ! public class GenericMBeanServerProxy implements InvocationHandler { private Object remoteServer; /** Creates a new instance of Proxy */ public GenericMBeanServerProxy(Object remoteServer) { --- 34,45 ---- * @version $Revision$($Author$ / $Date$) */ ! public class GenericMBeanServerProxy implements InvocationHandler, StatsProxy { private Object remoteServer; + private long roundTrips; + + private long failures; + /** Creates a new instance of Proxy */ public GenericMBeanServerProxy(Object remoteServer) { *************** *** 80,83 **** --- 84,88 ---- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader(); try { + roundTrips++; // Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); return method.invoke(this.remoteServer, args); *************** *** 98,101 **** --- 103,107 ---- } } catch (Exception e) { + failures++; //e.printStackTrace(); throw e; *************** *** 105,122 **** } - public static MBeanServer buildServerProxy(Object server) { ! Object proxy = null; try { ! proxy = Proxy.newProxyInstance( GenericMBeanServerProxy.class.getClassLoader(), new Class<?>[] { Class.forName("javax.management.MBeanServer")}, ! new GenericMBeanServerProxy(server)); } catch (ClassNotFoundException e) { throw new LoadException("Unable to find JMX Classes", e); } - - return (MBeanServer) proxy; } --- 111,134 ---- } ! public long getRoundTrips() { ! return roundTrips; ! } ! ! public long getFailures() { ! return failures; ! } ! ! public MBeanServer buildServerProxy() { try { ! Object proxy = Proxy.newProxyInstance( GenericMBeanServerProxy.class.getClassLoader(), new Class<?>[] { Class.forName("javax.management.MBeanServer")}, ! this); ! return (MBeanServer) proxy; } catch (ClassNotFoundException e) { throw new LoadException("Unable to find JMX Classes", e); } } --- NEW FILE: StatsProxy.java --- /* * Copyright 2002-2005 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.ems.impl.jmx.connection.support.providers.proxy; /** * @author Greg Hinkle (gh...@us...), Nov 22, 2005 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2005/12/12 14:12:59 $) */ public interface StatsProxy { long getRoundTrips(); long getFailures(); } |
From: Greg H. <gh...@us...> - 2005-12-12 14:13:18
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22177/modules/ems/src/ems/org/mc4j/ems/connection/support Modified Files: Tag: ems_module_separation ConnectionProvider.java Log Message: New statistics tracking for MBeanServer communications (roundtrips + failures) Support for Secured JBoss invoker prior to JndiLoginInitialContextFactory Index: ConnectionProvider.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/support/Attic/ConnectionProvider.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** ConnectionProvider.java 27 Oct 2005 07:03:06 -0000 1.1.2.2 --- ConnectionProvider.java 12 Dec 2005 14:12:59 -0000 1.1.2.3 *************** *** 43,45 **** --- 43,48 ---- void removeConnectionListener(ConnectionListener connectionListener); + long getRoundTrips(); + + long getFailures(); } |
From: Greg H. <gh...@us...> - 2005-12-12 14:13:18
|
Update of /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/bean/attribute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22177/modules/ems/src/ems/org/mc4j/ems/connection/bean/attribute Modified Files: Tag: ems_module_separation EmsAttribute.java Log Message: New statistics tracking for MBeanServer communications (roundtrips + failures) Support for Secured JBoss invoker prior to JndiLoginInitialContextFactory Index: EmsAttribute.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/modules/ems/src/ems/org/mc4j/ems/connection/bean/attribute/Attic/EmsAttribute.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** EmsAttribute.java 27 Oct 2005 07:03:05 -0000 1.1.2.2 --- EmsAttribute.java 12 Dec 2005 14:12:59 -0000 1.1.2.3 *************** *** 24,27 **** --- 24,33 ---- */ public interface EmsAttribute extends Comparable { + /** Default true */ + String CONTROL_ATTRIBUTE_HISTORY = "Attribute.history"; + /** Default CompleteValueHistory */ + String CONTROL_ATTRIBUTE_HISTORY_CLASS = "Attribute.history.class"; + /** Default 1 */ + String CONTROL_ATTRIBUTE_HISTORY_DEPTH = "Attribute.history.depth"; |