Author: markt
Date: Thu Sep 20 10:46:53 2012
New Revision: 1387959

URL: http://svn.apache.org/viewvc?rev=1387959&view=rev
Log:
Sync with trunk

Modified:
    tomcat/sandbox/trunk-resources/   (props changed)
    
tomcat/sandbox/trunk-resources/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
    tomcat/sandbox/trunk-resources/java/org/apache/coyote/AsyncStateMachine.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/collections/   
(props changed)
    
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallMethodRule.java
    
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallParamRule.java
    tomcat/sandbox/trunk-resources/res/findbugs/filter-false-positives.xml
    tomcat/sandbox/trunk-resources/webapps/docs/config/cluster-interceptor.xml

Propchange: tomcat/sandbox/trunk-resources/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1386495-1387958

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java?rev=1387959&r1=1387958&r2=1387959&view=diff
==============================================================================
--- 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
 Thu Sep 20 10:46:53 2012
@@ -65,7 +65,7 @@ public class TcpPingInterceptor extends 
     public synchronized void start(int svc) throws ChannelException {
         super.start(svc);
         running = true;
-        if ( thread == null ) {
+        if ( thread == null && useThread) {
             thread = new PingThread();
             thread.setDaemon(true);
             thread.setName("TcpPingInterceptor.PingThread-"+cnt.addAndGet(1));
@@ -87,8 +87,10 @@ public class TcpPingInterceptor extends 
     @Override
     public void stop(int svc) throws ChannelException {
         running = false;
-        if ( thread != null ) thread.interrupt();
-        thread = null;
+        if ( thread != null ) {
+            thread.interrupt();
+            thread = null;
+        }
         super.stop(svc);
     }
 

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/coyote/AsyncStateMachine.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/coyote/AsyncStateMachine.java?rev=1387959&r1=1387958&r2=1387959&view=diff
==============================================================================
--- 
tomcat/sandbox/trunk-resources/java/org/apache/coyote/AsyncStateMachine.java 
(original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/coyote/AsyncStateMachine.java 
Thu Sep 20 10:46:53 2012
@@ -101,7 +101,7 @@ public class AsyncStateMachine<S> {
         DISPATCHED(false, false, false),
         STARTING(true, true, false),
         STARTED(true, true, false),
-        MUST_COMPLETE(true, true, false),
+        MUST_COMPLETE(true, false, false),
         COMPLETING(true, false, false),
         TIMING_OUT(true, false, false),
         MUST_DISPATCH(true, true, true),

Propchange: 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/collections/
            ('bugtraq:append' removed)

Propchange: 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/collections/
            ('bugtraq:label' removed)

Propchange: 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/collections/
            ('bugtraq:message' removed)

Propchange: 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/collections/
            ('bugtraq:url' removed)

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallMethodRule.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallMethodRule.java?rev=1387959&r1=1387958&r2=1387959&view=diff
==============================================================================
--- 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallMethodRule.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallMethodRule.java
 Thu Sep 20 10:46:53 2012
@@ -108,7 +108,7 @@ public class CallMethodRule extends Rule
                 this.paramTypes[i] = String.class;
             }
         }
-
+        this.paramClassNames = null;
     }
 
     /**
@@ -193,8 +193,9 @@ public class CallMethodRule extends Rule
         if (paramTypes == null) {
             this.paramTypes = new Class[paramCount];
             for (int i = 0; i < this.paramTypes.length; i++) {
-                this.paramTypes[i] = "abc".getClass();
+                this.paramTypes[i] = String.class;
             }
+            this.paramClassNames = null;
         } else {
             // copy the parameter class names into an array
             // the classes will be loaded when the digester is set
@@ -261,7 +262,7 @@ public class CallMethodRule extends Rule
         if (paramTypes == null) {
             this.paramTypes = new Class[paramCount];
             for (int i = 0; i < this.paramTypes.length; i++) {
-                this.paramTypes[i] = "abc".getClass();
+                this.paramTypes[i] = String.class;
             }
         } else {
             this.paramTypes = new Class[paramTypes.length];
@@ -269,7 +270,7 @@ public class CallMethodRule extends Rule
                 this.paramTypes[i] = paramTypes[i];
             }
         }
-
+        this.paramClassNames = null;
     }
 
 
@@ -287,12 +288,12 @@ public class CallMethodRule extends Rule
      * top of the digester object stack. The default value of zero
      * means the target object is the one on top of the stack.
      */
-    protected int targetOffset = 0;
+    protected final int targetOffset;
 
     /**
      * The method name to call on the parent object.
      */
-    protected String methodName = null;
+    protected final String methodName;
 
 
     /**
@@ -300,7 +301,7 @@ public class CallMethodRule extends Rule
      * If this value is zero, a single parameter will be collected from the
      * body of this element.
      */
-    protected int paramCount = 0;
+    protected final int paramCount;
 
 
     /**
@@ -312,7 +313,7 @@ public class CallMethodRule extends Rule
      * The names of the classes of the parameters to be collected.
      * This attribute allows creation of the classes to be postponed until the 
digester is set.
      */
-    protected String paramClassNames[] = null;
+    protected final String paramClassNames[];
 
     /**
      * Should <code>MethodUtils.invokeExactMethod</code> be used for 
reflection.
@@ -419,6 +420,7 @@ public class CallMethodRule extends Rule
      * @param name the local name if the parser is namespace aware, or just
      *   the element name otherwise
      */
+    @SuppressWarnings("null") // parameters can't trigger NPE
     @Override
     public void end(String namespace, String name) throws Exception {
 
@@ -456,7 +458,7 @@ public class CallMethodRule extends Rule
             parameters[0] = bodyText;
             if (paramTypes.length == 0) {
                 paramTypes = new Class[1];
-                paramTypes[0] = "abc".getClass();
+                paramTypes[0] = String.class;
             }
 
         }

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallParamRule.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallParamRule.java?rev=1387959&r1=1387958&r2=1387959&view=diff
==============================================================================
--- 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallParamRule.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallParamRule.java
 Thu Sep 20 10:46:53 2012
@@ -51,9 +51,7 @@ public class CallParamRule extends Rule 
      * @param paramIndex The zero-relative parameter number
      */
     public CallParamRule(int paramIndex) {
-
         this(paramIndex, null);
-
     }
 
 
@@ -66,10 +64,7 @@ public class CallParamRule extends Rule 
      */
     public CallParamRule(int paramIndex,
                          String attributeName) {
-
-        this.paramIndex = paramIndex;
-        this.attributeName = attributeName;
-
+        this(attributeName, paramIndex, 0, false);
     }
 
 
@@ -80,10 +75,7 @@ public class CallParamRule extends Rule 
      * @param fromStack should this parameter be taken from the top of the 
stack?
      */
     public CallParamRule(int paramIndex, boolean fromStack) {
-
-        this.paramIndex = paramIndex;
-        this.fromStack = fromStack;
-
+        this(null, paramIndex, 0, fromStack);
     }
 
     /**
@@ -95,36 +87,42 @@ public class CallParamRule extends Rule 
      * The zeroth object is the top of the stack, 1 is the next object down 
and so on.
      */
     public CallParamRule(int paramIndex, int stackIndex) {
+        this(null, paramIndex, stackIndex, true);
+    }
 
+    private CallParamRule(String attributeName, int paramIndex, int stackIndex,
+            boolean fromStack) {
+        this.attributeName = attributeName;
         this.paramIndex = paramIndex;
-        this.fromStack = true;
         this.stackIndex = stackIndex;
+        this.fromStack = fromStack;
     }
 
+
     // ----------------------------------------------------- Instance Variables
 
 
     /**
      * The attribute from which to save the parameter value
      */
-    protected String attributeName = null;
+    protected final String attributeName;
 
 
     /**
      * The zero-relative index of the parameter we are saving.
      */
-    protected int paramIndex = 0;
+    protected final int paramIndex;
 
 
     /**
      * Is the parameter to be set from the stack?
      */
-    protected boolean fromStack = false;
+    protected final boolean fromStack;
 
     /**
      * The position of the object from the top of the stack
      */
-    protected int stackIndex = 0;
+    protected final int stackIndex;
 
     /**
      * Stack is used to allow nested body text to be processed.

Modified: tomcat/sandbox/trunk-resources/res/findbugs/filter-false-positives.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/res/findbugs/filter-false-positives.xml?rev=1387959&r1=1387958&r2=1387959&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/res/findbugs/filter-false-positives.xml 
(original)
+++ tomcat/sandbox/trunk-resources/res/findbugs/filter-false-positives.xml Thu 
Sep 20 10:46:53 2012
@@ -237,6 +237,12 @@
     <Bug code="ST" />
   </Match>
   <Match>
+    <!-- NPE is desired as it indicates an error condition -->
+    <Class name="org.apache.tomcat.util.digester.CallMethodRule"/>
+    <Method name="end"/>
+    <Bug code="NP" />
+  </Match>
+  <Match>
     <!-- Test really is for the same object rather than equality -->
     <Class name="org.apache.tomcat.util.digester.Digester"/>
     <Or>

Modified: 
tomcat/sandbox/trunk-resources/webapps/docs/config/cluster-interceptor.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/webapps/docs/config/cluster-interceptor.xml?rev=1387959&r1=1387958&r2=1387959&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/webapps/docs/config/cluster-interceptor.xml 
(original)
+++ tomcat/sandbox/trunk-resources/webapps/docs/config/cluster-interceptor.xml 
Thu Sep 20 10:46:53 2012
@@ -55,6 +55,7 @@
     
<li><code>org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor</code></li>
     
<li><code>org.apache.catalina.tribes.group.interceptors.FragmentationInterceptor</code></li>
     
<li><code>org.apache.catalina.tribes.group.interceptors.GzipInterceptor</code></li>
+    
<li><code>org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor</code></li>
    </ul>
  </p>
 </section>
@@ -143,6 +144,20 @@
    <attributes>
    </attributes>
   </subsection>
+  <subsection 
name="org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor 
Attributes">
+   <attributes>
+     <attribute name="interval" required="false">
+       If useThread == true, defines the interval of sending a ping message.
+       default is 1000 ms.
+     </attribute>
+     <attribute name="useThread" required="false">
+       Flag of whether to start a thread for sending a ping message.
+       If set to true, this interceptor will start a local thread for sending 
a ping message.
+       if set to false, channel heartbeat will send a ping message.
+       default is false.
+     </attribute>
+   </attributes>
+  </subsection>
   <subsection 
name="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor 
Attributes">
    <attributes>
      <attribute name="interval" required="false">



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

Reply via email to