Amichai Rothman created ARIES-2113:
--------------------------------------
Summary: TCP provider doesn't distinguish returned value from
thrown exceptions
Key: ARIES-2113
URL: https://issues.apache.org/jira/browse/ARIES-2113
Project: Aries
Issue Type: Bug
Components: Remote Service Admin
Affects Versions: rsa-1.16.1
Reporter: Amichai Rothman
The TCP provider currently returns a single object from the remote invocation,
which can be either the result object or an exception. While this works in most
cases, it is technically incorrect since a method can return an exception
object without throwing it so the two cases should be treated differently. It
should return both an exception (which is rethrown if not null) and the result
object (which is returned to caller normally even if it is a Throwable).
Furthermore, when an exception is thrown/returned, there is ambiguity between
an exception thrown by the invoked method implementation itself (which should
be thrown transparently to the caller) and those caused by the provider (bugs
or otherwise which should probably be remote ServiceExceptions). A simple
solution is to always wrap method implementation exceptions in an
InvocationTargetException (as invoke already does but the async result
resolution does not) and other provider exceptions (explicit or implicit)
thrown as-is. The receiver can then distinguish the two and process them
differently if necessary.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)