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

Ron Sigal ron_sigal at yahoo.com
Wed Aug 22 23:08:53 EDT 2007


  User: rsigal  
  Date: 07/08/22 23:08:53

  Modified:    src/main/org/jboss/remoting/transport/http  Tag:
                        remoting_2_2_0_GA HTTPClientInvoker.java
  Log:
  JBREM-754, JBREM-791: Merged changes from branch remoting_2_2_2_experimental.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.31.2.3.4.3 +7 -9      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.3.4.2
  retrieving revision 1.31.2.3.4.3
  diff -u -b -r1.31.2.3.4.2 -r1.31.2.3.4.3
  --- HTTPClientInvoker.java	15 Aug 2007 06:12:01 -0000	1.31.2.3.4.2
  +++ HTTPClientInvoker.java	23 Aug 2007 03:08:53 -0000	1.31.2.3.4.3
  @@ -130,7 +130,7 @@
         
         int simulatedTimeout = getSimulatedTimeout(configuration, metadata, conn);
         
  -      if (simulatedTimeout < 0)
  +      if (simulatedTimeout <= 0)
         {
            return useHttpURLConnection(conn, invocation, metadata, marshaller, unmarshaller);
         }
  @@ -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)
            {
  @@ -519,7 +520,6 @@
   
      private int getSimulatedTimeout(Map configuration, Map metadata, HttpURLConnection conn)
      {
  -      int simulatedTimeout = -1;
         int timeout = -1;
         String connectionTimeout = (String) configuration.get("timeout");
         String invocationTimeout = (String) metadata.get("timeout");
  @@ -549,7 +549,7 @@
         }
         
         if (timeout < 0)
  -         return -1;
  +         timeout = 0;
   
         /**
          * Since URLConnection in jdk 1.4 does NOT have a setConnectTimeout() method and
  @@ -562,26 +562,24 @@
            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)
         {
  -         simulatedTimeout = timeout;
            log.debug("Using older JDK (prior to 1.5): will simulate timeout");
         }
         catch (IllegalAccessException e)
         {
  -         simulatedTimeout = timeout;
            log.error("Error setting http client connection timeout.");
            log.debug(e);
         }
         catch (InvocationTargetException e)
         {
  -         simulatedTimeout = timeout;
            log.error("Error setting http client connection timeout.");
            log.debug(e);
         }
         
  -      return simulatedTimeout;
  +      return timeout;
      }
   
      protected String validateURL(String url)
  
  
  



More information about the jboss-cvs-commits mailing list