Quick Search:

View detailed chart Line History

line history graph

View Mode

Logical Physical

Show Arbitrary Diff

From to

Supports revisions and tags.

Watches and RSS

History

MAIN 1.8 1.7 1.6 1.5 1.1 SJSAS91_FCS_BRANCH 1.8.6.3 1.8.6.2 1.8.6.1 SGES21_FCS_BRANCH 1.8.6.2.2.1 SAILFIN_BRANCH 1.7.2.1 SJSAS91_BETA2_BRANCH 1.6.2.1 GF_V3_PREWORK_BRANCH 1.5.8.1 PWC12Dev_Branch 1.5.6.1 SJSAS91_BETA_BRANCH 1.5.10.1 SJSAS_9_0 1.1.1.1

latest revision download Branch MAIN

1.8 annotated / raw | Diffs: previous, other | Lines: 1567 ( +34, -21 )

Created: 2007-05-05 00:33:15 -0500 (20 months ago) | Author: tcfujii | Changeset: MAIN:tcfujii:20070505053314

CDDL+GPL header updates.

Branch point for: GF_V2_AIX_POC SJSAS91_BETA3_BRANCH SJSAS91_FCS_BRANCH SJSAS91_UR1_BRANCH SJSAS91_UR1_DBINT_BRANCH SJSAS91_UR2_BRANCH SJSAS91_UR2_RI_BRANCH

Tags: SJSAS-9_1-TRUNK-POSTMERGE-V3-12_OCT_2007 SJSAS91_FCS_BRANCH$BP SJSAS-9_1-B54-RC-03_July_2007 SAILFIN-1_0-B06-05_Nov_2007 SJSAS91_UR2_RI_BRANCH$BP SAILFIN-1_0-B12-11_Dec_2007 SJSAS-9_1_01-B09D-DBINT-19_Mar_2008 SJSAS-9_1_1-B10-27_Nov_2007 SJSAS-9_1_01-B06-24_Oct_2007 SJSAS-9_1_02-B03-05_Apr_2008 SJSAS-9_1-B52-RC-20_June_2007 SJSAS-9_1_1-B11-04_Dec_2007 SJSAS-9_1_01-B09D-DBINT-06_Mar_2008 SJSAS91_UR2_BRANCH$BP ... more hide

1.7 annotated / raw | Diffs: previous, other | Lines: 1554 ( +5, -7 )

Created: 2007-03-30 18:54:32 -0500 (21 months ago) | Author: jluehe | Changeset: MAIN:jluehe:20070330235432

Fix for https://glassfish.dev.java.net/issues/show_bug.cgi?id=2757
("Regression caused by fix for GlassFish Issue 2711")

Reviewed by: jfarcand

Tests run: QL

Branch point for: SAILFIN_BRANCH

Tags: SJSAS-9_1-B43-BETA3-18_Apr_2007 SJSAS-9_1-B45-BETA3-03_May_2007 SJSAS-9_1-B44-BETA3-25_Apr_2007 SAILFIN_BRANCH-b44-TAG SAILFIN_BRANCH$BP SJSAS-9_1-B42-BETA3-12_Apr_2007

1.6 annotated / raw | Diffs: previous, other | Lines: 1556 ( +21, -3 )

Created: 2007-02-20 16:28:12 -0600 (22 months ago) | Author: jluehe | Changeset: MAIN:jluehe:20070220222135

Fix for 6526113 ("virtual server throws bad request for static docs when default webmodule is set")

Reviewed by: jfarcand

Tests run: QL

Branch point for: SJSAS91_BETA2_BRANCH

Tags: SJSAS91_BETA2_BRANCH$BP SJSAS-9_1-B37-RC-28_Feb_2007 SJSAS-9_1-B38-RC-07_Mar_2007 SJSAS-9_1-B39-RC-14_Mar_2007 SJSAS-9_1-B41-BETA2-30_Mar_2007 SJSAS-9_1-B40-RC-21_Mar_2007 GRIZZLY_1-5-0

1.5 annotated / raw | Diffs: previous, other | Lines: 1538 ( +172, -40 )

Created: 2006-09-01 12:51:01 -0500 (2 years 4 months ago) | Author: jluehe | Changeset: MAIN:jluehe:20060901175101

Fix for https://glassfish.dev.java.net/issues/show_bug.cgi?id=1024
("Avoid treating a virtual server's default-web-module as a separate web application")

Reviewed by: Jeanfrancois Arcand

Tests run:
- QL
- Servlet/TCK
- JSP/TCK

[NEWS:webcontainer 1024] [OPTIMIZATION] Avoid treating a virtual server's default-web-module as a separate web application

Branch point for: GF_V2_TEA_BRANCH GF_V3_PREWORK_BRANCH PWC12Dev_Branch SJSAS-9_1-PROFILES-20_Sep_2006 SJSAS91_BETA_BRANCH

Tags: SJSAS-9_1-B31-EA-11_Jan_2007 SJSAS-9_1-B33-BETA-24_Jan_2007 before-build-upgrade SJSAS-9_1-PROFILES-20_Sep_2006$BP SJSAS-9_1-B19-EA-27_Sep_2006 SJSAS-9_1-B21-EA-11_Oct_2006 SJSAS-9_1-B27-EA-07_Dec_2006 SJSAS-9_1-B17-EA-14_Sep_2006 SJSAS-9_1-B23-EA-25_Oct_2006 SJSAS-9_1-B28-EA-13_Dec_2006 SJSAS-9_1-B36-RC-14_Feb_2007 GF_V3_PREWORK_BRANCH$BP SJSAS-9_1-B16-EA-05_Sep_2006 SJSAS-9_1-B18-EA-20_Sep_2006 ... more hide

1.4 annotated / raw | Diffs: previous, other | Lines: 1406 ( +2, -2 )

Created: 2006-03-11 19:27:15 -0600 (2 years 9 months ago) | Author: jluehe | Changeset: MAIN:jluehe:20060312012656

Renamed AS's org.apache.commons.* to com.sun.org.apache.commons.*, to avoid collisions with org.apache.commons.* packages bundled by webapps.

Tests run: QL, Servlet TCK

Branch point for: NEMO_EA_BRANCH SJSAS-9_0_01-FCS-UBUNTU_BRANCH SJSAS90UR1_FCS-SUSTAINING_BRANCH SJSAS90_FCS_BRANCH SSS_DEV_BRANCH TANGO_WSTX

Tags: TANGO_WSTX_bpt TANGO_WSTX_mpt_1 TANGO_WSTX$BP SJSAS-9_1-B09-EA-01_Jul_2006 SJSAS-9_1-B13-EA-16_Aug_2006 SJSAS-9_1-B15-EA-30_Aug_2006 SJSAS-9_1-B12-EA-10_Aug_2006 SJSAS-9_1-B03-EA-15_May_2006 SJSAS-9_1-B01-EA-09_May_2006 SJSAS-9_1-B06-EA-07_Jun_2006 SJSAS-9_1-B11-EA-02_Aug_2006 SJSAS-9_1-B02-EA-12_May_2006 SJSAS-9_1-B10-EA-26_Jul_2006 SJSAS-9_1-B04-EA-24_May_2006 ... more hide

1.3 annotated / raw | Diffs: previous, other | Lines: 1406 ( +3, -0 )

Created: 2005-12-12 13:11:36 -0600 (3 years ago) | Author: jfarcand | Changeset: MAIN:jfarcand:20051212191132

Port fixes from Apache Tomcat 5.5:

+ According to Hibernate developers, the following scenario is causing a leak of the classloader
 added devtests/web/classloaderMemoryLeak
+ Buzilla 37150: denial of service on many and long requests on v5.5.x
 http://issues.apache.org/bugzilla/show_bug.cgi?id=37150
+ Fix swallowed NPE problem with APR connectors when there's no host header. The mapper will simply use the default host name in that case.

- All QL passed
- All Servlet/Jsp Tcks passed
- All devtests/web passed
- All CTS smoke passed

- Reviewed by: Jan Luehe

Branch point for: AS9_BETA_BRANCH GF_NEXT_BRANCH

Tags: SJSAS-9_0-B33-BETA-12_Jan_2006 AS9_BETA_BRANCH$BP SJSAS-9_0-B32-BETA-HCF-20_Dec_2005 SJSAS-9_0-B36-RC-01_Feb_2006 SJSAS-9_0-B40-RC-08_Mar_2006 SJSAS-9_0-B32F-BETA-09_Feb_2006 SJSAS-9_0-B37-RC-15_Feb_2006 SJSAS-9_0-B38-RC-22_Feb_2006 SJSAS-9_0-B35-RC-25_Jan_2006 SJSAS-9_0-B32B-BETA-09_Jan_2006 SJSAS-9_0-B39-RC-01_Mar_2006 GF_NEXT_BRANCH_POINT-01_Feb_2006 SJSAS-9_0-B34-RC-18_Jan_2006 SJSAS-9_0-B32G-BETA-10_Feb_2006 ... more hide

1.2 annotated / raw | Diffs: previous, other | Lines: 1403 ( +20, -14 )

Created: 2005-12-07 19:29:27 -0600 (3 years 1 month ago) | Author: kchung | Changeset: MAIN:kchung:20051208012701

- Add or replace Apache license with CDDL license.

Issue number:
Obtained from:
Submitted by:
Reviewed by:

1.1 new annotated / raw | Lines: 1397 ( +1397, -0 )

Created: 2005-05-27 17:55:16 -0500 (3 years 7 months ago) | Author: dpatil | Changeset: MAIN:dpatil:20050527225105

Initial revision

Branch point for: SJSAS_9_0

Tags: SJSAS_9_0$BP

latest revision download Branch GF_V3_PREWORK_BRANCH

1.5.8.1 annotated / raw | Diffs: previous, other | Lines: 1554 ( +26, -10 )

Created: 2007-04-06 23:47:02 -0500 (21 months ago) | Author: dochez | Changeset: GF_V3_PREWORK_BRANCH:dochez:20070407044537

trunk merge

Issue number:
Obtained from:
Submitted by:
Reviewed by:

Branch point for: hk2-config-branch

Tags: GF_V3_PREWORK_BRANCH_GRIZZLY_1_0 hk2-config-branch$BP hg-workspace-init-Aug-2007 hk2-config-branch-point

latest revision download Branch PWC12Dev_Branch

1.5.6.1 annotated / raw | Diffs: previous, other | Lines: 1568 ( +31, -1 )

Created: 2006-12-14 06:25:42 -0600 (2 years ago) | Author: as25299 | Changeset: PWC12Dev_Branch:as25299:20061214122542

Add an API to programmatically disable the folder redirection logic in
Mapper (for requests for directories that aren't /-terminated). This is
for use by environments where the default servlet handles such requests.

Issue number:  BT CR 6491553
Reviewed by:   jfarcand

Tags: PWC1_2-fcs-b16_24_Oct_2007 PWC1_2-fcs-b17_07_Feb_2008 PWC1_2-fcs-b19_05_May_2008 PWC1_2-fcs-b20_13_May_2008 PWC1_2-fcs-b22_17_Jul_2008 PWC1_2-fcs-b18_02_Apr_2008 PWC1_2-fcs-b21_30_May_2008 PWC1_2-fcs-b23_03_Oct_2008

latest revision download Branch SAILFIN_BRANCH

1.7.2.1 annotated / raw | Diffs: previous, other | Lines: 1567 ( +34, -21 )

Created: 2007-07-06 05:46:38 -0500 (18 months ago) | Author: prasads | Changeset: SAILFIN_BRANCH:prasads:20070706103840

Merging b54 from GlassFish TRUNK to SAILFIN_BRANCH

Tags: SAILFIN-1_0-B01-MS1-21_Aug_2007 SAILFIN-1_0-B03-17_Sept_2007 SAILFIN-1_0-MS1-21_Aug_2007 SAILFIN-1_0-B02-10_Sept_2007

latest revision download Branch SGES21_FCS_BRANCH

1.8.6.2.2.1 annotated / raw | Diffs: previous, other | Lines: 1663 ( +62, -10 )

Created: 2008-11-20 16:57:23 -0600 (48 days ago) | Author: jluehe | Changeset: SGES21_FCS_BRANCH:jluehe:20081120225723

Fix for https://glassfish.dev.java.net/issues/show_bug.cgi?id=6731 ("how to protect files residing in docroot in Glassfish")

Reviewed by: monzillo

Tests run:
- QL
- appserv-tests/devtests/web/virtualServerAlternateDocrootWelcomePageRedirect

Tags: SJSAS-9_1_1-B60A-24_Nov_2008 SAILFIN-1_0-B60A-24_Nov_2008 SJSAS-9_1_1-B60B-06_Dec_2008 SAILFIN-1_0-B60B-06_Dec_2008 SAILFIN-1_0-B60C-11_Dec_2008 SJSAS-9_1_1-B60C-11_Dec_2008 SAILFIN-1_0-B60D-16_Dec_2008 SJSAS-9_1_1-B60E-23_Dec_2008 SAILFIN-1_0-B60E-23_Dec_2008 SAILFIN-1_0-B60F-07_Jan_2009 SJSAS-9_1_1-B60F-07_Jan_2009

latest revision download Branch SJSAS91_BETA2_BRANCH

1.6.2.1 annotated / raw | Diffs: previous, other | Lines: 1554 ( +5, -7 )

Created: 2007-04-02 13:01:23 -0500 (21 months ago) | Author: jluehe | Changeset: SJSAS91_BETA2_BRANCH:jluehe:20070402180123



/*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the "License").  You may not use this file except
* in compliance with the License.
*
* You can obtain a copy of the license at
* glassfish/bootstrap/legal/CDDLv1.0.txt or
* https://glassfish.dev.java.net/public/CDDLv1.0.html.
* See the License for the specific language governing
* permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* HEADER in each file and include the License file at
* glassfish/bootstrap/legal/CDDLv1.0.txt.  If applicable,
* add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your
* own identifying information: Portions Copyright [yyyy]
* [name of copyright owner]
*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
*
* Portions Copyright Apache Software Foundation.
*/
package org.apache.coyote.tomcat5;

import java.util.Iterator;
import java.util.Set;

import javax.management.MBeanServer;
import javax.management.MBeanServerNotification;
// START SJSAS 6290785
import javax.management.MBeanAttributeInfo;
import javax.management.MBeanInfo;
// END SJSAS 6290785
import javax.management.Notification;
import javax.management.NotificationListener;
// START SJSAS 6313044
import javax.management.NotificationFilter;
// END SJSAS 6313044
import javax.management.ObjectInstance;
import javax.management.ObjectName;

import com.sun.org.apache.commons.logging.Log;
import com.sun.org.apache.commons.logging.LogFactory;

import com.sun.org.apache.commons.modeler.Registry;

import org.apache.catalina.Host;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.core.StandardHost;
import org.apache.catalina.core.StandardWrapper;

import org.apache.tomcat.util.http.mapper.Mapper;

import org.apache.tomcat.util.res.StringManager;


/**
* Mapper listener.
*
* @author Remy Maucherat
* @author Costin Manolache
*/
public class MapperListener
   /* SJSAS 6313044
   implements NotificationListener
   */
   // START SJSAS 6313044
   implements NotificationListener, NotificationFilter
   // END SJSAS 6313044
{
   private static Log log = LogFactory.getLog(MapperListener.class);


   // ----------------------------------------------------- Instance Variables
   /**
    * Associated mapper.
    */
   protected Mapper mapper = null;

   /**
    * MBean server.
    */
   protected MBeanServer mBeanServer = null;


   /**
    * The string manager for this package.
    */
   private StringManager sm =
       StringManager.getManager(Constants.Package);

   // It should be null - and fail if not set
   private String domain="*";
   private String engine="*";


   // BEGIN S1AS 5000999
   private int port;
   private String defaultHost;
   // END S1AS 5000999


   // START SJSAS 6313044
   private String myInstance;
   // END SJSAS 6313044


   // ----------------------------------------------------------- Constructors


   /**
    * Create mapper listener.
    */
   public MapperListener(Mapper mapper) {
       this.mapper = mapper;
   }


   // --------------------------------------------------------- Public Methods

   public String getDomain() {
       return domain;
   }

   public void setDomain(String domain) {
       this.domain = domain;
   }

   public String getEngine() {
       return engine;
   }

   public void setEngine(String engine) {
       this.engine = engine;
   }

   // BEGIN S1AS 5000999
   public int getPort() {
       return port;
   }

   public void setPort(int port) {
       this.port = port;
   }

   public String getDefaultHost() {
       return defaultHost;
   }

   public void setDefaultHost(String defaultHost) {
       this.defaultHost = defaultHost;
   }
   // END S1AS 5000999

   /**
    * Initialize associated mapper.
    */
   public void init() {

       // START SJSAS 6313044
       myInstance = System.getProperty("com.sun.aas.instanceName");
       // END SJSAS 6313044

       if (defaultHost != null) {
           mapper.setDefaultHostName(defaultHost);
       }

       try {

           mBeanServer = Registry.getServer();

           // Query hosts
           String onStr = domain + ":type=Host,*";
           ObjectName objectName = new ObjectName(onStr);
           Set set = mBeanServer.queryMBeans(objectName, null);
           Iterator iterator = set.iterator();
           while (iterator.hasNext()) {
               ObjectInstance oi = (ObjectInstance) iterator.next();
               registerHost(oi.getObjectName());
           }


           // Query contexts
           onStr = domain + ":j2eeType=WebModule,*";
           objectName = new ObjectName(onStr);
           set = mBeanServer.queryMBeans(objectName, null);
           iterator = set.iterator();
           while (iterator.hasNext()) {
               ObjectInstance oi = (ObjectInstance) iterator.next();
               registerContext(oi.getObjectName());
           }

           // Query wrappers
           onStr = domain + ":j2eeType=Servlet,*";
           objectName = new ObjectName(onStr);
           set = mBeanServer.queryMBeans(objectName, null);
           iterator = set.iterator();
           while (iterator.hasNext()) {
               ObjectInstance oi = (ObjectInstance) iterator.next();
               registerWrapper(oi.getObjectName());
           }

           onStr = "JMImplementation:type=MBeanServerDelegate";
           objectName = new ObjectName(onStr);
           /* SJSAS 6313044
           mBeanServer.addNotificationListener(objectName, this, null, null);
           */
           // START SJSAS 6313044
           mBeanServer.addNotificationListener(objectName, this, this, null);
           // END SJSAS 6313044
       } catch (Exception e) {
           log.warn("Error registering contexts",e);
       }

   }


   // START SJSAS 6313044
   // ------------------------------------------ NotificationFilter Methods
   /**
    * Filters out any notifications corresponding to MBeans belonging to
    * a different server instance than the server instance on which this
    * MapperListener is running.
    *
    * @param notification The notification to be examined
    *
    * @return true if the notification needs to be sent to this
    * MapperListener, false otherwise.
    */
   public boolean isNotificationEnabled(Notification notification) {

       if (notification instanceof MBeanServerNotification) {
           ObjectName objectName =
               ((MBeanServerNotification) notification).getMBeanName();

           String otherDomain = objectName.getDomain();
           if (this.domain != null && !(this.domain.equals(otherDomain))) {
               return false;
           }

           String otherInstance = objectName.getKeyProperty("J2EEServer");
           if (myInstance != null && otherInstance != null
                   && !otherInstance.equals(myInstance)) {
               return false;
           }
       }

       return true;

   }
   // END SJSAS 6313044


   // ------------------------------------------- NotificationListener Methods


   public void handleNotification(Notification notification,
                                  java.lang.Object handback) {

       if (notification instanceof MBeanServerNotification) {
           ObjectName objectName =
               ((MBeanServerNotification) notification).getMBeanName();
           String j2eeType = objectName.getKeyProperty("j2eeType");
           String engineName = null;
           if (j2eeType != null) {
               if ((j2eeType.equals("WebModule")) ||
                   (j2eeType.equals("Servlet"))) {
                   if (mBeanServer.isRegistered(objectName)) {
                       /* SJSAS 6290785
                       try {
                           engineName = (String)
                               mBeanServer.getAttribute(objectName, "engineName");
                       } catch (Exception e) {
                           // Ignore
                       }
                       */
                       // START SJSAS 6290785
                       MBeanInfo info = null;
                       try {
                           info = mBeanServer.getMBeanInfo(objectName);
                       } catch (Exception e) {
                           // Ignore
                       }
                       if (info != null) {
                           boolean hasEngineNameAttribute = false;
                           MBeanAttributeInfo[] attrInfo = info.getAttributes();
                           if (attrInfo != null) {
                               for (int i=0; i<attrInfo.length; i++) {
                                   if ("engineName".equals(
                                                   attrInfo[i].getName())) {
                                       hasEngineNameAttribute = true;
                                       break;
                                   }
                               }
                           }
                           if (hasEngineNameAttribute) {
                               try {
                                   engineName = (String)
                                       mBeanServer.getAttribute(objectName,
                                                                "engineName");
                               } catch (Exception e) {
                                   // Ignore
                               }
                           }
                       }
                       // END SJSAS 6290785
                   }
               }
           }

           // At deployment time, engineName is always = null.
           if ( (!"*".equals(domain)) &&
                ( !domain.equals(objectName.getDomain()) ) &&
                ( (!domain.equals(engineName) ) &&
                  (engineName != null) ) )  {
               return;
           }

           if (log.isDebugEnabled()) {
               log.debug( "Handle " + objectName );
           }

           if (notification.getType().equals
               (MBeanServerNotification.REGISTRATION_NOTIFICATION)) {
               String type=objectName.getKeyProperty("type");
               if( "Host".equals( type )) {
                   try {
                       registerHost(objectName);
                   } catch (Exception e) {
                       log.warn("Error registering Host " + objectName, e);
                   }
               }

               if (j2eeType != null) {
                   if (j2eeType.equals("WebModule")) {
                       try {
                           registerContext(objectName);
                       } catch (Throwable t) {
                           log.warn("Error registering Context " + objectName,t);
                       }
                   } else if (j2eeType.equals("Servlet")) {
                       try {
                           registerWrapper(objectName);
                       } catch (Throwable t) {
                           log.warn("Error registering Wrapper " + objectName,t);
                       }
                   }
               }
           } else if (notification.getType().equals
                      (MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
               String type=objectName.getKeyProperty("type");
               if( "Host".equals( type )) {
                   try {
                       unregisterHost(objectName);
                   } catch (Exception e) {
                       log.warn("Error unregistering Host " + objectName,e);
                   }
               }

               if (j2eeType != null) {
                   if (j2eeType.equals("WebModule")) {
                       try {
                           unregisterContext(objectName);
                       } catch (Throwable t) {
                           log.warn("Error unregistering webapp " + objectName,t);
                       }
                   }
               }
           }
       }

   }


   // ------------------------------------------------------ Protected Methods

   private void registerEngine()
       throws Exception
   {
       ObjectName engineName = new ObjectName
           (domain + ":type=Engine");
       if ( ! mBeanServer.isRegistered(engineName)) return;
       // BEGIN S1AS 5000999
       /*
       String defaultHost =
           (String) mBeanServer.getAttribute(engineName, "defaultHost");
        */
       if (defaultHost == null) {
           defaultHost =
               (String) mBeanServer.getAttribute(engineName, "defaultHost");
       }
       // END S1AS 5000999

       ObjectName hostName = new ObjectName
            (domain + ":type=Host," + "host=" + defaultHost);

       if (!mBeanServer.isRegistered(hostName)) {

           // Get the hosts' list
           String onStr = domain + ":type=Host,*";
           ObjectName objectName = new ObjectName(onStr);
           Set set = mBeanServer.queryMBeans(objectName, null);
           Iterator iterator = set.iterator();
           String[] aliases;
           boolean isRegisteredWithAlias = false;

           while (iterator.hasNext()) {

               if (isRegisteredWithAlias) break;

               ObjectInstance oi = (ObjectInstance) iterator.next();
               hostName = oi.getObjectName();
               aliases = (String[])
                   mBeanServer.invoke(hostName, "findAliases", null, null);

               for (int i=0; i < aliases.length; i++){
                   if (aliases[i].equalsIgnoreCase(defaultHost)){
                       isRegisteredWithAlias = true;
                       break;
                   }
               }
           }

           if (!isRegisteredWithAlias)
               log.warn("Unknown default host: " + defaultHost);
       }

       // This should probably be called later
       if( defaultHost != null ) {
           mapper.setDefaultHostName(defaultHost);
       }
   }

   /**
    * Register host.
    */
   private void registerHost(ObjectName objectName)
       throws Exception {
       String name=objectName.getKeyProperty("host");
       if( name != null ) {

           Host host = (Host) mBeanServer.invoke(objectName,
                                                 "findMappingObject",
                                                 null,
                                                 null);
           if (host == null) {
               throw new Exception("No host registered for " + objectName);
           }

           // BEGIN S1AS 5000999
           /*
            * Register the given Host only if one of its associated port
            * numbers matches the port number of this MapperListener
            */
           int[] ports = ((StandardHost) host).findPorts();
           boolean portMatch = false;
           if (ports != null) {
               for (int i=0; i<ports.length; i++) {
                   if (ports[i] == this.port) {
                       portMatch = true;
                       break;
                   }
               }
           }
           if (!portMatch) {
               return;
           }
           // END S1AS 5000999

           String[] aliases = host.findAliases();

           mapper.addHost(name, aliases, host);
       }
   }


   /**
    * Unregister host.
    */
   private void unregisterHost(ObjectName objectName)
       throws Exception {
       String name=objectName.getKeyProperty("host");
       // BEGIN S1AS 5000999
       if (name != null) {
           int[] ports = (int[]) mBeanServer.invoke
                   (objectName, "findPorts", null, null);
           boolean portMatch = false;
           if (ports != null) {
               for (int i=0; i<ports.length; i++) {
                   if (ports[i] == this.port) {
                       portMatch = true;
                       break;
                   }
               }
           }
           if (!portMatch) {
               return;
           }
       }
       // END S1AS 5000999
       mapper.removeHost(name);
   }


   /**
    * Register context.
    */
   private void registerContext(ObjectName objectName)
       throws Exception {

       StandardContext context = (StandardContext)
           mBeanServer.invoke(objectName, "findMappingObject", null, null);
       if (context == null) {
           throw new Exception("No context registered for " + objectName);
       }

       String name = objectName.getKeyProperty("name");

       // If the domain is the same with ours or the engine
       // name attribute is the same... - then it's ours
       String targetDomain=objectName.getDomain();
       if( ! domain.equals( targetDomain )) {
           targetDomain = context.getEngineName();
           if( ! domain.equals( targetDomain )) {
               // not ours
               return;
           }
       }

       String hostName = null;
       String contextName = null;
       if (name.startsWith("//")) {
           name = name.substring(2);
       }
       int slash = name.indexOf("/");
       if (slash != -1) {
           hostName = name.substring(0, slash);
           contextName = name.substring(slash);
       } else {
           return;
       }
       // Special case for the root context
       if (contextName.equals("/")) {
           contextName = "";
       }

       if (log.isDebugEnabled()) {
           log.debug(sm.getString("mapperListener.registerContext",
                                  contextName));
       }

       javax.naming.Context resources = context.findStaticResources();
       String[] welcomeFiles = context.getWelcomeFiles();

       mapper.addContext(hostName, contextName, context,
                         welcomeFiles, resources);
   }


   /**
    * Unregister context.
    */
   private void unregisterContext(ObjectName objectName)
       throws Exception {

       String name = objectName.getKeyProperty("name");

       // If the domain is the same with ours or the engine
       // name attribute is the same... - then it's ours
       String targetDomain=objectName.getDomain();
       if( ! domain.equals( targetDomain )) {
           try {
               targetDomain = (String) mBeanServer.getAttribute
                   (objectName, "engineName");
           } catch (Exception e) {
               // Ignore
           }
           if( ! domain.equals( targetDomain )) {
               // not ours
               return;
           }
       }

       String hostName = null;
       String contextName = null;
       if (name.startsWith("//")) {
           name = name.substring(2);
       }
       int slash = name.indexOf("/");
       if (slash != -1) {
           hostName = name.substring(0, slash);
           contextName = name.substring(slash);
       } else {
           return;
       }
       // Special case for the root context
       if (contextName.equals("/")) {
           contextName = "";
       }

       if (log.isDebugEnabled()) {
           log.debug(sm.getString("mapperListener.unregisterContext",
                                  contextName));
       }

       mapper.removeContext(hostName, contextName);

   }


   /**
    * Register wrapper.
    */
   private void registerWrapper(ObjectName objectName)
       throws Exception {

       StandardWrapper wrapper = (StandardWrapper)
           mBeanServer.invoke(objectName, "findMappingObject", null, null);
       if (wrapper == null) {
           throw new Exception("No wrapper registered for " + objectName);
       }

       // If the domain is the same with ours or the engine
       // name attribute is the same... - then it's ours
       String targetDomain=objectName.getDomain();
       if( ! domain.equals( targetDomain )) {
           targetDomain= wrapper.getEngineName();
           if( ! domain.equals( targetDomain )) {
               // not ours
               return;
           }

       }

       String wrapperName = objectName.getKeyProperty("name");
       String name = objectName.getKeyProperty("WebModule");

       String hostName = null;
       String contextName = null;
       if (name.startsWith("//")) {
           name = name.substring(2);
       }
       int slash = name.indexOf("/");
       if (slash != -1) {
           hostName = name.substring(0, slash);
           contextName = name.substring(slash);
       } else {
           return;
       }
       // Special case for the root context
       if (contextName.equals("/")) {
           contextName = "";
       }

       if (log.isDebugEnabled()) {
           log.debug(sm.getString("mapperListener.registerWrapper",
                                  wrapperName, contextName));
       }

       String[] mappings = wrapper.findMappings();

       for (int i = 0; i < mappings.length; i++) {
           boolean jspWildCard = (wrapperName.equals("jsp")
                                  && mappings[i].endsWith("/*"));
           mapper.addWrapper(hostName, contextName, mappings[i], wrapper,
                             jspWildCard);
       }

   }


}

Tags: SJSAS-9_1-B41C-BETA2-14_Apr_2007 SJSAS-9_1-B41A-BETA2-04_Apr_2007 SJSAS-9_1-B41B-BETA2-13_Apr_2007 SJSAS-9_1-B41D-BETA2-24_Apr_2007

latest revision download Branch SJSAS91_BETA_BRANCH

1.5.10.1 annotated / raw | Diffs: previous, other | Lines: 1556 ( +21, -3 )

Created: 2007-02-20 16:59:31 -0600 (22 months ago) | Author: jluehe | Changeset: SJSAS91_BETA_BRANCH:jluehe:20070220225912

Ported fix for 6526113 ("virtual server throws bad request for static
docs when default webmodule is set") to SJSAS91_BETA_BRANCH

Reviewed by: jfarcand
Approved by: dhiru.pandey@sun.com

Tests run: QL

Tags: SJSAS-9_1-B33E-BETA-21_Feb_2007

latest revision download Branch SJSAS91_FCS_BRANCH

1.8.6.3 annotated / raw | Diffs: previous, other | Lines: 1663 ( +62, -10 )

Created: 2008-11-20 16:54:21 -0600 (48 days ago) | Author: jluehe | Changeset: SJSAS91_FCS_BRANCH:jluehe:20081120225421

Fix for https://glassfish.dev.java.net/issues/show_bug.cgi?id=6731 ("how to protect files residing in docroot in Glassfish")

Reviewed by: monzillo

Tests run:
- QL
- appserv-tests/devtests/web/virtualServerAlternateDocrootWelcomePageRedirect

1.8.6.2 annotated / raw | Diffs: previous, other | Lines: 1611 ( +26, -9 )

Created: 2008-04-17 13:38:12 -0500 (8 months ago) | Author: jluehe | Changeset: SJSAS91_FCS_BRANCH:jluehe:20080417183657

Copyright update

Branch point for: SGES21_FCS_BRANCH

Tags: SJSAS-9_1_1-B42-17_Jul_2008 SJSAS-9_1_1-B41-10_Jul_2008 SAILFIN-1_0-B42-17_Jul_2008 SAILFIN-1_0-B35-28_May_2008 SAILFIN-1_0-B56-15_Oct_2008 SJSAS-9_1_1-B49-06_Sept_2008 SAILFIN-1_0-B53-03_Oct_2008 SJSAS-9_1_1-B43-24_Jul_2008 SAILFIN-1_0-B43-24_Jul_2008 SJSAS-9_1_1-B33-14_May_2008 SJSAS-9_1_1-B44-31_Jul_2008 SAILFIN-1_0-B33-14_May_2008 SJSAS-9_1_1-B57-23_Oct_2008 SJSAS-9_1_1-B45-07_Aug_2008 ... more hide

1.8.6.1 annotated / raw | Diffs: previous, other | Lines: 1594 ( +28, -1 )

Created: 2007-12-13 13:04:30 -0600 (12 months ago) | Author: jluehe | Changeset: SJSAS91_FCS_BRANCH:jluehe:20071213190430

Ported fix for 6491553 ("org.apache.tomcat.util.http.mapper.Mapper.internalMapWrapper is inefficient for request dispatching") from PWC 1.2

Branch point for: SJSAS911_BETA_BRANCH

Tags: SF-0_5-B37-12_Jun_2008 SF-0_5-B37b-29_Jun_2008 SF-0_5-B37I-11_Aug_2008 SAILFIN-1_0-B14-17_Dec_2007 SF-0_5-B34-21_May_2008 SAILFIN-1_0-B20-07_Feb_2008 SAILFIN-1_0-B22-20_Feb_2008 SJSAS-9_1_1-B22-20_Feb_2008 SJSAS-9_1_1-B27-26_Mar_2008 SJSAS-9_1_1-B24B-20_Mar_2008 SJSAS-9_1_1-B37F-24_Jul_2008 SJSAS-9_1_1-B18-24_Jan_2008 SF-0_5-B35-28_May_2008 SAILFIN-1_0-B18-24_Jan_2008 ... more hide

latest revision download Branch SJSAS_9_0

1.1.1.1 annotated / raw | Diffs: previous, other | Lines: 1397 ( +0, -0 )

Created: 2005-05-27 17:55:16 -0500 (3 years 7 months ago) | Author: dpatil | Changeset: SJSAS_9_0:dpatil:20050527225105

GlassFish first drop

Branch point for: SJSAS9_MS2_BRANCH

Tags: START SJSAS-9_0-B25-ALPHA-03_Nov_2005 SJSAS-9_0-B28-ALPHA-23_Nov_2005 SJSAS-9_0-B30-ALPHA-07_Dec_2005 SJSAS-9_0-B27-ALPHA-16_Nov_2005 SJSAS-9_0-B29-ALPHA-30_Nov_2005 SJSAS-9_0-B24-ALPHA-26_Oct_2005 SJSAS9_MS2_BRANCH$BP SJSAS9_MS2_BRANCH_POINT-16_June_2005 SJSAS-9_0-B09-ALPHA-MILESTONE2-17_June_2005 SJSAS-9_0-B23-ALPHA-19_Oct_2005 SJSAS-9_0-B22-ALPHA-13_Oct_2005 SJSAS-9_0-B20-ALPHA-30_Sept_2005 SJSAS-9_0-B21-ALPHA-01_Oct_2005 ... more hide

Crucible: Open Source License registered to Atlassian.
Atlassian Crucible, painless code review. (Version:1.6.2 Build:build-rspud1 2008-10-22) - Administration - Page generated 2009-01-08 08:18 -0600