[Mc4j-cvs] mc4j/src/org/mc4j/console/connection ConnectionNode.java,1.23,1.24 JBossConnectionNode.ja
Brought to you by:
ghinkl
From: Greg H. <gh...@us...> - 2004-04-02 03:37:30
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/connection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16054/src/org/mc4j/console/connection Modified Files: ConnectionNode.java JBossConnectionNode.java JDMKConnectionNode.java JSR160ConnectionNode.java Mx4jConnectionNode.java WeblogicConnectionNode.java WebsphereConnectionNode.java Log Message: Centralizing connection specifics in the connection node. Index: WebsphereConnectionNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/connection/WebsphereConnectionNode.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WebsphereConnectionNode.java 1 Apr 2004 03:42:05 -0000 1.4 --- WebsphereConnectionNode.java 2 Apr 2004 03:25:26 -0000 1.5 *************** *** 153,155 **** --- 153,168 ---- } + + public String getDefaultServerUrl() { + return "http://localhost:8880"; + } + + public String getDefaultPrinciple() { + return "admin"; + } + + public String getDefaultCredentials() { + return ""; + } + } Index: WeblogicConnectionNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/connection/WeblogicConnectionNode.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** WeblogicConnectionNode.java 17 Feb 2004 02:03:36 -0000 1.10 --- WeblogicConnectionNode.java 2 Apr 2004 03:25:26 -0000 1.11 *************** *** 109,111 **** --- 109,131 ---- } + + public String getDefaultServerUrl() { + return "t3://localhost:7001"; + } + + public String getDefaultJndiName() { + return "weblogic.management.adminhome"; + } + + public String getDefaultInitialContext() { + return "weblogic.jndi.WLInitialContextFactory"; + } + + public String getDefaultPrinciple() { + return "admin"; + } + + public String getDefaultCredentials() { + return ""; + } } Index: JDMKConnectionNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/connection/JDMKConnectionNode.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JDMKConnectionNode.java 17 Feb 2004 02:03:36 -0000 1.7 --- JDMKConnectionNode.java 2 Apr 2004 03:25:26 -0000 1.8 *************** *** 93,95 **** --- 93,104 ---- } + + public String getDefaultServerUrl() { + return "localhost:8086"; + } + + public String getDefaultJndiName() { + return "name=RmiConnectorServer"; + } + } Index: JBossConnectionNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/connection/JBossConnectionNode.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** JBossConnectionNode.java 17 Feb 2004 02:03:35 -0000 1.11 --- JBossConnectionNode.java 2 Apr 2004 03:25:25 -0000 1.12 *************** *** 33,36 **** --- 33,39 ---- import org.jboss.jmx.adaptor.rmi.RMIAdaptor; + import org.jboss.jmx.connector.notification.RMINotificationListener; + import org.jboss.jmx.connector.notification.RMINotificationListenerMBean; + import org.jboss.jmx.connector.rmi.RMIConnectorImpl; /** *************** *** 70,75 **** RMIAdaptor rmiAdaptor = (RMIAdaptor) context.lookup(connectionSettings.getJndiName()); ! this.mbeanServer = GenericMBeanServerProxy.buildServerProxy(rmiAdaptor); super.connect(); --- 73,85 ---- RMIAdaptor rmiAdaptor = (RMIAdaptor) context.lookup(connectionSettings.getJndiName()); ! // GH: Works around a real strange "LinkageError: Duplicate class found" ! // by loading these classes in the main connection classloader ! Class foo = RMINotificationListener.class; ! foo = RMINotificationListenerMBean.class; + // TODO GH!: I think this fixes notifications, but breaks compatibility with at least 3.0.8 + RMIConnectorImpl connector = new RMIConnectorImpl(rmiAdaptor); + + this.mbeanServer = GenericMBeanServerProxy.buildServerProxy(connector); super.connect(); *************** *** 88,92 **** } ! public void disconnect() throws Exception { super.disconnect(); --- 98,118 ---- } ! /* GH: an aborted attempt at manually changing the polling type ! public class RMIAdaptorExtension extends RMIConnectorImpl { ! public RMIAdaptorExtension(RMIAdaptor rmiAdaptor) { ! super(rmiAdaptor); ! ! try { ! Field field = RMIConnectorImpl.class.getField("mEventType"); ! if (!Modifier.isPrivate(field.getModifiers())) { ! field.set(this, new Integer(RMIConnectorImpl.NOTIFICATION_TYPE_POLLING)); ! } ! } catch (NoSuchFieldException nsfe) { ! } catch (IllegalAccessException iae) { ! } ! } ! } ! */ ! public void disconnect() throws Exception { super.disconnect(); *************** *** 99,101 **** --- 125,138 ---- } + public String getDefaultServerUrl() { + return "jnp://localhost:1099"; + } + + public String getDefaultJndiName() { + return "jmx/rmi/RMIAdaptor"; + } + + public String getDefaultInitialContext() { + return "org.jnp.interfaces.NamingContextFactory"; + } } Index: Mx4jConnectionNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/connection/Mx4jConnectionNode.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Mx4jConnectionNode.java 17 Feb 2004 02:03:36 -0000 1.9 --- Mx4jConnectionNode.java 2 Apr 2004 03:25:26 -0000 1.10 *************** *** 102,104 **** --- 102,117 ---- } + + public String getDefaultServerUrl() { + return "rmi://localhost:1099"; + } + + public String getDefaultJndiName() { + return "jrmp"; + } + + public String getDefaultInitialContext() { + return "com.sun.jndi.rmi.registry.RegistryContextFactory"; + } + } Index: ConnectionNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/connection/ConnectionNode.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ConnectionNode.java 7 Feb 2004 16:10:41 -0000 1.23 --- ConnectionNode.java 2 Apr 2004 03:25:25 -0000 1.24 *************** *** 479,482 **** --- 479,502 ---- + public String getDefaultServerUrl() { + return null; + } + + public String getDefaultJndiName() { + return null; + } + + public String getDefaultInitialContext() { + return null; + } + + public String getDefaultPrinciple() { + return null; + } + + public String getDefaultCredentials() { + return null; + } + } Index: JSR160ConnectionNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/connection/JSR160ConnectionNode.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JSR160ConnectionNode.java 1 Mar 2004 18:23:44 -0000 1.5 --- JSR160ConnectionNode.java 2 Apr 2004 03:25:26 -0000 1.6 *************** *** 94,97 **** --- 94,111 ---- return this.mbeanServer; } + + + public String getDefaultServerUrl() { + return "service:jmx:rmi:///jndi/rmi://localhost:9999/server"; + } + + public String getDefaultPrinciple() { + return ""; + } + + public String getDefaultCredentials() { + return ""; + } + } |