[Ejtools-cvs] applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/connector MX4J200IIOPC
Brought to you by:
letiemble
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/connector In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/main/org/ejtools/jmx/browser/model/connector Modified Files: AbstractConnectionService.java JBoss30EJBConnectionService.java JBoss30RMIConnectionService.java LocalConnectionService.java MX4J111IIOPConnectionService.java MX4J111JRMPConnectionService.java Pramati30ConnectionService.java TMX4J21ConnectionService.java WebLogic70ConnectionService.java Added Files: MX4J200IIOPConnectionService.java MX4J200JRMPConnectionService.java RemotingConnectionService.java Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI --- NEW FILE: MX4J200IIOPConnectionService.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.jmx.browser.model.connector; import java.util.Hashtable; import javax.management.MBeanServer; import javax.naming.Context; import mx4j.tools.connector.RemoteMBeanServer; import mx4j.tools.connector.rmi.iiop.IIOPConnector; import org.ejtools.jmx.MBeanServerProxy; import org.ejtools.jmx.browser.model.service.ConnectionMetaData; /** * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public class MX4J200IIOPConnectionService extends AbstractConnectionService { /** Description of the Field */ protected IIOPConnector connector = null; /** */ public void disconnect() { super.disconnect(); try { this.connector.close(); } catch (Exception e) { // Do nothing } this.setConnected(false); } /** * @exception Exception Description of the Exception */ protected void createMBeanServer() throws Exception { System.setProperty("jmx.serial.form", "1.2"); Hashtable props = new Hashtable(); props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); this.connector = new IIOPConnector(); this.connector.connect(this.profile.getProperty(ConnectionMetaData.CONTEXT), props); RemoteMBeanServer remoteServer = this.connector.getRemoteMBeanServer(); MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(remoteServer, RemoteMBeanServer.class); this.setMBeanServer(mbeanServer); } } --- NEW FILE: MX4J200JRMPConnectionService.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.jmx.browser.model.connector; import java.util.Hashtable; import javax.management.MBeanServer; import javax.naming.Context; import mx4j.tools.connector.RemoteMBeanServer; import mx4j.tools.connector.rmi.jrmp.JRMPConnector; import org.ejtools.jmx.MBeanServerProxy; import org.ejtools.jmx.browser.model.service.ConnectionMetaData; /** * @author Laurent Etiemble * @created 4 septembre 2002 */ public class MX4J200JRMPConnectionService extends AbstractConnectionService { /** Description of the Field */ protected JRMPConnector connector = null; /** */ public void disconnect() { super.disconnect(); try { this.connector.close(); } catch (Exception e) { // Do nothing } this.setConnected(false); } /** * @exception Exception Description of the Exception */ protected void createMBeanServer() throws Exception { System.setProperty("jmx.serial.form", "1.2"); Hashtable props = new Hashtable(); props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); this.connector = new JRMPConnector(); this.connector.connect(this.profile.getProperty(ConnectionMetaData.CONTEXT), props); RemoteMBeanServer remoteServer = this.connector.getRemoteMBeanServer(); MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(remoteServer, RemoteMBeanServer.class); this.setMBeanServer(mbeanServer); } } --- NEW FILE: RemotingConnectionService.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.jmx.browser.model.connector; import java.util.Hashtable; import javax.management.MBeanServer; import javax.management.MBeanServerConnection; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL; import javax.naming.Context; import org.ejtools.jmx.MBeanServerProxy; import org.ejtools.jmx.browser.model.service.ConnectionMetaData; /** * @author letiembl * @created 4 septembre 2002 * @version $Revision: 1.1 $ */ public class RemotingConnectionService extends AbstractConnectionService { /** Description of the Field */ protected JMXConnector connector = null; /** */ public void disconnect() { super.disconnect(); try { this.connector.close(); } catch (Exception e) { // Do nothing } this.setConnected(false); } /** * @exception Exception Description of the Exception */ protected void createMBeanServer() throws Exception { System.setProperty("jmx.serial.form", "1.2"); Hashtable props = new Hashtable(); props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); JMXServiceURL url = new JMXServiceURL(this.profile.getProperty(ConnectionMetaData.SERVICE)); this.connector = JMXConnectorFactory.connect(url, props); MBeanServerConnection connection = connector.getMBeanServerConnection(); MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(connection); this.setMBeanServer(mbeanServer); } } Index: AbstractConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/connector/AbstractConnectionService.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractConnectionService.java 24 Feb 2003 22:02:39 -0000 1.3 --- AbstractConnectionService.java 27 Nov 2003 01:13:07 -0000 1.4 *************** *** 29,32 **** --- 29,36 ---- + /**Constructor for the AbstractConnectionService object */ + protected AbstractConnectionService() { } + + /** * Connect to the MBean server with this profile Index: JBoss30EJBConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/connector/JBoss30EJBConnectionService.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JBoss30EJBConnectionService.java 24 Feb 2003 22:02:40 -0000 1.3 --- JBoss30EJBConnectionService.java 27 Nov 2003 01:13:07 -0000 1.4 *************** *** 7,10 **** --- 7,11 ---- package org.ejtools.jmx.browser.model.connector; + import java.lang.reflect.Method; import java.util.Hashtable; *************** *** 16,21 **** import org.ejtools.jmx.MBeanServerProxy; import org.ejtools.jmx.browser.model.service.ConnectionMetaData; - import org.jboss.jmx.adaptor.interfaces.Adaptor; - import org.jboss.jmx.adaptor.interfaces.AdaptorHome; --- 17,20 ---- *************** *** 31,35 **** { /** Instace of the RMI adaptor */ ! protected Adaptor adaptor = null; --- 30,34 ---- { /** Instace of the RMI adaptor */ ! protected Object adaptor = null; *************** *** 40,44 **** try { ! this.adaptor.remove(); } catch (Exception e) --- 39,45 ---- try { ! // Search for the stop method of the EJB Adaptor ! Method m = this.adaptor.getClass().getMethod("remove", new Class[0]); ! m.invoke(this.adaptor, new Object[0]); } catch (Exception e) *************** *** 70,75 **** Object ref = context.lookup(this.profile.getProperty(ConnectionMetaData.CONTEXT)); ! AdaptorHome home = (AdaptorHome) PortableRemoteObject.narrow(ref, AdaptorHome.class); ! this.adaptor = home.create(); MBeanServer server = MBeanServerProxy.createMBeanProxy(this.adaptor); --- 71,78 ---- Object ref = context.lookup(this.profile.getProperty(ConnectionMetaData.CONTEXT)); ! Class clazzAdaptorHome = Thread.currentThread().getContextClassLoader().loadClass("org.jboss.jmx.adaptor.interfaces.AdaptorHome"); ! Object home = PortableRemoteObject.narrow(ref, clazzAdaptorHome); ! Method createMethod = clazzAdaptorHome.getMethod("create", new Class[0]); ! this.adaptor = createMethod.invoke(home, new Object[0]); MBeanServer server = MBeanServerProxy.createMBeanProxy(this.adaptor); Index: JBoss30RMIConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/connector/JBoss30RMIConnectionService.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JBoss30RMIConnectionService.java 12 Feb 2003 21:22:43 -0000 1.2 --- JBoss30RMIConnectionService.java 27 Nov 2003 01:13:07 -0000 1.3 *************** *** 7,10 **** --- 7,12 ---- package org.ejtools.jmx.browser.model.connector; + import java.lang.reflect.Constructor; + import java.lang.reflect.Method; import java.util.Hashtable; *************** *** 15,20 **** import org.ejtools.jmx.MBeanServerProxy; import org.ejtools.jmx.browser.model.service.ConnectionMetaData; - import org.jboss.jmx.adaptor.rmi.RMIAdaptor; - import org.jboss.jmx.connector.rmi.RMIConnectorImpl; --- 17,20 ---- *************** *** 27,31 **** { /** Description of the Field */ ! protected RMIConnectorImpl connector = null; --- 27,37 ---- { /** Description of the Field */ ! protected Object connector = null; ! ! ! /**Constructor for the JBoss30RMIConnectionService object */ ! public JBoss30RMIConnectionService() ! { ! } *************** *** 36,40 **** try { ! this.connector.stop(); } catch (Exception e) --- 42,48 ---- try { ! // Search for the stop method of the RMIConnector ! Method m = this.connector.getClass().getMethod("stop", new Class[0]); ! m.invoke(this.connector, new Object[0]); } catch (Exception e) *************** *** 65,72 **** Object ref = context.lookup(this.profile.getProperty(ConnectionMetaData.CONTEXT)); ! RMIAdaptor adaptor = (RMIAdaptor) PortableRemoteObject.narrow(ref, RMIAdaptor.class); ! this.connector = new RMIConnectorImpl(adaptor); ! this.setMBeanServer(MBeanServerProxy.createMBeanProxy(connector)); } } --- 73,83 ---- Object ref = context.lookup(this.profile.getProperty(ConnectionMetaData.CONTEXT)); ! Class clazzAdaptor = Thread.currentThread().getContextClassLoader().loadClass("org.jboss.jmx.adaptor.rmi.RMIAdaptor"); ! Object adaptor = PortableRemoteObject.narrow(ref, clazzAdaptor); ! Class clazzConnector = Thread.currentThread().getContextClassLoader().loadClass("org.jboss.jmx.connector.rmi.RMIConnectorImpl"); ! Constructor constructor = clazzConnector.getConstructor(new Class[]{clazzAdaptor}); ! this.connector = constructor.newInstance(new Object[]{adaptor}); ! this.setMBeanServer(MBeanServerProxy.createMBeanProxy(this.connector)); } } Index: LocalConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/connector/LocalConnectionService.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LocalConnectionService.java 10 Feb 2003 20:49:01 -0000 1.1 --- LocalConnectionService.java 27 Nov 2003 01:13:07 -0000 1.2 *************** *** 1,44 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.connector; ! ! import java.util.ArrayList; ! ! import javax.management.MBeanServer; ! import javax.management.MBeanServerFactory; ! ! ! /** ! * Local connection to a MBean server. ! * The reference to the MBean server is get by a call to the MBeanServerFactory class. ! * If several servers are registered, the first is taken. ! * ! * @author letiemble ! * @created 4 septembre 2002 ! * @version $Revision$ ! */ ! public class LocalConnectionService extends AbstractConnectionService ! { ! /** ! * Description of the Method ! * ! * @exception Exception Description of the Exception ! */ ! public void createMBeanServer() ! throws Exception ! { ! MBeanServer server = null; ! ! ArrayList servers = MBeanServerFactory.findMBeanServer(null); ! if ((servers == null) || (servers.size() == 0)) ! { ! throw new Exception("No MBeanServer found !!!"); ! } ! server = (MBeanServer) servers.get(0); ! this.setMBeanServer(server); ! } ! } --- 1,44 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.connector; ! ! import java.util.ArrayList; ! ! import javax.management.MBeanServer; ! import javax.management.MBeanServerFactory; ! ! ! /** ! * Local connection to a MBean server. ! * The reference to the MBean server is get by a call to the MBeanServerFactory class. ! * If several servers are registered, the first is taken. ! * ! * @author letiemble ! * @created 4 septembre 2002 ! * @version $Revision$ ! */ ! public class LocalConnectionService extends AbstractConnectionService ! { ! /** ! * Description of the Method ! * ! * @exception Exception Description of the Exception ! */ ! public void createMBeanServer() ! throws Exception ! { ! MBeanServer server = null; ! ! ArrayList servers = MBeanServerFactory.findMBeanServer(null); ! if ((servers == null) || (servers.size() == 0)) ! { ! throw new Exception("No MBeanServer found !!!"); ! } ! server = (MBeanServer) servers.get(0); ! this.setMBeanServer(server); ! } ! } Index: MX4J111IIOPConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/connector/MX4J111IIOPConnectionService.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MX4J111IIOPConnectionService.java 12 Feb 2003 21:22:43 -0000 1.2 --- MX4J111IIOPConnectionService.java 27 Nov 2003 01:13:07 -0000 1.3 *************** *** 1,71 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.connector; ! ! import java.util.Hashtable; ! ! import javax.management.MBeanServer; ! import javax.naming.Context; ! ! import mx4j.connector.RemoteMBeanServer; ! import mx4j.connector.rmi.iiop.IIOPConnector; ! ! import org.ejtools.jmx.MBeanServerProxy; ! import org.ejtools.jmx.browser.model.service.ConnectionMetaData; ! ! ! /** ! * @author letiembl ! * @created 4 septembre 2002 ! * @version $Revision$ ! * @todo Make an common ancestor with JRMP ! */ ! public class MX4J111IIOPConnectionService extends AbstractConnectionService ! { ! /** Description of the Field */ ! protected IIOPConnector connector = null; ! ! ! /** */ ! public void disconnect() ! { ! super.disconnect(); ! try ! { ! this.connector.close(); ! } ! catch (Exception e) ! { ! // Do nothing ! } ! this.setConnected(false); ! } ! ! ! /** ! * @exception Exception Description of the Exception ! */ ! protected void createMBeanServer() ! throws Exception ! { ! System.setProperty("jmx.serial.form", "1.1"); ! ! Hashtable props = new Hashtable(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); ! props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); ! props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); ! props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); ! props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); ! ! this.connector = new IIOPConnector(); ! this.connector.connect(this.profile.getProperty(ConnectionMetaData.CONTEXT), props); ! ! RemoteMBeanServer remoteServer = connector.getRemoteMBeanServer(); ! MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(remoteServer, RemoteMBeanServer.class); ! this.setMBeanServer(mbeanServer); ! } ! } --- 1,69 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.connector; ! ! import java.util.Hashtable; ! ! import javax.management.MBeanServer; ! import javax.naming.Context; ! ! import mx4j.connector.RemoteMBeanServer; ! import mx4j.connector.rmi.iiop.IIOPConnector; ! ! import org.ejtools.jmx.MBeanServerProxy; ! import org.ejtools.jmx.browser.model.service.ConnectionMetaData; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class MX4J111IIOPConnectionService extends AbstractConnectionService ! { ! /** Description of the Field */ ! protected IIOPConnector connector = null; ! ! ! /** */ ! public void disconnect() ! { ! super.disconnect(); ! try ! { ! this.connector.close(); ! } ! catch (Exception e) ! { ! // Do nothing ! } ! this.setConnected(false); ! } ! ! ! /** ! * @exception Exception Description of the Exception ! */ ! protected void createMBeanServer() ! throws Exception ! { ! System.setProperty("jmx.serial.form", "1.1"); ! ! Hashtable props = new Hashtable(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); ! props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); ! props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); ! props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); ! props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); ! ! this.connector = new IIOPConnector(); ! this.connector.connect(this.profile.getProperty(ConnectionMetaData.CONTEXT), props); ! ! RemoteMBeanServer remoteServer = this.connector.getRemoteMBeanServer(); ! MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(remoteServer, RemoteMBeanServer.class); ! this.setMBeanServer(mbeanServer); ! } ! } Index: MX4J111JRMPConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/connector/MX4J111JRMPConnectionService.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MX4J111JRMPConnectionService.java 12 Feb 2003 21:22:43 -0000 1.2 --- MX4J111JRMPConnectionService.java 27 Nov 2003 01:13:07 -0000 1.3 *************** *** 1,71 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.connector; ! ! import java.util.Hashtable; ! ! import javax.management.MBeanServer; ! import javax.naming.Context; ! ! import mx4j.connector.RemoteMBeanServer; ! import mx4j.connector.rmi.jrmp.JRMPConnector; ! ! import org.ejtools.jmx.MBeanServerProxy; ! import org.ejtools.jmx.browser.model.service.ConnectionMetaData; ! ! ! /** ! * @author letiembl ! * @created 4 septembre 2002 ! * @version $Revision$ ! * @todo Make an common ancestor with IIOP ! */ ! public class MX4J111JRMPConnectionService extends AbstractConnectionService ! { ! /** Description of the Field */ ! protected JRMPConnector connector = null; ! ! ! /** */ ! public void disconnect() ! { ! super.disconnect(); ! try ! { ! this.connector.close(); ! } ! catch (Exception e) ! { ! // Do nothing ! } ! this.setConnected(false); ! } ! ! ! /** ! * @exception Exception Description of the Exception ! */ ! protected void createMBeanServer() ! throws Exception ! { ! System.setProperty("jmx.serial.form", "1.1"); ! ! Hashtable props = new Hashtable(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); ! props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); ! props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); ! props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); ! props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); ! ! this.connector = new JRMPConnector(); ! this.connector.connect(this.profile.getProperty(ConnectionMetaData.CONTEXT), props); ! ! RemoteMBeanServer remoteServer = connector.getRemoteMBeanServer(); ! MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(remoteServer, RemoteMBeanServer.class); ! this.setMBeanServer(mbeanServer); ! } ! } --- 1,69 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.connector; ! ! import java.util.Hashtable; ! ! import javax.management.MBeanServer; ! import javax.naming.Context; ! ! import mx4j.connector.RemoteMBeanServer; ! import mx4j.connector.rmi.jrmp.JRMPConnector; ! ! import org.ejtools.jmx.MBeanServerProxy; ! import org.ejtools.jmx.browser.model.service.ConnectionMetaData; ! ! ! /** ! * @author Laurent Etiemble ! * @created 4 septembre 2002 ! */ ! public class MX4J111JRMPConnectionService extends AbstractConnectionService ! { ! /** Description of the Field */ ! protected JRMPConnector connector = null; ! ! ! /** */ ! public void disconnect() ! { ! super.disconnect(); ! try ! { ! this.connector.close(); ! } ! catch (Exception e) ! { ! // Do nothing ! } ! this.setConnected(false); ! } ! ! ! /** ! * @exception Exception Description of the Exception ! */ ! protected void createMBeanServer() ! throws Exception ! { ! System.setProperty("jmx.serial.form", "1.1"); ! ! Hashtable props = new Hashtable(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); ! props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); ! props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); ! props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); ! props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); ! ! this.connector = new JRMPConnector(); ! this.connector.connect(this.profile.getProperty(ConnectionMetaData.CONTEXT), props); ! ! RemoteMBeanServer remoteServer = this.connector.getRemoteMBeanServer(); ! MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(remoteServer, RemoteMBeanServer.class); ! this.setMBeanServer(mbeanServer); ! } ! } Index: Pramati30ConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/connector/Pramati30ConnectionService.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Pramati30ConnectionService.java 24 Feb 2003 22:02:40 -0000 1.2 --- Pramati30ConnectionService.java 27 Nov 2003 01:13:07 -0000 1.3 *************** *** 1,48 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.connector; ! ! import java.util.Hashtable; ! ! import javax.naming.Context; ! ! import org.ejtools.jmx.browser.model.service.ConnectionMetaData; ! ! ! /** ! * As described <a href="http://www.pramati.com/docstore/1230006/help/mbeanbrowser/working.htm">here</a> ! * ! * @author letiembl ! * @created 4 septembre 2002 ! * @version $Revision$ ! */ ! public class Pramati30ConnectionService extends AbstractConnectionService ! { ! /** ! * @exception Exception Description of the Exception ! */ ! protected void createMBeanServer() ! throws Exception ! { ! System.setProperty("jmx.serial.form", "1.0"); ! ! Hashtable props = new Hashtable(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); ! props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); ! props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); ! props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); ! props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); ! ! // Stand by ! // ! // InitialContext context = new InitialContext(props); ! // ClientConnector connector = (ClientConnector) context.lookup(this.profile.getProperty(ConnectionMetaData.CONTEXT)); ! // ! // MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(connector); ! // this.setMBeanServer(mbeanServer); ! } ! } --- 1,48 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.connector; ! ! import java.util.Hashtable; ! ! import javax.naming.Context; ! ! import org.ejtools.jmx.browser.model.service.ConnectionMetaData; ! ! ! /** ! * As described <a href="http://www.pramati.com/docstore/1230006/help/mbeanbrowser/working.htm">here</a> ! * ! * @author letiembl ! * @created 4 septembre 2002 ! * @version $Revision$ ! */ ! public class Pramati30ConnectionService extends AbstractConnectionService ! { ! /** ! * @exception Exception Description of the Exception ! */ ! protected void createMBeanServer() ! throws Exception ! { ! System.setProperty("jmx.serial.form", "1.0"); ! ! Hashtable props = new Hashtable(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); ! props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); ! props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); ! props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); ! props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); ! ! // Stand by ! // ! // InitialContext context = new InitialContext(props); ! // ClientConnector connector = (ClientConnector) context.lookup(this.profile.getProperty(ConnectionMetaData.CONTEXT)); ! // ! // MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(connector); ! // this.setMBeanServer(mbeanServer); ! } ! } Index: TMX4J21ConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/connector/TMX4J21ConnectionService.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TMX4J21ConnectionService.java 10 Feb 2003 20:49:01 -0000 1.1 --- TMX4J21ConnectionService.java 27 Nov 2003 01:13:07 -0000 1.2 *************** *** 1,46 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.connector; ! ! import java.util.Hashtable; ! ! import javax.naming.Context; ! ! import org.ejtools.jmx.browser.model.service.ConnectionMetaData; ! ! ! /** ! * @author letiembl ! * @created 4 septembre 2002 ! * @version $Revision$ ! */ ! public class TMX4J21ConnectionService extends AbstractConnectionService ! { ! /** ! * @exception Exception Description of the Exception ! */ ! protected void createMBeanServer() ! throws Exception ! { ! System.setProperty("jmx.serial.form", "1.0"); ! ! Hashtable props = new Hashtable(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); ! props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); ! props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); ! props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); ! props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); ! ! // Stand by ! // ! // InitialContext context = new InitialContext(props); ! // MBeanServerConnection connector = (MBeanServerConnection) context.lookup(this.profile.getProperty(ConnectionMetaData.CONTEXT)); ! // ! // MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(connector); ! // this.setMBeanServer(mbeanServer); ! } ! } --- 1,46 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.connector; ! ! import java.util.Hashtable; ! ! import javax.naming.Context; ! ! import org.ejtools.jmx.browser.model.service.ConnectionMetaData; ! ! ! /** ! * @author letiembl ! * @created 4 septembre 2002 ! * @version $Revision$ ! */ ! public class TMX4J21ConnectionService extends AbstractConnectionService ! { ! /** ! * @exception Exception Description of the Exception ! */ ! protected void createMBeanServer() ! throws Exception ! { ! System.setProperty("jmx.serial.form", "1.0"); ! ! Hashtable props = new Hashtable(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); ! props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); ! props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); ! props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); ! props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); ! ! // Stand by ! // ! // InitialContext context = new InitialContext(props); ! // MBeanServerConnection connector = (MBeanServerConnection) context.lookup(this.profile.getProperty(ConnectionMetaData.CONTEXT)); ! // ! // MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(connector); ! // this.setMBeanServer(mbeanServer); ! } ! } Index: WebLogic70ConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/connector/WebLogic70ConnectionService.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WebLogic70ConnectionService.java 24 Feb 2003 22:02:40 -0000 1.3 --- WebLogic70ConnectionService.java 27 Nov 2003 01:13:07 -0000 1.4 *************** *** 1,52 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.connector; ! ! import java.lang.reflect.Method; ! import java.util.Hashtable; ! ! import javax.management.MBeanServer; ! import javax.naming.Context; ! import javax.naming.InitialContext; ! ! import org.ejtools.jmx.MBeanServerProxy; ! import org.ejtools.jmx.browser.model.service.ConnectionMetaData; ! ! ! /** ! * As described <a href="http://edocs.bea.com/wls/docs70/jmx/">here</a> ! * ! * @author letiembl ! * @created 4 septembre 2002 ! * @version $Revision$ ! */ ! public class WebLogic70ConnectionService extends AbstractConnectionService ! { ! /** ! * @exception Exception Description of the Exception ! */ ! protected void createMBeanServer() ! throws Exception ! { ! System.setProperty("jmx.serial.form", "1.0"); ! ! Hashtable props = new Hashtable(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); ! props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); ! props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); ! props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); ! props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); ! ! InitialContext context = new InitialContext(props); ! Object mbeanHome = context.lookup(this.profile.getProperty(ConnectionMetaData.CONTEXT)); ! Method m = mbeanHome.getClass().getMethod("getMBeanServer", new Class[]{}); ! Object remoteServer = m.invoke(mbeanHome, new Object[0]); ! ! MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(remoteServer); ! this.setMBeanServer(mbeanServer); ! } ! } --- 1,52 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.connector; ! ! import java.lang.reflect.Method; ! import java.util.Hashtable; ! ! import javax.management.MBeanServer; ! import javax.naming.Context; ! import javax.naming.InitialContext; ! ! import org.ejtools.jmx.MBeanServerProxy; ! import org.ejtools.jmx.browser.model.service.ConnectionMetaData; ! ! ! /** ! * As described <a href="http://edocs.bea.com/wls/docs70/jmx/">here</a> ! * ! * @author letiembl ! * @created 4 septembre 2002 ! * @version $Revision$ ! */ ! public class WebLogic70ConnectionService extends AbstractConnectionService ! { ! /** ! * @exception Exception Description of the Exception ! */ ! protected void createMBeanServer() ! throws Exception ! { ! System.setProperty("jmx.serial.form", "1.0"); ! ! Hashtable props = new Hashtable(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); ! props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); ! props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); ! props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); ! props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); ! ! InitialContext context = new InitialContext(props); ! Object mbeanHome = context.lookup(this.profile.getProperty(ConnectionMetaData.CONTEXT)); ! Method m = mbeanHome.getClass().getMethod("getMBeanServer", new Class[]{}); ! Object remoteServer = m.invoke(mbeanHome, new Object[0]); ! ! MBeanServer mbeanServer = MBeanServerProxy.createMBeanProxy(remoteServer); ! this.setMBeanServer(mbeanServer); ! } ! } |