A system and method for server load balancing that includes server
affinity. The system can be incorporated into application servers to
support load balancing algorithms for RMI objects that provide server
affinity. Server affinity uses smart load balancing for external client
connections in such a way that it uses preexisting connection and reduces
overhead: the client considers its existing connections to the
application server instances when choosing the server instance on which
to access a service. If a service is configured for server affinity, the
client-side stub attempts to choose a server instance to which it is
already connected, and continues to use the same server instance for
method calls. All stubs on that client will attempt to use that server
instance. If the server instance becomes unavailable, the stubs fail
over, if possible, to a server instance to which the client is already
connected.