tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/j2ee/org/apache/tomcat/j2ee J2EEInterceptor.java
Date Sat, 09 Sep 2000 23:28:05 GMT
costin      00/09/09 16:28:05

  Modified:    .        build.xml
               src/j2ee/org/apache/tomcat/j2ee J2EEInterceptor.java
  Added:       src/j2ee build.xml
  Log:
  Moved j2ee build to src/j2ee/build.xml, the main build.xml will just call
  it. This should be done for other modules - it will increase the module
  separation and simplify the development.
  
  Fixed the j2ee interceptor to work with the latest changes.
  
  Revision  Changes    Path
  1.78      +2 -26     jakarta-tomcat/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/build.xml,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- build.xml	2000/08/31 21:58:41	1.77
  +++ build.xml	2000/09/09 23:28:04	1.78
  @@ -361,32 +361,8 @@
     </target>
   
     <!-- ==================== J2EE integration ========== -->
  -  <target name="j2ee" depends="tomcat,tomcat-j2ee.jar" />
  -  <target name="j2ee-dist" depends="tomcat,tomcat-j2ee.jar" />
  -
  -  <target name="tomcat-j2ee.jar" >
  -    <javac srcdir="src/j2ee" 
  -      optimize="${optimize}"
  -      destdir="${tomcat.build}/classes"
  -      classpath="${servlet22.jar};${j2ee.home}/lib/classes;${j2ee.home}/lib/j2ee.jar" 
  -      debug="${debug}" />
  -    <copydir src="src/j2ee" 
  -      dest="${tomcat.build}/classes">
  -      <include name="**/*.properties" />
  -    </copydir>
  -    <jar jarfile="${tomcat.build}/lib/tomcat-j2ee.jar"
  -      basedir="${tomcat.build}/classes" >
  -      <include name="org/apache/tomcat/deployment/**" />
  -      <include name="org/apache/tomcat/j2ee/**" />
  -      <include name="org/apache/tomcat/util/XMLParser.class" />
  -      <include name="org/apache/tomcat/util/XMLTree.class" />
  -    </jar> 
  -    <delete dir="${tomcat.build}/classes" >
  -      <include name="org/apache/tomcat/deployment/**" />
  -      <include name="org/apache/tomcat/j2ee/**" />
  -      <include name="org/apache/tomcat/util/XMLParser.class" />
  -      <include name="org/apache/tomcat/util/XMLTree.class" />
  -    </delete>
  +  <target name="j2ee" >
  +    <ant antfile="src/j2ee/build.xml" target="tomcat-j2ee.jar" />
     </target>
   
     <!-- ==================== Build all web applications ==================== -->
  
  
  
  1.1                  jakarta-tomcat/src/j2ee/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0"?> 
  
  <!-- Emacs indentation & editting support
      <antstructure output="ant.dtd"/>
  <!DOCTYPE ant SYSTEM "ant.dtd" >
  -->
  
  <!-- Builds the j2ee adapter ( allowing tomcat to act as j2ee web server ) -->
  <!-- 
  Important!
  
  All paths are relative to "basedir". 
  There are 2 ways to run this:
  1. in src/j2ee. 
     basedir== "." ==  src/j2ee 
     All paths are relative to this value.
  
  2. included in the main build.xml. 
     basedir=="." == jararta-tomcat/ ( i.e. the root dir of srcs)
     The properties are already defined in the main build.xml, all 
     values relative to src/j2ee are ignored ( properties are read-only
     after definition, as in xsl )
  
  -->
  
  <project name="Tomcat-j2ee" default="main" basedir=".">
  
    <!-- Compilation properties -->
  
    <property name="build.compiler" value="classic"/>
    <property name="optimize" value="false" />
    <property name="debug" value="off" />
  
    <!-- Directories -->
  
    <property name="tomcat.build" value="../../../build/tomcat"/>
    <property name="tomcat.home" value="../../../dist/tomcat"/>
  
  
    <!-- External packages we depend on -->
  
    <property name="j2ee.home" value="../../../j2ee/build/unix"/>
  
    <!-- Other properties -->
    <property name="tomcat.classpath"
       value="${tomcat.build}/lib/servlet.jar;${tomcat.build}/lib/tomcat_core.jar" />
    <property name="j2ee.classpath" 
       value="${tomcat.classpath};${j2ee.home}/lib/classes;${j2ee.home}/lib/j2ee.jar;${tomcat.build}/lib/facade.jar"
/>
    
    <!-- ==================== J2EE integration ========== -->
    <target name="j2ee" depends="tomcat-j2ee.jar" />
  
    <target name="j2ee-dist" depends="tomcat-j2ee.jar" />
  
    <target name="tomcat-j2ee.jar" >
      <javac srcdir="." 
        optimize="${optimize}"
        classpath="${j2ee.classpath}"
        destdir="${tomcat.build}/classes"
        debug="${debug}" >
        <include name="org/apache/**" />
      </javac>
      <copydir src="." 
        dest="${tomcat.build}/classes">
        <include name="**/*.properties" />
      </copydir>
      <jar jarfile="${tomcat.build}/lib/tomcat-j2ee.jar"
        basedir="${tomcat.build}/classes" >
        <include name="org/apache/tomcat/deployment/**" />
        <include name="org/apache/tomcat/j2ee/**" />
        <include name="org/apache/tomcat/util/XMLParser.class" />
        <include name="org/apache/tomcat/util/XMLTree.class" />
      </jar> 
      <delete dir="${tomcat.build}/classes" >
        <include name="org/apache/tomcat/deployment/**" />
        <include name="org/apache/tomcat/j2ee/**" />
        <include name="org/apache/tomcat/util/XMLParser.class" />
        <include name="org/apache/tomcat/util/XMLTree.class" />
      </delete>
    </target>
  
    <target name="main" depends="tomcat-j2ee.jar"/>
      
  </project>
  
  
  
  1.5       +15 -6     jakarta-tomcat/src/j2ee/org/apache/tomcat/j2ee/J2EEInterceptor.java
  
  Index: J2EEInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/j2ee/org/apache/tomcat/j2ee/J2EEInterceptor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- J2EEInterceptor.java	2000/07/25 00:17:19	1.4
  +++ J2EEInterceptor.java	2000/09/09 23:28:05	1.5
  @@ -6,7 +6,6 @@
   import com.sun.web.server.*;
   
   import com.sun.enterprise.util.JarClassLoader;
  -import org.apache.tomcat.loader.AdaptiveClassLoader;
   
   import java.net.URL;
   import java.net.InetAddress;
  @@ -30,6 +29,10 @@
   import org.apache.tomcat.deployment.*;
   import org.apache.tomcat.util.*;
   
  +// depends on servlet 2.2
  +import org.apache.tomcat.facade.*;
  +import org.apache.tomcat.helper.*;
  +
   /**
    * Adapter for j2ee.
    * 
  @@ -72,10 +75,12 @@
       
       public int preService(Request request, Response response) {
   	Context ctx = request.getContext();
  -	ServletWrapper sw=request.getWrapper();
  +	Handler sw=request.getWrapper();
  +	if( ! (sw instanceof ServletWrapper) )
  +	    return 0;
   	try {
   	    invM.preServletInvoke( ctx.getFacade(),
  -				   sw.getServlet(), 
  +				   ((ServletWrapper)sw).getServlet(), 
   				   request.getFacade(),
   				   response.getFacade() );
   	} catch(Exception ex ) {
  @@ -85,9 +90,12 @@
       }
       public int postService(Request request, Response response) {
   	Context ctx = request.getContext();
  -	ServletWrapper sw=request.getWrapper();
  +	Handler sw=request.getWrapper();
  +	if( ! (sw instanceof ServletWrapper) )
  +	    return 0;
   	try {
  -	    invM.postServletInvoke( ctx.getFacade(), sw.getServlet(), 
  +	    invM.postServletInvoke( ctx.getFacade(),
  +				    ((ServletWrapper)sw).getServlet(), 
   				    request.getFacade(),
   				    response.getFacade() );
   	    intLogRequest( request.getContext().getPath(),
  @@ -235,7 +243,8 @@
   
   	String realm="default";  //ctx.getRealmName();
   
  -	ServletWrapper sw=req.getWrapper();
  +	Handler h=req.getWrapper();
  +	ServletWrapper sw=(ServletWrapper)h;
   	String mappedRole=null;
   	String role=null;
   	for( int i=0; i< roles.length ; i++ ) {
  
  
  

Mime
View raw message