tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lar...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/server Ajp12Interceptor.java
Date Sat, 11 Aug 2001 03:21:16 GMT
larryi      01/08/10 20:21:16

  Modified:    src/share/org/apache/tomcat/modules/server
                        Ajp12Interceptor.java
  Log:
  Add ajpidFile parameter so "stop" file may be specified
  
  Revision  Changes    Path
  1.15      +14 -2     jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12Interceptor.java
  
  Index: Ajp12Interceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12Interceptor.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Ajp12Interceptor.java	2001/05/18 19:20:14	1.14
  +++ Ajp12Interceptor.java	2001/08/11 03:21:16	1.15
  @@ -71,6 +71,7 @@
   import org.apache.tomcat.util.net.*;
   import org.apache.tomcat.util.*;
   import org.apache.tomcat.util.http.*;
  +import org.apache.tomcat.util.io.FileUtil;
   
   /* 
    */
  @@ -78,6 +79,7 @@
       implements  TcpConnectionHandler{
       private boolean tomcatAuthentication=true;
       String secret;
  +    File ajpidFile=null;
       
       public Ajp12Interceptor() {
   	super();
  @@ -100,6 +102,12 @@
       public void setSecret( String s ) {
   	secret=s;
       }
  +
  +    /** Specify ajpid file used when shutting down tomcat
  +     */
  +    public void setAjpidFile( String path ) {
  +        ajpidFile=( path==null?null:new File(path));
  +    }
       
       public void engineState(ContextManager cm, int state )
   	throws TomcatException
  @@ -112,9 +120,13 @@
   	Ajp12Interceptor tcpCon=this;
   	int portInt=tcpCon.getPort();
   	InetAddress address=tcpCon.getAddress();
  +        File sf=FileUtil.getConfigFile(ajpidFile, new File(cm.getHome()),
  +                        "conf/ajp12.id");
  +        if( ajpidFile != null || debug > 0)
  +            log( "Using stop file: "+sf);
   	try {
   	    PrintWriter stopF=new PrintWriter
  -		(new FileWriter(cm.getHome() + "/conf/ajp12.id"));
  +		(new FileWriter(sf));
   	    stopF.println( portInt );
   	    if( address==null )
   		stopF.println( "" );
  @@ -126,7 +138,7 @@
   		stopF.println();
   	    stopF.close();
   	} catch( IOException ex ) {
  -	    log( "Can't create ajp12.id " + ex );
  +	    log( "Can't create stop file: "+sf, ex );
   	}
       }
   
  
  
  

Mime
View raw message