8 Replies Latest reply on May 18, 2006 11:44 AM by Tom Elrod

    local invoker behavior

    Tom Elrod Master

      While working on JBREM-382, I realized might be good to get feedback on the behavior of the local invokers in general. To start, if a client and server are running within the same VM, the client will use a local invoker instance to make calls on the server (by reference). When this is done, even if the server's stop() and destroy() method is called, the client still maintains a valid reference to the server.

      The current behavior is that the client can *always* make calls on a server it has a direct reference to. This is done via calling the ServerInvoker.invoke(InvocationRequest invocation) method. This invoke() method does not do any checking of the server's state (if it has been stopped/destroyed). This being the case, there is no point in having a connection validator hooked up from the client side, since will always have a server once connected.

      The question is the correct behavior? If is not a local connection, calling stop()/destroy() on the server would cause the connection to be terminated. Should local connections behave the same way? If so, no way to invalidate the client's reference to the server, but could add state checking within the server's invoke() method to throw an exception if has been stopped/destroyed so that will mimic same behavior to the client as if was remote. If this is done, then would make sense to have connection validation on the client.

      All feedback welcome. I am leaning to leaving the way it is ;)