tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans ServerLifecycleListener.java MBeanUtils.java
Date Wed, 06 Oct 2004 16:10:57 GMT
remm        2004/10/06 09:10:57

  Modified:    catalina/src/share/org/apache/catalina/mbeans
                        ServerLifecycleListener.java MBeanUtils.java
  Log:
  - Remove MX4J code.
  
  Revision  Changes    Path
  1.20      +1 -51     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans/ServerLifecycleListener.java
  
  Index: ServerLifecycleListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans/ServerLifecycleListener.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- ServerLifecycleListener.java	16 Aug 2004 09:31:08 -0000	1.19
  +++ ServerLifecycleListener.java	6 Oct 2004 16:10:57 -0000	1.20
  @@ -84,46 +84,6 @@
       }
   
   
  -    /**
  -     * MX4J adaptor name.
  -     */
  -    protected String adaptor = null;
  -
  -    public String getAdaptor() {
  -        return (this.adaptor);
  -    }
  -
  -    public void setAdaptor(String adaptor) {
  -        this.adaptor = adaptor;
  -    }
  -
  -    /**
  -     * MX4J jrmp/iiop listen host
  -     */ 
  -    protected String adaptorHost = null;
  -
  -    public String getAdaptorHost() {
  -        return (this.adaptorHost);
  -    }
  -
  -    public void setAdaptorHost(String adaptorHost) {
  -        this.adaptorHost = adaptorHost;
  -    }
  -
  -    /**
  -     * MX4J jrmp/iiop listen port
  -     */ 
  -    protected int adaptorPort = -1;
  -
  -    public int getAdaptorPort() {
  -        return (this.adaptorPort);
  -    }
  -
  -    public void setAdaptorPort(int adaptorPort) {
  -        this.adaptorPort = adaptorPort;
  -    }
  -
  -
       // ---------------------------------------------- ContainerListener Methods
   
   
  @@ -165,17 +125,7 @@
           if (Lifecycle.START_EVENT.equals(event.getType())) {
   
               if (lifecycle instanceof Server) {
  -
                   createMBeans();
  -
  -                if (adaptor != null) {
  -                    try {
  -                        MBeanUtils.createRMIAdaptor(adaptor, adaptorHost, adaptorPort);
  -                    } catch (Exception e) {
  -                        log.error("createAdaptor: Exception", e);
  -                    }
  -                }
  -
               }
   
               // We are embedded.
  
  
  
  1.33      +2 -117    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java
  
  Index: MBeanUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- MBeanUtils.java	29 Aug 2004 16:46:11 -0000	1.32
  +++ MBeanUtils.java	6 Oct 2004 16:10:57 -0000	1.33
  @@ -17,10 +17,8 @@
   package org.apache.catalina.mbeans;
   
   
  -import java.lang.reflect.Method;
   import java.util.Hashtable;
   
  -import javax.management.Attribute;
   import javax.management.MBeanException;
   import javax.management.MBeanServer;
   import javax.management.MalformedObjectNameException;
  @@ -1518,15 +1516,13 @@
               registry.loadDescriptors("org.apache.catalina", cl);
               registry.loadDescriptors("org.apache.catalina.deploy", cl);
               registry.loadDescriptors("org.apache.catalina.loader", cl);
  -            registry.loadDescriptors("org.apache.catalina.logger", cl);
               registry.loadDescriptors("org.apache.catalina.realm", cl);
               registry.loadDescriptors("org.apache.catalina.session", cl);
               registry.loadDescriptors("org.apache.catalina.startup", cl);
               registry.loadDescriptors("org.apache.catalina.users", cl);
               registry.loadDescriptors("org.apache.catalina.cluster", cl);
  -            
  +            registry.loadDescriptors("org.apache.catalina.connector", cl);
               registry.loadDescriptors("org.apache.catalina.valves",  cl);
  -            registry.loadDescriptors("org.apache.coyote.tomcat5", cl);
           }
           return (registry);
   
  @@ -1542,8 +1538,6 @@
   
           if (mserver == null) {
               try {
  -                //Trace.parseTraceProperties();
  -                //mserver = MBeanServerFactory.createMBeanServer();
                   mserver = Registry.getRegistry(null, null).getMBeanServer();
               } catch (Throwable t) {
                   t.printStackTrace(System.out);
  @@ -1551,115 +1545,6 @@
               }
           }
           return (mserver);
  -
  -    }
  -
  -
  -    /**
  -     * Create a RMI adapter [MX4J specific].
  -     */
  -    public static void createRMIAdaptor(String adaptorType, String host, int port)
  -        throws Exception {
  -
  -        String namingProviderObjectName = null;
  -        String namingProviderClassName = null;
  -        String adaptorObjectName = null;
  -        String adaptorClassName = null;
  -        String adaptorMbeanClassName = null;
  -        boolean delay = false;
  -        String jndiName = "jrmp";
  -        String contextFactory = null;
  -        String providerUrl = null;
  -
  -		if ((host == null) || (host.trim().length() == 0))
  -			host = "localhost";
  -
  -        if (adaptorType.equals("jrmp")) {
  -            namingProviderObjectName = "Naming:type=rmiregistry";
  -            namingProviderClassName = "mx4j.tools.naming.NamingService";
  -            adaptorObjectName = "Adaptor:protocol=JRMP";
  -            adaptorClassName = "mx4j.adaptor.rmi.jrmp.JRMPAdaptor";
  -            adaptorMbeanClassName = "mx4j.adaptor.rmi.jrmp.JRMPAdaptorMBean";
  -            contextFactory = 
  -                "com.sun.jndi.rmi.registry.RegistryContextFactory";
  -                
  -			if (port == -1)
  -				port = 1099;
  -				            	    
  -            providerUrl = "rmi://" + host + ":" + Integer.toString(port);
  -            
  -        } else if (adaptorType.equals("iiop")) {
  -            namingProviderObjectName = "Naming:type=tnameserv";
  -            namingProviderClassName = "mx4j.tools.naming.CosNamingService";
  -            delay = true;
  -            adaptorObjectName = "Adaptor:protocol=IIOP";
  -            adaptorClassName = "mx4j.adaptor.rmi.iiop.IIOPAdaptor";
  -            adaptorMbeanClassName = "mx4j.adaptor.rmi.iiop.IIOPAdaptorMBean";
  -            contextFactory = "com.sun.jndi.cosnaming.CNCtxFactory";
  -
  -			if (port == -1)
  -				port = 900;
  -				            	    
  -            providerUrl = "iiop://" + host + ":" + Integer.toString(port);
  -        } else {
  -            throw new IllegalArgumentException("Unknown adaptor type");
  -        }
  -
  -        // Create and start the naming service
  -        ObjectName naming = new ObjectName(namingProviderObjectName);
  -        mserver.createMBean(namingProviderClassName, naming, null);
  -        if (delay) {
  -            mserver.setAttribute(naming, new Attribute
  -                                 ("Delay", new Integer(5000)));
  -        }
  -        mserver.invoke(naming, "start", null, null);
  -
  -        // Create the JRMP adaptor
  -        ObjectName adaptor = new ObjectName(adaptorObjectName);
  -        mserver.createMBean(adaptorClassName, adaptor, null);
  -
  -        Class proxyClass = Class.forName("mx4j.util.StandardMBeanProxy");
  -
  -        Object args[] = null;
  -        Class types[] = null;
  -        Method method = null;
  -
  -        types = new Class[3];
  -        types[0] = Class.class;
  -        types[1] = MBeanServer.class;
  -        types[2] = ObjectName.class;
  -        args = new Object[3];
  -        args[0] = Class.forName(adaptorMbeanClassName);
  -        args[1] = mserver;
  -        args[2] = adaptor;
  -        method = proxyClass.getMethod("create", types);
  -        Object bean = method.invoke(null, args);
  -
  -        Class beanClass = bean.getClass();
  -
  -        args = new Object[1];
  -        args[0] = jndiName;
  -        types = new Class[1];
  -        types[0] = String.class;
  -        method = beanClass.getMethod("setJNDIName", types);
  -        method.invoke(bean, args);
  -
  -        args = new Object[2];
  -        types = new Class[2];
  -        types[0] = Object.class;
  -        types[1] = Object.class;
  -        method = beanClass.getMethod("putJNDIProperty", types);
  -
  -        args[0] = javax.naming.Context.INITIAL_CONTEXT_FACTORY;
  -        args[1] = contextFactory;
  -        method.invoke(bean, args);
  -
  -        args[0] = javax.naming.Context.PROVIDER_URL;
  -        args[1] = providerUrl;
  -        method.invoke(bean, args);
  -
  -        method = beanClass.getMethod("start", null);
  -        method.invoke(bean, null);
   
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message