Defines an interface to proxies for setting constraints to control remote method calls. If a proxy implements this interface, then the semantics of this interface apply to all calls through all remote methods defined by the proxy; there is no mechanism to exempt remote methods or remote interfaces from these semantics.
Constraints for a remote call come from two sources:
- Constraints imposed by the server (including any minimum constraints imposed by the communication mechanism used between the proxy and server)
- Constraints placed on a proxy by the client
The server constraints are controlled by the proxy implementation; they are not exposed to the client, and might vary in ways unknown to the client (for example, vary by method or over time). The client should set the constraints it wants rather than assuming that the server imposes particular constraints. Client constraints placed on a proxy apply to all remote calls made through that particular proxy by any thread, and the client can specify different constraints for each remote method.
A remote call will be performed only if the combined requirements (from both sources) can be satisfied. If the combined requirements cannot be satisfied, a {@link java.rmi.ConnectIOException} will be thrown by theremote call, typically containing (but not required to contain) a nested {@link net.jini.io.UnsupportedConstraintException}. In addition to the requirements, both client and server preferences will be satisfied, to the extent possible.
Note that constraints imposed by the communication mechanism must be factored into the requirements. For example, if the only explicit requirement is Delegation.YES
, but the communication mechanism always requires client authentication, then effectively a ClientAuthentication.YES
requirement exists, and so the Delegation.YES
requirement must also be satisfied.
The constraint mechanisms are designed such that client constraints do not weaken server constraints, and vice versa. However, it is certainly possible to specify conflicting constraints. Preferences that conflict with requirements are ignored, and if preferences conflict with each other it is arbitrary as to which (if any) are satisfied, but if there are conflicting requirements the remote call will not be made.
@author Sun Microsystems, Inc.
@since 2.0