cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1204450 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/ fr...
Date Mon, 21 Nov 2011 11:27:12 GMT
Author: aadamchik
Date: Mon Nov 21 11:27:11 2011
New Revision: 1204450

URL: http://svn.apache.org/viewvc?rev=1204450&view=rev
Log:
CAY-1642 [PATCH] add ability to customize connection "timeout" setting for ROP

patch by John Huss

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/ClientModule.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/HessianConnectionProvider.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/BaseConnection.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/HessianConnection.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=1204450&r1=1204449&r2=1204450&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Mon Nov 21 11:27:11 2011
@@ -19,6 +19,7 @@ CAY-1618 Create database adapters instan
 CAY-1637 [PATCH] DataContextFactory is cumbersome to customize
 CAY-1638 [PATCH] Can't disable validation for CayenneContext
 CAY-1639 cayenne-lifecycle: don't call String representation of ObjectId a UUID
+CAY-1642 [PATCH] add ability to customize connection "timeout" setting for ROP
 
 Bug Fixes Since 3.1M3:
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/ClientModule.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/ClientModule.java?rev=1204450&r1=1204449&r2=1204450&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/ClientModule.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/ClientModule.java
Mon Nov 21 11:27:11 2011
@@ -43,6 +43,7 @@ public class ClientModule implements Mod
     public static final String ROP_SERVICE_USER_NAME = "cayenne.config.rop.service.username";
     public static final String ROP_SERVICE_PASSWORD = "cayenne.config.rop.service.password";
     public static final String ROP_SERVICE_SHARED_SESSION = "cayenne.config.rop.service.shared_session";
+    public static final String ROP_SERVICE_TIMEOUT = "cayenne.config.rop.service.timeout";
 
     public static final String CHANNEL_EVENTS = "cayenne.config.rop.client.channel.events";
     

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/HessianConnectionProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/HessianConnectionProvider.java?rev=1204450&r1=1204449&r2=1204450&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/HessianConnectionProvider.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/HessianConnectionProvider.java
Mon Nov 21 11:27:11 2011
@@ -44,7 +44,15 @@ public class HessianConnectionProvider i
         String password = runtimeProperties.get(ClientModule.ROP_SERVICE_PASSWORD);
         String sharedSession = runtimeProperties
                 .get(ClientModule.ROP_SERVICE_SHARED_SESSION);
+        String readTimeoutStr = runtimeProperties
+                .get(ClientModule.ROP_SERVICE_TIMEOUT);
+        
+        HessianConnection result = new HessianConnection(url, userName, password, sharedSession);
+        
+        if (readTimeoutStr != null && readTimeoutStr.length() != 0) {
+            result.setReadTimeout(Long.parseLong(readTimeoutStr));
+        }
 
-        return new HessianConnection(url, userName, password, sharedSession);
+        return result;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/BaseConnection.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/BaseConnection.java?rev=1204450&r1=1204449&r2=1204450&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/BaseConnection.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/BaseConnection.java
Mon Nov 21 11:27:11 2011
@@ -33,7 +33,8 @@ public abstract class BaseConnection imp
 
     protected Log logger;
     protected long messageId;
-
+    protected long readTimeout = 0L;
+    
     /**
      * Default constructor that initializes logging and a single threaded EventManager.
      */
@@ -112,6 +113,26 @@ public abstract class BaseConnection imp
     }
 
     /**
+     * The socket timeout on requests in milliseconds. Defaults to infinity.
+     * 
+     * @since 3.1
+     */
+    public long getReadTimeout() {
+        return readTimeout;
+    }
+    
+    /**
+     * Sets the socket timeout.
+     * 
+     * @param readTimeout The socket timeout on requests in milliseconds.
+     * 
+     * @since 3.1
+     */
+    public void setReadTimeout(long readTimeout) {
+        this.readTimeout = readTimeout;
+    }
+    
+    /**
      * Called before logging the beginning of message processing.
      */
     protected abstract void beforeSendMessage(ClientMessage message)

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/HessianConnection.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/HessianConnection.java?rev=1204450&r1=1204449&r2=1204450&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/HessianConnection.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/HessianConnection.java
Mon Nov 21 11:27:11 2011
@@ -196,6 +196,7 @@ public class HessianConnection extends B
                 null));
         factory.setUser(userName);
         factory.setPassword(password);
+        factory.setReadTimeout(getReadTimeout());
         try {
             this.service = (RemoteService) factory.create(RemoteService.class, url);
         }



Mime
View raw message