You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2012/04/24 20:42:14 UTC

svn commit: r1329923 - /cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java

Author: dkulp
Date: Tue Apr 24 18:42:14 2012
New Revision: 1329923

URL: http://svn.apache.org/viewvc?rev=1329923&view=rev
Log:
Merged revisions 1328463 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1328463 | ay | 2012-04-20 13:49:09 -0400 (Fri, 20 Apr 2012) | 2 lines

  [CXF-4257] Should catch RejectedExecutionException in WS-Addr's rebaseResponse

........

Modified:
    cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java

Modified: cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=1329923&r1=1329922&r2=1329923&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java (original)
+++ cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java Tue Apr 24 18:42:14 2012
@@ -26,6 +26,7 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.Executor;
+import java.util.concurrent.RejectedExecutionException;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -475,12 +476,26 @@ public final class ContextUtils {
                             // pause dispatch on current thread ...
                             inMessage.getInterceptorChain().pause();
 
-                            // ... and resume on executor thread
-                            getExecutor(inMessage).execute(new Runnable() {
-                                public void run() {
+
+                            try {
+                                // ... and resume on executor thread
+                                getExecutor(inMessage).execute(new Runnable() {
+                                        public void run() {
+                                            inMessage.getInterceptorChain().resume();
+                                        }
+                                    });
+                            } catch (RejectedExecutionException e) {
+                                LOG.warning(
+                                            "Executor queue is full, use the caller thread." 
+                                            + "  Users can specify a larger executor queue to avoid this.");
+                                // only block the thread if the prop is unset or set to false, otherwise let it go
+                                if (!MessageUtils.isTrue(
+                                    inMessage.getContextualProperty(
+                                        "org.apache.cxf.oneway.rejected_execution_exception"))) {
+                                    //the executor queue is full, so run the task in the caller thread
                                     inMessage.getInterceptorChain().resume();
                                 }
-                            });
+                            }
                         }
                     }
                 }



Re: svn commit: r1329923 - /cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java

Posted by Richard Opalka <ro...@redhat.com>.
I'm facing the same checkstyle error too.

My configuration is:

[/home/opalka]>mvn -version
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /home/opalka/java/maven/3.0.3
Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.3.6-3.fc16.x86_64", arch: "amd64", family: 
"unix"

Rio

On 05/22/2012 06:13 PM, Daniel Kulp wrote:
> Interesting... I'm not seeing a checkstyle failure it with Java 7 or in
> Eclipse either.   (using Maven 3.0.4 though)  Honestly, not sure what would
> cause the difference.   Bizarre.   Feel free to fix though.  Someone else
> may run into it.
>
> Dan
>
>
> On Tuesday, May 22, 2012 03:44:05 PM Willem Jiang wrote:
>> I tried to run full test on my box. JDK 1.6 with Maven 3.0.3.
>> I got the a check style error
>> cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addres
>> sing/ContextUtils.java:492:33: Nested if-else depth is 4 (max allowed is
>> 3).
>> Audit done.
>>
>> I checked the CI it doesn't have this error report.  It looks like JDK
>> 1.5 doesn't show this kind of error.
>> I just committed a work around[1] before we decide to change the check
>> style configuration file.
>>
>> [1]http://svn.apache.org/viewvc?rev=1341332&view=rev
>>
>> On Wed Apr 25 02:42:14 2012, dkulp@apache.org wrote:

-- 
Richard Opalka
JBoss, by Red Hat
Cell: +420 731 186 942


Re: svn commit: r1329923 - /cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java

Posted by Daniel Kulp <dk...@apache.org>.
Interesting... I'm not seeing a checkstyle failure it with Java 7 or in 
Eclipse either.   (using Maven 3.0.4 though)  Honestly, not sure what would 
cause the difference.   Bizarre.   Feel free to fix though.  Someone else 
may run into it.

Dan


On Tuesday, May 22, 2012 03:44:05 PM Willem Jiang wrote:
> I tried to run full test on my box. JDK 1.6 with Maven 3.0.3.
> I got the a check style error
> cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addres
> sing/ContextUtils.java:492:33: Nested if-else depth is 4 (max allowed is
> 3).
> Audit done.
> 
> I checked the CI it doesn't have this error report.  It looks like JDK
> 1.5 doesn't show this kind of error.
> I just committed a work around[1] before we decide to change the check
> style configuration file.
> 
> [1]http://svn.apache.org/viewvc?rev=1341332&view=rev
> 
> On Wed Apr 25 02:42:14 2012, dkulp@apache.org wrote:

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: svn commit: r1329923 - /cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java

Posted by Willem Jiang <wi...@gmail.com>.
I tried to run full test on my box. JDK 1.6 with Maven 3.0.3.
I got the a check style error
cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java:492:33: 
Nested if-else depth is 4 (max allowed is 3).
Audit done.

I checked the CI it doesn't have this error report.  It looks like JDK 
1.5 doesn't show this kind of error.
I just committed a work around[1] before we decide to change the check 
style configuration file.

[1]http://svn.apache.org/viewvc?rev=1341332&view=rev

On Wed Apr 25 02:42:14 2012, dkulp@apache.org wrote:
> Author: dkulp
> Date: Tue Apr 24 18:42:14 2012
> New Revision: 1329923
>
> URL: http://svn.apache.org/viewvc?rev=1329923&view=rev
> Log:
> Merged revisions 1328463 via  git cherry-pick from
> https://svn.apache.org/repos/asf/cxf/trunk
>
> ........
>    r1328463 | ay | 2012-04-20 13:49:09 -0400 (Fri, 20 Apr 2012) | 2 lines
>
>    [CXF-4257] Should catch RejectedExecutionException in WS-Addr's rebaseResponse
>
> ........
>
> Modified:
>      cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
>
> Modified: cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
> URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=1329923&r1=1329922&r2=1329923&view=diff
> ==============================================================================
> --- cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java (original)
> +++ cxf/branches/2.5.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java Tue Apr 24 18:42:14 2012
> @@ -26,6 +26,7 @@ import java.util.HashSet;
>   import java.util.Set;
>   import java.util.UUID;
>   import java.util.concurrent.Executor;
> +import java.util.concurrent.RejectedExecutionException;
>   import java.util.logging.Level;
>   import java.util.logging.Logger;
>
> @@ -475,12 +476,26 @@ public final class ContextUtils {
>                               // pause dispatch on current thread ...
>                               inMessage.getInterceptorChain().pause();
>
> -                            // ... and resume on executor thread
> -                            getExecutor(inMessage).execute(new Runnable() {
> -                                public void run() {
> +
> +                            try {
> +                                // ... and resume on executor thread
> +                                getExecutor(inMessage).execute(new Runnable() {
> +                                        public void run() {
> +                                            inMessage.getInterceptorChain().resume();
> +                                        }
> +                                    });
> +                            } catch (RejectedExecutionException e) {
> +                                LOG.warning(
> +                                            "Executor queue is full, use the caller thread."
> +                                            + "  Users can specify a larger executor queue to avoid this.");
> +                                // only block the thread if the prop is unset or set to false, otherwise let it go
> +                                if (!MessageUtils.isTrue(
> +                                    inMessage.getContextualProperty(
> +                                        "org.apache.cxf.oneway.rejected_execution_exception"))) {
> +                                    //the executor queue is full, so run the task in the caller thread
>                                       inMessage.getInterceptorChain().resume();
>                                   }
> -                            });
> +                            }
>                           }
>                       }
>                   }
>
>
>


-- 
Willem
----------------------------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang