net.jini.jeri.tcp
Class Constraints

java.lang.Object
  extended by net.jini.jeri.tcp.Constraints

 class Constraints
extends Object

Constraint support for this transport provider. This code makes some significant simplifying assumptions: - The transport layer aspects of all constraints supported by this provider are always satisfied by all open connections and requests. - No combination of individual constraints supported by this provider can contain conflicting constraints.

Author:
Sun Microsystems, Inc.

Nested Class Summary
(package private) static class Constraints.Distilled
          A distillation of constraints to a form more directly usable by this provider.
 
Field Summary
private static int FULL_SUPPORT
          indicates that this provider supports implementing all aspects of satisfying a given constraint
private static int NO_SUPPORT
          indicates that this provider does not support implementing (or does not understand how to implement) the transport layer aspects of satisfying a given constraint
private static int PARTIAL_SUPPORT
          indicates that this provider supports implementing the transport layer aspects of satisfying a given constraint, but at least partial implementation by higher layers is also needed in order to fully satisfy the constraint
private static Map supportedClasses
          maps constraint classes that are supported to Boolean indicating whether or not such constraints must be at least partially implemented by higher layers to be fully satisfied
private static Map supportedValues
          maps constraint values that are supported to Boolean indicating whether or not they must be at least partially implemented by higher layers to be fully satisfied
 
Constructor Summary
private Constraints()
           
 
Method Summary
(package private) static InvocationConstraints check(InvocationConstraints constraints, boolean relativeOK)
          Checks that we support at least the transport layer aspects of the given requirements (and throws an UnsupportedConstraintException if not), and returns the requirements that must be at least partially implemented by higher layers and the supported preferences that must be at least partially implemented by higher layers.
(package private) static Constraints.Distilled distill(InvocationConstraints constraints, boolean relativeOK)
          Distills the given constraints to a form more directly usable by this provider.
private static int getSupport(InvocationConstraint c)
          Returns this provider's general support for the given constraint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_SUPPORT

private static final int NO_SUPPORT
indicates that this provider does not support implementing (or does not understand how to implement) the transport layer aspects of satisfying a given constraint

See Also:
Constant Field Values

FULL_SUPPORT

private static final int FULL_SUPPORT
indicates that this provider supports implementing all aspects of satisfying a given constraint

See Also:
Constant Field Values

PARTIAL_SUPPORT

private static final int PARTIAL_SUPPORT
indicates that this provider supports implementing the transport layer aspects of satisfying a given constraint, but at least partial implementation by higher layers is also needed in order to fully satisfy the constraint

See Also:
Constant Field Values

supportedValues

private static final Map supportedValues
maps constraint values that are supported to Boolean indicating whether or not they must be at least partially implemented by higher layers to be fully satisfied


supportedClasses

private static final Map supportedClasses
maps constraint classes that are supported to Boolean indicating whether or not such constraints must be at least partially implemented by higher layers to be fully satisfied

Constructor Detail

Constraints

private Constraints()
Method Detail

getSupport

private static int getSupport(InvocationConstraint c)
Returns this provider's general support for the given constraint.


check

static InvocationConstraints check(InvocationConstraints constraints,
                                   boolean relativeOK)
                            throws UnsupportedConstraintException
Checks that we support at least the transport layer aspects of the given requirements (and throws an UnsupportedConstraintException if not), and returns the requirements that must be at least partially implemented by higher layers and the supported preferences that must be at least partially implemented by higher layers. [If this provider supported constraints whose transport layer aspects were not always satisfied by open connections or requests, then we would need a variant of this method that checks the given constraints against an open connection or request. If this provider supported constraints that could conflict with each other then (when not checking against an open connection or request) we would need to check for possible conflicts.]

Throws:
UnsupportedConstraintException

distill

static Constraints.Distilled distill(InvocationConstraints constraints,
                                     boolean relativeOK)
                              throws UnsupportedConstraintException
Distills the given constraints to a form more directly usable by this provider. Throws an UnsupportedConstraintException if we do not support at least the transport layer aspects of the requirements.

Throws:
UnsupportedConstraintException


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.