tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardContext.java
Date Mon, 17 Mar 2003 07:26:43 GMT
costin      2003/03/16 23:26:42

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardContext.java
  Log:
  Remove "service=", cleaner way to deal with the "j2eeApplication" and server - now
  they're also exposed as attributes, so a real j2ee server can set them when creating
  the context ( via JMX )
  
  Revision  Changes    Path
  1.28      +32 -6     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- StandardContext.java	14 Mar 2003 23:49:22 -0000	1.27
  +++ StandardContext.java	17 Mar 2003 07:26:40 -0000	1.28
  @@ -508,6 +508,9 @@
       private long startupTime;
       private long tldScanTime;
   
  +    private String j2EEApplication="none";
  +    private String j2EEServer="none";
  +
       // ----------------------------------------------------- Context Properties
   
       public void setName( String name ) {
  @@ -885,6 +888,22 @@
   
       }
   
  +    public String getJ2EEApplication() {
  +        return j2EEApplication;
  +    }
  +
  +    public void setJ2EEApplication(String j2EEApplication) {
  +        this.j2EEApplication = j2EEApplication;
  +    }
  +
  +    public String getJ2EEServer() {
  +        return j2EEServer;
  +    }
  +
  +    public void setJ2EEServer(String j2EEServer) {
  +        this.j2EEServer = j2EEServer;
  +    }
  +
   
       /**
        * Set the Loader with which this Context is associated.
  @@ -1647,7 +1666,11 @@
               pattern = pattern.substring(pattern.lastIndexOf("*"));
               servletName = "jsp";
           }
  -        addServletMapping(pattern, servletName);
  +        if( findChild(servletName) != null) {
  +            addServletMapping(pattern, servletName);
  +        } else {
  +            log.info("Skiping " + pattern + " , no servlet " + servletName);
  +        }
       }
   
   
  @@ -4672,14 +4695,17 @@
           String onameStr=null;
           try {
               if( oname==null || oname.getKeyProperty("j2eeType")==null ) {
  -                ContainerBase ctx=(ContainerBase)parent;
  +                StandardHost ctx=(StandardHost)parent;
                   String pathName=getName();
                   String hostName=getParent().getName();
                   String name= "//" + ((hostName==null)? "DEFAULT" : hostName) +
                           (("".equals(pathName))?"/":pathName );
   
  -                onameStr="j2eeType=WebModule,name=" + name +
  -                        ctx.getJSR77Suffix();
  +                String suffix=",J2EEApplication=" +
  +                        getJ2EEApplication() + ",J2EEServer=" +
  +                        getJ2EEServer();
  +
  +                onameStr="j2eeType=WebModule,name=" + name + suffix;
                   if( log.isDebugEnabled())
                       log.debug("Registering " + onameStr + " for " + oname);
   
  @@ -4763,7 +4789,7 @@
           }
           // XXX The service and domain should be the same.
           ObjectName parentName=new ObjectName( domain + ":" +
  -                "type=Host,host=" + hostName + ",service=Tomcat-Standalone");
  +                "type=Host,host=" + hostName);
           log.info("Adding to " + parentName );
   
           if( ! mserver.isRegistered(parentName)) {
  
  
  

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