cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11Protocol.java LocalStrings.properties

2004-02-20 Thread remm
remm2004/02/20 03:03:28

  Modified:http11/src/java/org/apache/coyote/http11 Http11Protocol.java
LocalStrings.properties
  Log:
  - Add some i18n strings.
  - Encode the address in the protocol name, to fix bug 27033.
  
  Revision  ChangesPath
  1.51  +25 -13
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Protocol.java
  
  Index: Http11Protocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Protocol.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- Http11Protocol.java   5 Feb 2004 16:22:40 -   1.50
  +++ Http11Protocol.java   20 Feb 2004 11:03:28 -  1.51
  @@ -63,6 +63,7 @@
   import java.io.OutputStream;
   import java.net.InetAddress;
   import java.net.Socket;
  +import java.net.URLEncoder;
   import java.util.Enumeration;
   import java.util.Hashtable;
   
  @@ -186,7 +187,7 @@
   log.error(sm.getString(http11protocol.endpoint.initerror), ex);
   throw ex;
   }
  -log.info(sm.getString(http11protocol.init,  + ep.getPort()));
  +log.info(sm.getString(http11protocol.init, getName()));
   
   }
   
  @@ -198,18 +199,18 @@
   try {
   // XXX We should be able to configure it separately
   // XXX It should be possible to use a single TP
  -tpOname=new ObjectName(domain + : + type=ThreadPool,name=http + 
ep.getPort());
  +tpOname=new ObjectName
  +(domain + : + type=ThreadPool,name= + getName());
   Registry.getRegistry(null, null)
   .registerComponent(tp, tpOname, null );
  -tp.setName(http + ep.getPort());
  +tp.setName(getName());
   tp.setDaemon(false);
   tp.addThreadPoolListener(new MXPoolListener(this, tp));
   } catch (Exception e) {
   log.error(Can't register threadpool );
   }
  -rgOname=new ObjectName( domain + 
  -:type=GlobalRequestProcessor,name=http +
  -ep.getPort());
  +rgOname=new ObjectName
  +(domain + :type=GlobalRequestProcessor,name= + getName());
   Registry.getRegistry(null, null).registerComponent
   ( cHandler.global, rgOname, null );
   }
  @@ -220,7 +221,7 @@
   log.error(sm.getString(http11protocol.endpoint.starterror), ex);
   throw ex;
   }
  -log.info(sm.getString(http11protocol.start,  + ep.getPort()));
  +log.info(sm.getString(http11protocol.start, getName()));
   }
   
   public void pause() throws Exception {
  @@ -230,7 +231,7 @@
   log.error(sm.getString(http11protocol.endpoint.pauseerror), ex);
   throw ex;
   }
  -log.info(sm.getString(http11protocol.pause,  + ep.getPort()));
  +log.info(sm.getString(http11protocol.pause, getName()));
   }
   
   public void resume() throws Exception {
  @@ -240,11 +241,11 @@
   log.error(sm.getString(http11protocol.endpoint.resumeerror), ex);
   throw ex;
   }
  -log.info(sm.getString(http11protocol.resume,  + ep.getPort()));
  +log.info(sm.getString(http11protocol.resume, getName()));
   }
   
   public void destroy() throws Exception {
  -log.info(Stoping http11 protocol on  + ep.getPort() +   + tpOname);
  +log.info(sm.getString(http11protocol.stop, getName()));
   ep.stopEndpoint();
   if( tpOname!=null ) 
   Registry.getRegistry(null, null).unregisterComponent(tpOname);
  @@ -352,6 +353,17 @@
   setAttribute(address,  + ia);
   }
   
  +public String getName() {
  +String encodedAddr = ;
  +if (getAddress() != null) {
  +encodedAddr =  + getAddress();
  +if (encodedAddr.startsWith(/))
  +encodedAddr = encodedAddr.substring(1);
  +encodedAddr = URLEncoder.encode(encodedAddr) + -;
  +}
  +return (http- + encodedAddr + ep.getPort());
  +}
  +
   // commenting out for now since it's not doing anything
   //public void setHostName( String name ) {
   // ??? Doesn't seem to be used in existing or prev code
  @@ -691,9 +703,9 @@
   try {
   RequestInfo rp=processor.getRequest().getRequestProcessor();
   rp.setGlobalProcessor(global);
  -ObjectName rpName=new ObjectName(proto.getDomain() + 
  -:type=RequestProcessor,worker=http +
  -proto.ep.getPort() +,name=HttpRequest + count++ );
  +

cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11Protocol.java LocalStrings.properties

2003-08-29 Thread amyroh
amyroh  2003/08/28 19:34:47

  Modified:http11/src/java/org/apache/coyote/http11 Http11Protocol.java
LocalStrings.properties
  Log:
  Implement getAttribute(key).
  
  Revision  ChangesPath
  1.34  +3 -1  
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Protocol.java
  
  Index: Http11Protocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Protocol.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- Http11Protocol.java   11 Aug 2003 21:44:49 -  1.33
  +++ Http11Protocol.java   29 Aug 2003 02:34:47 -  1.34
  @@ -115,7 +115,9 @@
   }
   
   public Object getAttribute( String key ) {
  -return null;
  +if( log.isTraceEnabled())
  +log.trace(sm.getString(http11protocol.getattribute, key));
  +return attributes.get(key);
   }
   
   /**
  
  
  
  1.6   +2 -1  
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/LocalStrings.properties,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LocalStrings.properties   5 Nov 2002 09:37:34 -   1.5
  +++ LocalStrings.properties   29 Aug 2003 02:34:47 -  1.6
  @@ -16,6 +16,7 @@
   http11protocol.proto.ioexception.info=IOException reading request, ignored
   http11protocol.proto.socketexception.debug=SocketException reading request
   http11protocol.proto.socketexception.info=SocketException reading request, ignored
  +http11protocol.getattribute=Attribute {0}
   http11protocol.setattribute=Attribute {0}: {1}
   http11protocol.socketfactory.initerror=Error initializing socket factory
   http11protocol.start=Starting Coyote HTTP/1.1 on port {0}
  
  
  

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



cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11Protocol.java LocalStrings.properties

2002-05-16 Thread remm

remm02/05/16 12:25:41

  Modified:http11/src/java/org/apache/coyote/http11 Http11Protocol.java
LocalStrings.properties
  Log:
  - Do the i18n for the HTTP/1.1 protocol handler.
  
  Revision  ChangesPath
  1.13  +25 -11
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Protocol.java
  
  Index: Http11Protocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Protocol.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Http11Protocol.java   16 May 2002 18:57:39 -  1.12
  +++ Http11Protocol.java   16 May 2002 19:25:41 -  1.13
  @@ -85,6 +85,13 @@
*/
   public class Http11Protocol implements ProtocolHandler
   {
  +
  +/**
  + * The string manager for this package.
  + */
  +protected static StringManager sm =
  +StringManager.getManager(Constants.Package);
  +
   Adapter adapter;
   Http11ConnectionHandler cHandler=new Http11ConnectionHandler( this );
   
  @@ -92,7 +99,7 @@
*/
   public void setAttribute( String name, Object value ) {
   
  -log.info(setAttribute  + name +   + value );
  +log.info(sm.getString(http11protocol.setattribute, name, value));
   attributes.put(name, value);
   /*
   if (maxKeepAliveRequests.equals(name)) {
  @@ -125,7 +132,8 @@
try {
   checkSocketFactory();
   } catch( Exception ex ) {
  -log.error( Error initializing socket factory, ex );
  +log.error(sm.getString(http11protocol.socketfactory.initerror), 
  +  ex);
   throw ex;
   }
   
  @@ -141,10 +149,10 @@
   try {
   ep.initEndpoint();
   } catch (Exception ex) {
  -log.error(Error initializing endpoint, ex);
  +log.error(sm.getString(http11protocol.endpoint.initerror), ex);
   throw ex;
   }
  -log.info( Init on  + ep.getPort() );
  +log.info(sm.getString(http11protocol.init,  + ep.getPort()));
   
   }
   
  @@ -152,10 +160,10 @@
   try {
   ep.startEndpoint();
   } catch (Exception ex) {
  -log.error(Error starting endpoint, ex);
  +log.error(sm.getString(http11protocol.endpoint.starterror), ex);
   throw ex;
   }
  -log.info( Starting on  + ep.getPort() );
  +log.info(sm.getString(http11protocol.start,  + ep.getPort()));
   }
   
   public void destroy() throws Exception {
  @@ -382,12 +390,18 @@
   TcpConnection.shutdownInput( socket );
   } catch(java.net.SocketException e) {
   // SocketExceptions are normal
  -proto.log.info( SocketException reading request, ignored);
  -proto.log.debug( SocketException reading request:, e);
  +proto.log.info(sm.getString
  +   (http11protocol.proto.socketexception.info));
  +proto.log.debug
  +(sm.getString
  + (http11protocol.proto.socketexception.debug), e);
   } catch (java.io.IOException e) {
   // IOExceptions are normal 
  -proto.log.info( IOException reading request, ignored);
  -proto.log.debug( IOException reading request:, e);
  +proto.log.info(sm.getString
  +   (http11protocol.proto.ioexception.info));
  +proto.log.debug
  +(sm.getString
  + (http11protocol.proto.ioexception.debug), e);
   }
   // Future developers: if you discover any other
   // rare-but-nonfatal exceptions, catch them here, and log as
  @@ -396,7 +410,7 @@
   // any other exception or error is odd. Here we log it
   // with ERROR level, so it will show up even on
   // less-than-verbose logs.
  -proto.log.error( Error reading request, ignored, e);
  +proto.log.error(sm.getString(http11protocol.proto.error), e);
   } finally {
   //   if(proto.adapter != null) proto.adapter.recycle();
   //processor.recycle();
  
  
  
  1.3   +13 -1 
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/LocalStrings.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LocalStrings.properties   18 Apr 2002 18:16:01 -  1.2