cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp LocalStrings.properties AjpAprProtocol.java

2005-08-01 Thread remm
remm2005/08/01 03:00:59

  Modified:jk/java/org/apache/coyote/ajp LocalStrings.properties
AjpAprProtocol.java
  Log:
  - Internationalization and code cleanups.
  - No functional change.
  
  Revision  ChangesPath
  1.5   +2 -1  
jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp/LocalStrings.properties,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LocalStrings.properties   1 Aug 2005 09:40:14 -   1.4
  +++ LocalStrings.properties   1 Aug 2005 10:00:59 -   1.5
  @@ -22,6 +22,7 @@
   ajpprotocol.endpoint.resumeerror=Error resuming endpoint
   ajpprotocol.failedread=Socket read failed
   ajpprotocol.failedwrite=Socket write failed
  +ajpprotocol.request.register=Error registering request processor in JMX
   
   ajpprocessor.header.error=Header message parsing failed
   ajpprocessor.request.prepare=Error preparing request
  
  
  
  1.7   +145 -86   
jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp/AjpAprProtocol.java
  
  Index: AjpAprProtocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp/AjpAprProtocol.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AjpAprProtocol.java   26 Jul 2005 16:13:33 -  1.6
  +++ AjpAprProtocol.java   1 Aug 2005 10:00:59 -   1.7
  @@ -45,41 +45,98 @@
* @author Remy Maucherat
* @author Costin Manolache
*/
  -public class AjpAprProtocol implements ProtocolHandler, MBeanRegistration
  -{
  +public class AjpAprProtocol 
  +implements ProtocolHandler, MBeanRegistration {
  +
  +
  +protected static org.apache.commons.logging.Log log =
  +org.apache.commons.logging.LogFactory.getLog(AjpAprProtocol.class);
  +
  +/**
  + * The string manager for this package.
  + */
  +protected static StringManager sm =
  +StringManager.getManager(Constants.Package);
  +
  +
  +//  
Constructor
  +
  +
   public AjpAprProtocol() {
  -cHandler = new AjpConnectionHandler( this );
  +cHandler = new AjpConnectionHandler(this);
   setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
   setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
   //setServerSoTimeout(Constants.DEFAULT_SERVER_SOCKET_TIMEOUT);
   setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
   }
   
  +
  +// - Instance 
Variables
  +
  +
  +protected ObjectName tpOname;
  +
  +
  +protected ObjectName rgOname;
  +
  +
   /**
  - * The string manager for this package.
  + * Associated APR endpoint.
*/
  -protected static StringManager sm =
  -StringManager.getManager(Constants.Package);
  +protected AprEndpoint ep = new AprEndpoint();
   
  -/** Pass config info
  +
  +/**
  + * Configuration attributes.
*/
  -public void setAttribute( String name, Object value ) {
  -if( log.isTraceEnabled())
  -log.trace(sm.getString(ajpprotocol.setattribute, name, value));
  +protected Hashtable attributes = new Hashtable();
  +
  +
  +/**
  + * Should authentication be done in the native webserver layer, 
  + * or in the Servlet container ?
  + */
  +protected boolean tomcatAuthentication = true;
  +
   
  +/**
  + * Adapter which will process the requests recieved by this endpoint.
  + */
  +private Adapter adapter;
  +
  +
  +/**
  + * Connection handler for AJP.
  + */
  +private AjpConnectionHandler cHandler;
  +
  +
  +// - Public 
Methods
  +
  +
  +/** 
  + * Pass config info
  + */
  +public void setAttribute(String name, Object value) {
  +if (log.isTraceEnabled()) {
  +log.trace(sm.getString(ajpprotocol.setattribute, name, value));
  +}
   attributes.put(name, value);
   }
   
  -public Object getAttribute( String key ) {
  -if( log.isTraceEnabled())
  +public Object getAttribute(String key) {
  +if (log.isTraceEnabled()) {
   log.trace(sm.getString(ajpprotocol.getattribute, key));
  +}
   return attributes.get(key);
   }
   
  +
   public Iterator getAttributeNames() {
   return attributes.keySet().iterator();
   }
   
  +
   /**
* Set a property.
*/
  @@ -87,19 +144,23 @@
   setAttribute(name, value);
   }
   
  +
   /**
* Get a property

cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp AjpAprProtocol.java

2005-06-27 Thread remm
remm2005/06/27 06:44:04

  Modified:util/java/org/apache/tomcat/util/net AprEndpoint.java
   http11/src/java/org/apache/coyote/http11
Http11AprProtocol.java
   jk/java/org/apache/coyote/ajp AjpAprProtocol.java
  Log:
  - Expose some config attributes.
  
  Revision  ChangesPath
  1.51  +0 -12 
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java
  
  Index: AprEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- AprEndpoint.java  24 Jun 2005 13:14:28 -  1.50
  +++ AprEndpoint.java  27 Jun 2005 13:44:04 -  1.51
  @@ -314,18 +314,6 @@
   public Sendfile getSendfile() { return sendfile; }
   
   
  -/**
  - * Dummy maxSpareThreads property.
  - */
  -public int getMaxSpareThreads() { return 0; }
  -
  -
  -/**
  - * Dummy minSpareThreads property.
  - */
  -public int getMinSpareThreads() { return 0; }
  -
  -
   // - Public 
Methods
   
   
  
  
  
  1.11  +18 -0 
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java
  
  Index: Http11AprProtocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Http11AprProtocol.java17 Jun 2005 11:50:01 -  1.10
  +++ Http11AprProtocol.java27 Jun 2005 13:44:04 -  1.11
  @@ -296,6 +296,24 @@
   setAttribute(pollTime,  + i);
   }
   
  +public void setPollerSize(int i) {
  +ep.setPollerSize(i); 
  +setAttribute(pollerSize,  + i);
  +}
  +
  +public int getPollerSize() {
  +return ep.getPollerSize();
  +}
  +
  +public void setSendfileSize(int i) {
  +ep.setSendfileSize(i); 
  +setAttribute(sendfileSize,  + i);
  +}
  +
  +public int getSendfileSize() {
  +return ep.getSendfileSize();
  +}
  +
   public boolean getUseSendfile() {
   return ep.getUseSendfile();
   }
  
  
  
  1.5   +9 -0  
jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp/AjpAprProtocol.java
  
  Index: AjpAprProtocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp/AjpAprProtocol.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AjpAprProtocol.java   23 Jun 2005 11:45:29 -  1.4
  +++ AjpAprProtocol.java   27 Jun 2005 13:44:04 -  1.5
  @@ -326,6 +326,15 @@
   setAttribute(pollTime,  + i);
   }
   
  +public void setPollerSize(int i) {
  +ep.setPollerSize(i); 
  +setAttribute(pollerSize,  + i);
  +}
  +
  +public int getPollerSize() {
  +return ep.getPollerSize();
  +}
  +
   public int getMaxPostSize() {
   return maxPostSize;
   }
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp AjpAprProtocol.java

2005-06-23 Thread remm
remm2005/06/23 04:45:29

  Modified:jk/java/org/apache/coyote/ajp AjpAprProtocol.java
  Log:
  - Add new attributes.
  
  Revision  ChangesPath
  1.4   +14 -5 
jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp/AjpAprProtocol.java
  
  Index: AjpAprProtocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp/AjpAprProtocol.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AjpAprProtocol.java   17 Jun 2005 11:50:01 -  1.3
  +++ AjpAprProtocol.java   23 Jun 2005 11:45:29 -  1.4
  @@ -308,13 +308,22 @@
   socketBuffer = valueI;
   }
   
  -public String getCompression() {
  -return compression;
  +public int getFirstReadTimeout() {
  +return ep.getFirstReadTimeout();
   }
   
  -public void setCompression(String valueS) {
  -compression = valueS;
  -setAttribute(compression, valueS);
  +public void setFirstReadTimeout( int i ) {
  +ep.setFirstReadTimeout(i);
  +setAttribute(firstReadTimeout,  + i);
  +}
  +
  +public int getPollTime() {
  +return ep.getPollTime();
  +}
  +
  +public void setPollTime( int i ) {
  +ep.setPollTime(i);
  +setAttribute(pollTime,  + i);
   }
   
   public int getMaxPostSize() {
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp AjpAprProtocol.java

2005-06-17 Thread remm
remm2005/06/17 04:50:01

  Modified:http11/src/java/org/apache/coyote/http11
Http11AprProtocol.java
   jk/java/org/apache/coyote/ajp AjpAprProtocol.java
  Log:
  - Code cleanups (there will be quite a few of them in this class).
  
  Revision  ChangesPath
  1.10  +29 -48
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java
  
  Index: Http11AprProtocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Http11AprProtocol.java17 Jun 2005 09:43:35 -  1.9
  +++ Http11AprProtocol.java17 Jun 2005 11:50:01 -  1.10
  @@ -613,9 +613,6 @@
   }
   
   //   Connection handler 
  -public static final int THREAD_DATA_PROCESSOR=1;
  -public static final int THREAD_DATA_OBJECT_NAME=2;
  -
   
   static class Http11ConnectionHandler implements Handler {
   Http11AprProtocol proto;
  @@ -627,61 +624,45 @@
   this.proto=proto;
   }
   
  -public Object[] init() {
  -Object thData[]=new Object[3];
  -
  -Http11AprProcessor  processor =
  -new Http11AprProcessor(proto.maxHttpHeaderSize, proto.ep);
  -processor.setAdapter( proto.adapter );
  -processor.setMaxKeepAliveRequests( proto.maxKeepAliveRequests );
  -processor.setTimeout( proto.timeout );
  -processor.setDisableUploadTimeout( proto.disableUploadTimeout );
  -processor.setCompression( proto.compression );
  -processor.setCompressionMinSize( proto.compressionMinSize);
  -processor.setNoCompressionUserAgents( 
proto.noCompressionUserAgents);
  -processor.setCompressableMimeTypes( proto.compressableMimeTypes);
  -processor.setRestrictedUserAgents( proto.restrictedUserAgents);
  -processor.setSocketBuffer( proto.socketBuffer );
  -processor.setMaxSavePostSize( proto.maxSavePostSize );
  -processor.setServer( proto.server );
  -
  -thData[Http11AprProtocol.THREAD_DATA_PROCESSOR]=processor;
  -
  -if( proto.getDomain() != null ) {
  -try {
  -RequestInfo 
rp=processor.getRequest().getRequestProcessor();
  -rp.setGlobalProcessor(global);
  -ObjectName rpName=new ObjectName
  -(proto.getDomain() + :type=RequestProcessor,worker=
  - + proto.getName() +,name=HttpRequest + count++ );
  -Registry.getRegistry(null, null).registerComponent( rp, 
rpName, null);
  -thData[Http11AprProtocol.THREAD_DATA_OBJECT_NAME]=rpName;
  -} catch( Exception ex ) {
  -log.warn(Error registering request);
  -}
  -}
  -
  -return  thData;
  -}
  -
   public boolean process(long socket) {
  -Http11AprProcessor processor=null;
  +Http11AprProcessor processor = null;
   try {
  -// FIXME: It is also possible to use the TWA data, so keep 
init() [] for
  -// now to test which is more efficient
   processor = (Http11AprProcessor) localProcessor.get();
   if (processor == null) {
  -processor = (Http11AprProcessor) 
(init()[Http11AprProtocol.THREAD_DATA_PROCESSOR]);
  +processor =
  +new Http11AprProcessor(proto.maxHttpHeaderSize, 
proto.ep);
  +processor.setAdapter(proto.adapter);
  +
processor.setMaxKeepAliveRequests(proto.maxKeepAliveRequests);
  +processor.setTimeout(proto.timeout);
  +
processor.setDisableUploadTimeout(proto.disableUploadTimeout);
  +processor.setCompression(proto.compression);
  +
processor.setCompressionMinSize(proto.compressionMinSize);
  +
processor.setNoCompressionUserAgents(proto.noCompressionUserAgents);
  +
processor.setCompressableMimeTypes(proto.compressableMimeTypes);
  +
processor.setRestrictedUserAgents(proto.restrictedUserAgents);
  +processor.setSocketBuffer(proto.socketBuffer);
  +processor.setMaxSavePostSize(proto.maxSavePostSize);
  +processor.setServer(proto.server);
   localProcessor.set(processor);
  +if (proto.getDomain() != null) {
  +synchronized (this) {
  +try

Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp AjpAprProcessor.java Constants.java LocalStrings.properties AjpAprProtocol.java AjpMessage.java

2005-06-09 Thread Bill Barker


- Original Message - 
From: [EMAIL PROTECTED]

To: [EMAIL PROTECTED]
Sent: Thursday, June 09, 2005 9:14 AM
Subject: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp 
AjpAprProcessor.java Constants.java LocalStrings.properties 
AjpAprProtocol.java AjpMessage.java




remm2005/06/09 09:14:51

 Added:   jk/java/org/apache/coyote/ajp AjpAprProcessor.java
   Constants.java LocalStrings.properties
   AjpAprProtocol.java AjpMessage.java
 Log:
 - Add my WIP AJP implementation using APR. Performance sucks right now,
   and I think it has lots of bugs ;)
 - It won't be compiled in or used for now.



Yeah, it has a few bugs ;).  Would it mess you up if I were to fix some of 
the more glaring ones in the CVS copy?  I'm thinking mostly of the double 
call to endRequest, and the failure to clean up the Request body parameters. 
The handling of remote/localHost/Port is also wrong, but relatively 
harmless.  Also the lack of C2B handling on the Response headers is going to 
bite you someday, but for initial testing on a iso-8859-1 machine it's 
alright.





This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication 
in error, please notify us immediately by e-mail and then delete all copies of 
this message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through 
the Internet is not secure. Do not send confidential or sensitive information, 
such as social security numbers, account numbers, personal identification 
numbers and passwords, to us via ordinary (unencrypted) e-mail.


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



AjpAprProtocol.java

2005-05-26 Thread Tim Funk

Is there such a class as org.apache.coyote.ajp.AjpAprProtocol?

I see a reference in org.apache.catalina.connector.Connector to this class 
but nothing else.




-Tim

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



Re: AjpAprProtocol.java

2005-05-26 Thread Remy Maucherat

Tim Funk wrote:

Is there such a class as org.apache.coyote.ajp.AjpAprProtocol?


It's an APR version of AJP, not done yet.

Rémy

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