costin      02/04/12 22:53:30

  Modified:    jk/java/org/apache/jk/server JkMain.java
  Log:
  2 more command line params to allow out/err redirection.
  
  Rename a method to avoid confusing IntrospectionUtil
  
  Revision  Changes    Path
  1.17      +25 -3     
jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java
  
  Index: JkMain.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- JkMain.java       11 Apr 2002 05:46:51 -0000      1.16
  +++ JkMain.java       13 Apr 2002 05:53:30 -0000      1.17
  @@ -131,11 +131,33 @@
       public void setJkHome( String s ) {
           wEnv.setJkHome(s);
       }
  +    
  +    String out;
  +    String err;
  +    
  +    public void setOut( String s ) {
  +        this.out=s;
  +    }
   
  +    public void setErr( String s ) {
  +        this.err=s;
  +    }
  +    
       // -------------------- Initialization --------------------
       
       public void init() throws IOException
       {
  +        if(null != out) {
  +            PrintStream outS=new PrintStream(new FileOutputStream(out));
  +            System.setOut(outS);
  +//             if( stderr==null ) 
  +//                 System.setErr(out);
  +        }
  +        if(null != err) {
  +            PrintStream errS=new PrintStream(new FileOutputStream(err));
  +            System.setErr(errS);
  +        }
  +
           String home=wEnv.getJkHome();
           if( home==null ) {
               // XXX use IntrospectionUtil to find myself
  @@ -215,7 +237,7 @@
       /* A bit of magic to support workers.properties without giving
          up the clean get/set
       */
  -    public void setProperty( Object target, String name, String val ) {
  +    public void setBeanProperty( Object target, String name, String val ) {
           if( val!=null )
               val=IntrospectionUtils.replaceProperties( val, props );
           if( log.isDebugEnabled())
  @@ -232,7 +254,7 @@
               log.debug( "setProperty " + handlerN + " " + name + "=" + val );
           Object target=wEnv.getHandler( handlerN );
   
  -        setProperty( target, name, val );
  +        setBeanProperty( target, name, val );
       }
   
       public long getStartTime() {
  @@ -284,7 +306,7 @@
               String propValue=props.getProperty( k );
               if( "className".equals( name ) )
                   continue;
  -            this.setProperty( o, name, propValue );
  +            this.setBeanProperty( o, name, propValue );
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to