You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by am...@apache.org on 2003/05/02 21:38:22 UTC

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 MapperListener.java

amyroh      2003/05/02 12:38:22

  Modified:    catalina/src/share/org/apache/coyote/tomcat5
                        MapperListener.java
  Log:
  Add for Mapper to handle WebModules and Servlets in the same engineName(tomcat domain).
  
  Revision  Changes    Path
  1.6       +18 -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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MapperListener.java	28 Apr 2003 05:20:12 -0000	1.5
  +++ MapperListener.java	2 May 2003 19:38:22 -0000	1.6
  @@ -203,10 +203,23 @@
           if (notification instanceof MBeanServerNotification) {
               ObjectName objectName = 
                   ((MBeanServerNotification) notification).getMBeanName();
  -            if( ! "*".equals( domain ) &&
  -                    ! domain.equals( objectName.getDomain() )) {
  +            String j2eeType = objectName.getKeyProperty("j2eeType");
  +            String engineName = null;
  +            if (j2eeType != null) {
  +                if ((j2eeType.equals("WebModule")) || 
  +                    (j2eeType.equals("Servlet"))) {
  +                        try {
  +                            engineName = (String)
  +                                mBeanServer.getAttribute(objectName, "engineName");
  +                        } catch (Exception e) {
  +                            e.printStackTrace();  
  +                        }
  +                }
  +            }
  +            if ( ! "*".equals( domain ) &&
  +                    ! domain.equals( objectName.getDomain() ) &&
  +                    ! domain.equals( engineName ) ) {
                   // A different domain - not ours
  -                String j2eeType = objectName.getKeyProperty("j2eeType");
                   if( j2eeType!=null )
                       log.debug("MBean in different domain " + objectName);
                   return;
  @@ -222,8 +235,7 @@
                           e.printStackTrace();  
                       }
                   }
  -                
  -                String j2eeType = objectName.getKeyProperty("j2eeType");
  +    
                   if (j2eeType != null) {
                       if (j2eeType.equals("WebModule")) {
                           try {
  @@ -249,8 +261,7 @@
                           e.printStackTrace();  
                       }
                   }
  -                               
  -                String j2eeType = objectName.getKeyProperty("j2eeType");
  + 
                   if (j2eeType != null) {
                       if (j2eeType.equals("WebModule")) {
                           try {
  
  
  

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