You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by og...@apache.org on 2003/11/25 00:13:22 UTC

cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/server HttpRequestHandlerChain.java

oglueck     2003/11/24 15:13:22

  Modified:    httpclient/src/test/org/apache/commons/httpclient/server
                        Tag: HTTPCLIENT_2_0_BRANCH
                        HttpRequestHandlerChain.java
  Log:
  Making this class thread-safe as it is accessed from different threads.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.3   +8 -8      jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/server/Attic/HttpRequestHandlerChain.java
  
  Index: HttpRequestHandlerChain.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/server/Attic/HttpRequestHandlerChain.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- HttpRequestHandlerChain.java	24 Nov 2003 20:41:11 -0000	1.1.2.2
  +++ HttpRequestHandlerChain.java	24 Nov 2003 23:13:22 -0000	1.1.2.3
  @@ -84,22 +84,22 @@
       public HttpRequestHandlerChain() {
       }
       
  -    public void clear() {
  +    public synchronized void clear() {
           subhandlers.clear();
       }
  -    public void prependHandler(HttpRequestHandler handler) {
  +    public synchronized void prependHandler(HttpRequestHandler handler) {
           subhandlers.add(0,handler);
       }
  -    public void appendHandler(HttpRequestHandler handler) {
  +    public synchronized void appendHandler(HttpRequestHandler handler) {
           subhandlers.add(handler);
       }
   
  -    public boolean processRequest(SimpleHttpServerConnection conn)  throws IOException {
  +    public synchronized boolean processRequest(SimpleHttpServerConnection conn)  throws IOException {
           
           for(Iterator it=subhandlers.iterator();it.hasNext();) {
               HttpRequestHandler h = (HttpRequestHandler)it.next();
               boolean stop = h.processRequest(conn);
  -            if(stop) {
  +            if (stop) {
                   return true;
               }
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org