[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/http ...

Ron Sigal ron_sigal at yahoo.com
Sat Jun 16 04:16:29 EDT 2007


  User: rsigal  
  Date: 07/06/16 04:16:29

  Modified:    src/main/org/jboss/remoting/transport/http  Tag:
                        remoting_2_x HTTPClientInvoker.java
  Log:
  JBREM-701, JBREM-754: (1) For jdk 1.4 per invocation timeouts, wrap timeout exception in CannotConnectException; (2) explictly set timeout to 0 if no timeout is specified.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.31.2.5  +4 -2      JBossRemoting/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HTTPClientInvoker.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java,v
  retrieving revision 1.31.2.4
  retrieving revision 1.31.2.5
  diff -u -b -r1.31.2.4 -r1.31.2.5
  --- HTTPClientInvoker.java	19 May 2007 02:38:24 -0000	1.31.2.4
  +++ HTTPClientInvoker.java	16 Jun 2007 08:16:29 -0000	1.31.2.5
  @@ -172,7 +172,8 @@
            if (result == null)
            {
               if (log.isDebugEnabled()) log.debug("invocation timed out");
  -            throw new SocketTimeoutException("timed out");
  +            Exception cause = new SocketTimeoutException("timed out");
  +            throw new CannotConnectException("Can not connect http client invoker.", cause);
            }
            else if (result instanceof IOException)
            {
  @@ -549,7 +550,7 @@
         }
         
         if (timeout < 0)
  -         return -1;
  +         timeout = 0;
   
         /**
          * Since URLConnection in jdk 1.4 does NOT have a setConnectTimeout() method and
  @@ -562,6 +563,7 @@
            setTimeoutMethod.invoke(conn, new Object[]{new Integer(timeout)});
            setTimeoutMethod = conn.getClass().getMethod("setReadTimeout", new Class[]{int.class});
            setTimeoutMethod.invoke(conn, new Object[]{new Integer(timeout)});
  +         return -1;
         }
         catch (NoSuchMethodException e)
         {
  
  
  



More information about the jboss-cvs-commits mailing list