net.jini.jeri.tcp
Class Constraints.Distilled

java.lang.Object
  extended by net.jini.jeri.tcp.Constraints.Distilled
Enclosing class:
Constraints

static class Constraints.Distilled
extends Object

A distillation of constraints to a form more directly usable by this provider.


Field Summary
private  long connectDeadline
           
private  boolean hasConnectDeadline
           
private  boolean relativeOK
          true if relative time constraints are allowed (in other words, not for client-side use)
private  Collection unfulfilledPreferences
           
private  Collection unfulfilledRequirements
           
 
Constructor Summary
Constraints.Distilled(InvocationConstraints constraints, boolean relativeOK)
           
 
Method Summary
private  void addAlternatives(ConstraintAlternatives constraint, boolean isRequirement)
          If "isRequirement" is true, throws an UnsupportedConstraintException if we do not support at least the transport layer aspects of at least one of the constraints in the given alternatives.
private  void addConnectDeadline(long deadline)
          Adds the given connect deadline to this object's state.
private  void addConstraint(InvocationConstraint constraint, boolean isRequirement)
          If "isRequirement" is true, throws an UnsupportedConstraintException if we do not support at least the transport layer aspects of the given constraint.
(package private)  long getConnectDeadline()
          Returns the absolute time of the socket connect deadline.
(package private)  InvocationConstraints getUnfulfilledConstraints()
          Returns the requirements and supported preferences that must be at least partially implemented by higher layers.
(package private)  boolean hasConnectDeadline()
          Returns true if a there is a socket connect deadline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

relativeOK

private final boolean relativeOK
true if relative time constraints are allowed (in other words, not for client-side use)


unfulfilledRequirements

private Collection unfulfilledRequirements

unfulfilledPreferences

private Collection unfulfilledPreferences

hasConnectDeadline

private boolean hasConnectDeadline

connectDeadline

private long connectDeadline
Constructor Detail

Constraints.Distilled

Constraints.Distilled(InvocationConstraints constraints,
                      boolean relativeOK)
                throws UnsupportedConstraintException
Throws:
UnsupportedConstraintException
Method Detail

getUnfulfilledConstraints

InvocationConstraints getUnfulfilledConstraints()
Returns the requirements and supported preferences that must be at least partially implemented by higher layers.


hasConnectDeadline

boolean hasConnectDeadline()
Returns true if a there is a socket connect deadline.


getConnectDeadline

long getConnectDeadline()
Returns the absolute time of the socket connect deadline.


addConstraint

private void addConstraint(InvocationConstraint constraint,
                           boolean isRequirement)
                    throws UnsupportedConstraintException
If "isRequirement" is true, throws an UnsupportedConstraintException if we do not support at least the transport layer aspects of the given constraint. If we do support at least the transport layer aspects of the given constraint, then if appropriate, adds it to the collection of requirements or preferences that must be at least partially implemented by higher layers.

Throws:
UnsupportedConstraintException

addAlternatives

private void addAlternatives(ConstraintAlternatives constraint,
                             boolean isRequirement)
                      throws UnsupportedConstraintException
If "isRequirement" is true, throws an UnsupportedConstraintException if we do not support at least the transport layer aspects of at least one of the constraints in the given alternatives. If we do support at least the transport layer aspects of at least one of the constraints in the given alternatives, then if appropriate, adds a ConstraintAlternatives of the supported alternatives to the collection of requirements or preferences that must be at least partially implemented by higher layers. If all of the supported alternatives need at least partial implementation by higher layers, then adds a ConstraintAlternatives with all of the supported alternatives to the unfulfilled collection or preferences, because higher layers must support at least one of them. But if at least one of the supported alternatives can be fully satisfied by the transport layer, then add nothing to the unfulfilled collection, because it is possible that higher layers need not support any of them (and there is no way to express no constraint). The weakest connect deadline (with no deadline being the the weakest possibility) is chosen among alternatives.

Throws:
UnsupportedConstraintException

addConnectDeadline

private void addConnectDeadline(long deadline)
Adds the given connect deadline to this object's state. The earliest connect deadline is what gets remembered.



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