[jboss-user] [Remoting] - Re: behavior on failure

ron.sigal@jboss.com do-not-reply at jboss.com
Thu Mar 22 13:26:56 EDT 2007


anonymous wrote : 
  | The org.jboss.remoting.Client class offers the invoke() and invokeOneWay() methods to do calls to the server side.
  | 
  | If an error (not produced by my code) occurs during the call, for example:
  | 
  | * The call is not delivered to the server.
  | * The call's return value is not delivered to the client.
  | 
  | 
  | Can I be SURE that a Throwable will be thrown to the client side?
  | 
  | Something may/must happen in the server side? 
  | 

The synchronous version Client.invoke() will either return a (possibly null) response or throw an exception, which could be generated during the transmission of the request, during processing on the server, or during transmission of the response.  One exception would be if the connection has a timeout value of zero, which would allow the client to wait forever for a response on a broken connection.

The asynchronous version Client.invokeOneway() passes the invocation to a separate thread, either on the client side or server side, and returns without waiting for either a response or an exception.

The answer is the same for callback handling, which is implemented by calls to Client.invoke() and Client.invokeOneway().


anonymous wrote : 
  | In the server side, I use the handleCallback() method to send a callback to a client.
  | 
  | The handleCallback() method is invoked by my application thread.
  | 
  | Is the serialization done by my application thread or another thread is used for the serialization?
  | 
  | Is the callback delivered by my application thread or another thread is used for the delivering?
  | 
  | what tasks are my application thread used for? 
  | 

When you call handleCallback(), the following things happen on your application thread:

1. the callback is marshalled to the network (which by default involves serialization),

2. the thread blocks waiting to read the response,

3. the response is unmarshalled (which by default involves deserializing it) and returned.

Of course, the answer would be different if you called handleCallbackOneway(), which acts like Client.invokeOneway().

anonymous wrote : 
  | Is the callback delivered by my application thread or another thread is used for the delivering?
  | 

I'm not sure I understand the question, but I'm assuming you're talking about delivering the callback to the InvokerCallbackHandler you registered on the client side.  Typically, the callback delivery takes place not only on a different thread but in a different JVM.  If the client and server are in the same JVM, then there are two possibilities.  The default behavior is for the client invoker to make a direct method call on the server invoker, in which case the delivery would happen on your application thread.  However, if you do this:


  |       HashMap config = new HashMap();
  |       config.put(InvokerLocator.FORCE_REMOTE, "true");
  |       connector = new Connector(serverLocator, config);
  | 

the invocation will be handled through the transport and the delivery will occur on a separate thread in the server.

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

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



More information about the jboss-user mailing list