You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2010/08/06 03:37:21 UTC

[jira] Commented: (CAMEL-3025) ProxyHelper bean proxy should unwrap "cause" from RuntimeCamelException if the cause's type is declared thrown by the proxied method

    [ https://issues.apache.org/activemq/browse/CAMEL-3025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61056#action_61056 ] 

Claus Ibsen commented on CAMEL-3025:
------------------------------------

See nabble
http://camel.465427.n5.nabble.com/propagate-bean-invocation-exception-back-to-remote-caller-tp2263584p2263584.html

> ProxyHelper bean proxy should unwrap "cause" from RuntimeCamelException if the cause's type is declared thrown by the proxied method
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3025
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3025
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: bean-integration
>            Reporter: Jim Newsham
>             Fix For: 2.5.0
>
>
> ProxyHelper allows one to create a local proxy which invokes a method call on a remote bean by marshalling the request into a message object, sending the message, waiting for the result, unmarshalling the result, and returning the result to the caller.  On the remote end, a bean invocation must be set up to handle the invocation.  Consider the following service bean and proxy usage:
> public interface MyService {
>   public Result method() throws MyApplicationException;
> }
> MyService myService = ProxyHelper.createProxy(endpoint, MyService.class);
> try {
>   Result = myService.method();
> }
> catch(MyApplicationException mae) {
>   ...
> }
> MyApplicationException is an application-level exception which should be handled by the caller.  The user of the proxy expects that if the remote invocation of MyService.method() fails with a MyApplicationException, that the same exception should be thrown by the proxy instance.  Instead, the proxy instance is currently throwing a CamelRuntimeException which wraps the original MyApplicationException.  I propose that the proxy invocation handler used by ProxyHelper should check if the wrapped "cause" is of one of the declared exception types of the method being proxied, and if so, to unwrap and throw that exception instead of the CamelRuntimeException.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.