tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hgo...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans ServerLifecycleListener.java MBeanUtils.java
Date Thu, 25 Sep 2003 12:49:01 GMT
hgomez      2003/09/25 05:49:01

  Modified:    catalina/src/share/org/apache/catalina/mbeans
                        ServerLifecycleListener.java MBeanUtils.java
  Log:
  Make RMI/IIOP port configurable
  
  Revision  Changes    Path
  1.11      +39 -13    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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ServerLifecycleListener.java	19 Mar 2003 07:30:07 -0000	1.10
  +++ ServerLifecycleListener.java	25 Sep 2003 12:49:01 -0000	1.11
  @@ -152,15 +152,41 @@
       /**
        * MX4J adaptor name.
        */
  -    protected String adaptor = null;
  +	protected String adaptor = null;
   
  -    public String getAdaptor() {
  -        return (this.adaptor);
  -    }
  -
  -    public void setAdaptor(String adaptor) {
  -        this.adaptor = adaptor;
  -    }
  +	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
  @@ -212,7 +238,7 @@
   
                   if (adaptor != null) {
                       try {
  -                        MBeanUtils.createRMIAdaptor(adaptor);
  +                        MBeanUtils.createRMIAdaptor(adaptor, adaptorHost, adaptorPort);
                       } catch (Exception e) {
                           log.error("createAdaptor: Exception", e);
                       }
  
  
  
  1.22      +19 -7     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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- MBeanUtils.java	2 Sep 2003 21:22:02 -0000	1.21
  +++ MBeanUtils.java	25 Sep 2003 12:49:01 -0000	1.22
  @@ -1711,7 +1711,7 @@
       /**
        * Create a RMI adapter [MX4J specific].
        */
  -    public static void createRMIAdaptor(String adaptorType)
  +    public static void createRMIAdaptor(String adaptorType, String host, int port)
           throws Exception {
   
           String namingProviderObjectName = null;
  @@ -1724,6 +1724,9 @@
           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";
  @@ -1732,7 +1735,12 @@
               adaptorMbeanClassName = "mx4j.adaptor.rmi.jrmp.JRMPAdaptorMBean";
               contextFactory = 
                   "com.sun.jndi.rmi.registry.RegistryContextFactory";
  -            providerUrl = "rmi://localhost:1099";
  +                
  +			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";
  @@ -1741,7 +1749,11 @@
               adaptorClassName = "mx4j.adaptor.rmi.iiop.IIOPAdaptor";
               adaptorMbeanClassName = "mx4j.adaptor.rmi.iiop.IIOPAdaptorMBean";
               contextFactory = "com.sun.jndi.cosnaming.CNCtxFactory";
  -            providerUrl = "iiop://localhost:900";
  +
  +			if (port == -1)
  +				port = 900;
  +				            	    
  +            providerUrl = "iiop://" + host + ":" + Integer.toString(port);
           } else {
               throw new IllegalArgumentException("Unknown adaptor type");
           }
  
  
  

Mime
View raw message