Index: C:/eclipse/workspace/JBoss 2.2.1.GA/src/main/java/org/jboss/cache/loader/TcpDelegatingCacheLoader.java =================================================================== --- C:/eclipse/workspace/JBoss 2.2.1.GA/src/main/java/org/jboss/cache/loader/TcpDelegatingCacheLoader.java (revision 7331) +++ C:/eclipse/workspace/JBoss 2.2.1.GA/src/main/java/org/jboss/cache/loader/TcpDelegatingCacheLoader.java (working copy) @@ -371,6 +371,7 @@ public void start() throws IOException { sock = new Socket(config.getHost(), config.getPort()); + sock.setSoTimeout(config.getReadTimeout()); out = new ObjectOutputStream(new BufferedOutputStream(sock.getOutputStream())); out.flush(); in = new ObjectInputStream(new BufferedInputStream(sock.getInputStream())); Index: C:/eclipse/workspace/JBoss 2.2.1.GA/src/main/java/org/jboss/cache/loader/TcpDelegatingCacheLoaderConfig.java =================================================================== --- C:/eclipse/workspace/JBoss 2.2.1.GA/src/main/java/org/jboss/cache/loader/TcpDelegatingCacheLoaderConfig.java (revision 7331) +++ C:/eclipse/workspace/JBoss 2.2.1.GA/src/main/java/org/jboss/cache/loader/TcpDelegatingCacheLoaderConfig.java (working copy) @@ -16,7 +16,8 @@ private int port = 7500; private int timeout = 5000; private int reconnectWaitTime = 500; - + private int readTimeout = 0; + public TcpDelegatingCacheLoaderConfig() { setClassName(TcpDelegatingCacheLoader.class.getName()); @@ -92,6 +93,21 @@ this.reconnectWaitTime = reconnectWaitTime; } + + public int getReadTimeout() + { + return readTimeout; + } + + public void setReadTimeout(int readTimeout) + { + testImmutability("readTimeout"); + this.readTimeout = readTimeout; + } + + + + @Override public void setProperties(Properties props) { @@ -118,6 +134,14 @@ { this.reconnectWaitTime = Integer.parseInt(s); } + + s = props.getProperty("readTimeout"); + if (s != null && s.length() > 0) + { + this.readTimeout = Integer.parseInt(s); + } + + } @Override @@ -128,7 +152,9 @@ TcpDelegatingCacheLoaderConfig other = (TcpDelegatingCacheLoaderConfig) obj; return Util.safeEquals(host, other.host) - && (port == other.port) && (timeout == other.timeout) && (reconnectWaitTime == other.reconnectWaitTime); + && (port == other.port) && (timeout == other.timeout) + && (reconnectWaitTime == other.reconnectWaitTime) + && (readTimeout == other.readTimeout); } return false; } @@ -141,6 +167,7 @@ result = 31 * result + port; result = 31 * result + timeout; result = 31 * result + reconnectWaitTime; + result = 31 * result + readTimeout; return result; }