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/coyote/tomcat5 CoyoteConnector.java MapperListener.java
Date Sun, 20 Apr 2003 10:13:12 GMT
remm        2003/04/20 03:13:11

  Modified:    catalina/src/share/org/apache/coyote/tomcat5
                        CoyoteConnector.java MapperListener.java
  Log:
  - Fix default host init in the mapper.
  
  Revision  Changes    Path
  1.2       +2 -1      jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java
  
  Index: CoyoteConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CoyoteConnector.java	19 Apr 2003 18:49:10 -0000	1.1
  +++ CoyoteConnector.java	20 Apr 2003 10:13:11 -0000	1.2
  @@ -1240,6 +1240,7 @@
   
           if( this.domain != null ) {
               mapperListener.setDomain( domain );
  +            mapperListener.setEngine( service.getContainer().getName() );
               mapperListener.init();
               try {
                   Registry.getRegistry().registerComponent
  
  
  
  1.2       +16 -7     jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java
  
  Index: MapperListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MapperListener.java	19 Apr 2003 18:49:10 -0000	1.1
  +++ MapperListener.java	20 Apr 2003 10:13:11 -0000	1.2
  @@ -110,6 +110,7 @@
   
       // It should be null - and fail if not set
       private String domain="*";
  +    private String engine="*";
   
       // ----------------------------------------------------------- Constructors
   
  @@ -132,6 +133,14 @@
           this.domain = domain;
       }
   
  +    public String getEngine() {
  +        return engine;
  +    }
  +
  +    public void setEngine(String engine) {
  +        this.engine = engine;
  +    }
  +
       /**
        * Initialize associated mapper.
        */
  @@ -141,8 +150,7 @@
   
               mBeanServer = Registry.getServer();
   
  -            // FIXME
  -            registerHosts(null);
  +            registerEngine();
   
               // Query hosts
               String onStr = domain + ":type=Host,*";
  @@ -260,13 +268,14 @@
   
       // ------------------------------------------------------ Protected Methods
   
  -    private void registerHosts(ObjectName objectName)
  +    private void registerEngine()
           throws Exception
       {
  -        ObjectName engineName=new ObjectName(domain + ":type=Engine");
  -        if( ! mBeanServer.isRegistered(engineName)) return;
  -        //if (container instanceof Engine) {
  -        String defaultHost = (String)mBeanServer.getAttribute(engineName, "defaultHost");
  +        ObjectName engineName = new ObjectName
  +            (domain + ":type=Engine,name=" + engine);
  +        if ( ! mBeanServer.isRegistered(engineName)) return;
  +        String defaultHost = 
  +            (String) mBeanServer.getAttribute(engineName, "defaultHost");
           // This should probablt be called later 
           if( defaultHost != null ) {
               mapper.setDefaultHostName(defaultHost);
  
  
  

---------------------------------------------------------------------
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