This content has been marked as final. Show 1 reply
I think you're on the right track.
Assuming that I have a JB Remoting endpoint configured on a specific port, can many clients get connection to the endpoint in a same time?
That's a matter of configuration, and how you do the configuration depends on the transport you're using. In the socket transport, which is the most commonly used transport, the parameter "maxPoolSize" determines the maximum number of worker threads, where each worker thread services one invocation at a time. The default value is "300", so that you could have up to 300 clients connected simultaneously.
Is it thread safe ?
The Remoting code is thread safe. It's up to you to make your ServerInvocationHandler thread safe.
How should I implement ServerInvocationHandler to invoke specified in a request method on the server side ?
So far I do it like this:
That looks reasonable. Note that, in addition to the parameter, you can pass an entire map of objects by calling
public Object invoke(Object param, Map metadata) throws Throwable;
in org.jboss.remoting.Client. In the ServerInvocationHandler the map can be retrieved with org.jboss.remoting.InvocationRequest.getRequestPayload().