[jboss-user] [Remoting] - Re: Exceptions in calls and callbacks

login4jbr do-not-reply at jboss.com
Thu Feb 15 17:36:03 EST 2007


Thank you very much for the reply, I really appreciate the help.

I think my original post wasn't clear (sorry about my poor english), I'll try to put this as correctly as possible.

When you do a remote call or callback, a number of problems may happen.

The invoke() and invokeOneWay() methods declare that throw a Throwable, but Throwable is a very general interface (I'm confused because I have readed somewhere that throwing or catching a Throwable is a bad practice, anyway let's continue with the main point).

The programmer that uses these methods needs to know what kind of things may be thrown and the originating reasons.

I know that you can search in google for a certain type of exception to learn about its meaning, but that's not the problem here. The problem is that there is no documentation (at least I don't have found it) about the things that can be thrown by the remote invocations.

The same applies for the callbacks:When you do a callback, a CallbackHandleException can arise, which wraps the real Throwable, but I don't know what kind of things may come in there.

Is important to know what will be thrown in the following situations:

- When the call were going from the emisor to the receptor.
- When the call made it to the receptor but some problem occurred during processing.
- When the call were returning from the receptor to the emisor.

Think in the following scenario:

1. You have a client-server application.
2. The server have a variable X with value 5.
3. The client does a remote call to the server and tells him "please increment X by one"
4. The server increase the value and now X == 6
5. The remote call returns
6. The client tells the user: "dear user, now the value of X is 6"

Now imagine that the remote call throws a Throwable...
How can you determinate what happened?
Did the request get to the server?
Was the value of X increased?
The problem occurred during the call return?

Well, I hope my explanation was correct and clear.

Big thanks to all people.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017275#4017275

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017275



More information about the jboss-user mailing list