How to Use the API

A class implementing this interface must be provided to the RMI compiler (rmic) to enable parameter-based routing. Run rmic on the service implementation using these options (to be entered on one line):

This CallRouter implementation ExampleRouter ensures that all foo calls with 'arg' < "n" go to server1 (or server3 if server1 is unreachable) and that all calls with 'arg' >= "n" go to server2 (or server3 if server2 is unreachable).

This rmic call associates the ExampleRouter with ExampleImpl to enable parameter-based routing:

$ rmic -clusterable -callRouter ExampleRouter ExampleImpl

Custom Call Routing and Collocation Optimization

If a replica is available on the same server instance as the object calling it, the call will not be load-balanced, because it is more efficient to use the local replica. For more information, see Optimization for Collocated Objects..

Scripting on this page enhances content navigation, but does not change the content in any way.