giacomo     2003/01/09 06:52:04

  Modified:    src/blocks/php/java/org/apache/cocoon/generation
                        PhpGenerator.java
  Log:
  make some method package protected instead of privat to increase performance by 
avoiding 'access emulated by a synthetic accessor method' (objected by eclipse)
  
  Revision  Changes    Path
  1.2       +27 -17    
xml-cocoon2/src/blocks/php/java/org/apache/cocoon/generation/PhpGenerator.java
  
  Index: PhpGenerator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/blocks/php/java/org/apache/cocoon/generation/PhpGenerator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -d -b -u -r1.1 -r1.2
  --- PhpGenerator.java 18 Dec 2002 23:42:26 -0000      1.1
  +++ PhpGenerator.java 9 Jan 2003 14:52:01 -0000       1.2
  @@ -50,24 +50,30 @@
   */
   package org.apache.cocoon.generation;
   
  -import org.apache.avalon.excalibur.xml.Parser;
  -import org.apache.avalon.framework.CascadingRuntimeException;
  -import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.environment.http.HttpEnvironment;
  -import org.apache.excalibur.source.Source;
  -import org.xml.sax.InputSource;
  -import org.xml.sax.SAXException;
  +import java.io.IOException;
  +import java.io.OutputStream;
  +import java.io.PipedInputStream;
  +import java.io.PipedOutputStream;
  +import java.util.Enumeration;
   
   import javax.servlet.ServletConfig;
   import javax.servlet.ServletContext;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  -import java.io.IOException;
  -import java.io.OutputStream;
  -import java.io.PipedInputStream;
  -import java.io.PipedOutputStream;
  -import java.util.Enumeration;
  +
  +import org.apache.avalon.framework.CascadingRuntimeException;
  +import org.apache.avalon.framework.logger.Logger;
  +
  +import org.apache.avalon.excalibur.xml.Parser;
  +
  +import org.apache.cocoon.ProcessingException;
  +import org.apache.cocoon.environment.http.HttpEnvironment;
  +
  +import org.apache.excalibur.source.Source;
  +
  +import org.xml.sax.InputSource;
  +import org.xml.sax.SAXException;
   
   /**
    * Allows PHP to be used as a generator.  Builds upon the PHP servlet
  @@ -104,7 +110,11 @@
           HttpServletRequest request;
           HttpServletResponse response;
           ServletException exception = null;
  +        Logger logger;
   
  +        protected PhpServlet( Logger logger ) {
  +            this.logger = logger;
  +        }
           public void setInput(String input) {
               this.input = input;
           }
  @@ -125,7 +135,7 @@
               try {
                   output.write(data.getBytes());
               } catch (IOException e) {
  -                PhpGenerator.this.getLogger().debug("PhpGenerator.write()", e);
  +                logger.debug("PhpGenerator.write()", e);
                   throw new CascadingRuntimeException("PhpGenerator.write()", e);
               }
           }
  @@ -138,14 +148,14 @@
               try {
                   service(request, response, input);
               } catch (ServletException e) {
  -                PhpGenerator.this.getLogger().error("PhpGenerator.run()", e);
  +                logger.error("PhpGenerator.run()", e);
                   this.exception = e;
               }
   
               try {
                   output.close();
               } catch (IOException e) {
  -                PhpGenerator.this.getLogger().error("PhpGenerator.run():SHOULD 
NEVER HAPPEN", e);
  +                logger.error("PhpGenerator.run():SHOULD NEVER HAPPEN", e);
                   // should never happen
               }
           }
  @@ -179,7 +189,7 @@
               PipedInputStream input = new PipedInputStream();
   
               // start PHP producing results into the pipe
  -            PhpServlet php = new PhpServlet();
  +            PhpServlet php = new PhpServlet( getLogger() );
               php.init(new 
config((ServletContext)this.objectModel.get(HttpEnvironment.HTTP_SERVLET_CONTEXT)));
               php.setInput(systemId.substring(6));
               php.setOutput(new PipedOutputStream(input));
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to