tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1488877 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/tribes/transport/ java/org/apache/catalina/tribes/transport/bio/ java/org/apache/catalina/tribes/transport/nio/ webapps/docs/ webapps/docs/config/
Date Mon, 03 Jun 2013 07:45:01 GMT
Author: kfujino
Date: Mon Jun  3 07:45:00 2013
New Revision: 1488877

URL: http://svn.apache.org/r1488877
Log:
Merge r1488871 and r1488876.
-Add maxWait attribute that the senderPool will wait when there are no available senders.
-Improve error message by including specified timeout if failed to retrieve a data  sender.


Modified:
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/PooledSender.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/bio/PooledMultiSender.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/nio/PooledParallelSender.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
    tomcat/tc7.0.x/trunk/webapps/docs/config/cluster-sender.xml

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/PooledSender.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/PooledSender.java?rev=1488877&r1=1488876&r2=1488877&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/PooledSender.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/PooledSender.java Mon Jun
 3 07:45:00 2013
@@ -42,6 +42,7 @@ public abstract class PooledSender exten
     
     private SenderQueue queue = null;
     private int poolSize = 25;
+    private long maxWait = 3000;
     public PooledSender() {
         queue = new SenderQueue(this,poolSize);
     }
@@ -49,7 +50,7 @@ public abstract class PooledSender exten
     public abstract DataSender getNewDataSender();
     
     public DataSender getSender() {
-        return queue.getSender(getTimeout());
+        return queue.getSender(getMaxWait());
     }
     
     public void returnSender(DataSender sender) {
@@ -89,6 +90,14 @@ public abstract class PooledSender exten
         return poolSize;
     }
 
+    public long getMaxWait() {
+        return maxWait;
+    }
+
+    public void setMaxWait(long maxWait) {
+        this.maxWait = maxWait;
+    }
+
     @Override
     public boolean keepalive() {
         //do nothing, the pool checks on every return

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/bio/PooledMultiSender.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/bio/PooledMultiSender.java?rev=1488877&r1=1488876&r2=1488877&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/bio/PooledMultiSender.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/bio/PooledMultiSender.java
Mon Jun  3 07:45:00 2013
@@ -47,7 +47,7 @@ public class PooledMultiSender extends P
         try {
             sender = (MultiPointSender)getSender();
             if (sender == null) {
-                ChannelException cx = new ChannelException("Unable to retrieve a data sender,
time out error.");
+                ChannelException cx = new ChannelException("Unable to retrieve a data sender,
time out("+getMaxWait()+" ms) error.");
                 for (int i = 0; i < destination.length; i++) cx.addFaultyMember(destination[i],
new NullPointerException("Unable to retrieve a sender from the sender pool"));
                 throw cx;
             } else {

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/nio/PooledParallelSender.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/nio/PooledParallelSender.java?rev=1488877&r1=1488876&r2=1488877&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/nio/PooledParallelSender.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/transport/nio/PooledParallelSender.java
Mon Jun  3 07:45:00 2013
@@ -46,7 +46,7 @@ public class PooledParallelSender extend
         if ( !connected ) throw new ChannelException("Sender not connected.");
         ParallelNioSender sender = (ParallelNioSender)getSender();
         if (sender == null) {
-            ChannelException cx = new ChannelException("Unable to retrieve a data sender,
time out error.");
+            ChannelException cx = new ChannelException("Unable to retrieve a data sender,
time out("+getMaxWait()+" ms) error.");
             for (int i = 0; i < destination.length; i++) cx.addFaultyMember(destination[i],
new NullPointerException("Unable to retrieve a sender from the sender pool"));
             throw cx;
         } else {

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1488877&r1=1488876&r2=1488877&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Mon Jun  3 07:45:00 2013
@@ -153,6 +153,14 @@
         cluster instance from container on every request, use instance variable.
         (kfujino)
       </scode>
+      <add>
+        Add <code>maxWait</code> attribute that the senderPool will wait when
+        there are no available senders. (kfujino)
+      </add>
+      <add>
+        Improve error message by including specified timeout if failed to
+        retrieve a data sender. (kfujino)
+      </add>
     </changelog>
   </subsection>
   <subsection name="Web applications">

Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/cluster-sender.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/cluster-sender.xml?rev=1488877&r1=1488876&r2=1488877&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/config/cluster-sender.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/cluster-sender.xml Mon Jun  3 07:45:00 2013
@@ -162,14 +162,18 @@
       </attribute>
     </attributes>
   </subsection>
-  <subsection name="PooledParallelSender Attributes">
+  <subsection name="Common PooledSender Attributes">
     <attributes>
       <attribute name="poolSize" required="false">
         The maximum number of concurrent connections from A to B.
         The value is based on a per-destination count.
         The default value is <code>25</code>
       </attribute>
-
+      <attribute name="maxWait" required="false">
+        The maximum number of milliseconds that the senderPool will wait when
+        there are no available senders. The default value is <code>3000</code>
+        milliseconds.(3 seconds).
+      </attribute>
     </attributes>
   </subsection>
 </section>



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


Mime
View raw message