|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jini.core.constraint.InvocationConstraints
public final class InvocationConstraints
An immutable aggregation of constraints into a set of requirements and a set of preferences. A requirement is a mandatory constraint that must be satisfied for the invocation. A preference is a desired constraint, to be satisfied if possible, but it will not be satisfied if it conflicts with a requirement. If two preferences conflict, it is arbitrary as to which one will be satisfied. If a constraint is not understood, due to lack of knowledge of the type of the constraint or the contents of the constraint, then the constraint cannot be satisfied.
Note that it is possible for an instance of this class to contain both requirements that conflict with each other, and preferences that conflict with each other and with requirements.
Field Summary | |
---|---|
static InvocationConstraints |
EMPTY
An empty instance, one that has no requirements and no preferences. |
Constructor Summary | |
---|---|
InvocationConstraints(Collection reqs,
Collection prefs)
Creates an instance that has all of the constraints from the first collection, reqs , added as requirements if the collection
is a non-null value, and has all of the constraints from
the second collection, prefs , added as preferences if the
collection is a non-null value. |
|
InvocationConstraints(InvocationConstraint[] reqs,
InvocationConstraint[] prefs)
Creates an instance that has all of the constraints from the first array, reqs , added as requirements if the array is a
non-null value, and has all of the constraints from
the second array, prefs , added as preferences if the
array is a non-null value. |
|
InvocationConstraints(InvocationConstraint req,
InvocationConstraint pref)
Creates an instance that has the first constraint, req ,
added as a requirement if it is a non-null value, and has
the second constraint, pref , added as a preference if it
is a non-null value and is not a duplicate of the
requirement. |
Method Summary | |
---|---|
static InvocationConstraints |
combine(InvocationConstraints constraints1,
InvocationConstraints constraints2)
Returns an instance of this class that has all of the requirements from each non- null argument added as requirements and has all
of the preferences from each non-null argument added as
preferences. |
boolean |
equals(Object obj)
Two instances of this class are equal if they have the same requirements and the same preferences. |
int |
hashCode()
Returns a hash code value for this object. |
boolean |
isEmpty()
Returns true if the instance has no requirements and no
preferences; returns false otherwise. |
InvocationConstraints |
makeAbsolute()
Returns an instance of this class constructed from all of the same requirements and preferences as this instance, but with every constraint that is an instance of RelativeTimeConstraint
replaced by the result of invoking the constraint's
makeAbsolute method with the current time (as given by
System.currentTimeMillis ). |
InvocationConstraints |
makeAbsolute(long baseTime)
Returns an instance of this class equal to the result of taking the requirements and preferences in this instance, replacing each constraint that is an instance of RelativeTimeConstraint with
the result of invoking that constraint's makeAbsolute
method with the specified base time, and creating a new instance of
this class with duplicate requirements, duplicate preferences, and
preferences that are duplicates of requirements all removed. |
Set |
preferences()
Returns an immutable set of all of the preferences. |
Set |
requirements()
Returns an immutable set of all of the requirements. |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final InvocationConstraints EMPTY
Constructor Detail |
---|
public InvocationConstraints(InvocationConstraint req, InvocationConstraint pref)
req
,
added as a requirement if it is a non-null
value, and has
the second constraint, pref
, added as a preference if it
is a non-null
value and is not a duplicate of the
requirement.
req
- a requirement, or null
pref
- a preference, or null
public InvocationConstraints(InvocationConstraint[] reqs, InvocationConstraint[] prefs)
reqs
, added as requirements if the array is a
non-null
value, and has all of the constraints from
the second array, prefs
, added as preferences if the
array is a non-null
value. Duplicate requirements,
duplicate preferences, and preferences that are duplicates of
requirements are all removed. The arguments passed to the constructor
are neither modified nor retained; subsequent changes to those
arguments have no effect on the instance created.
reqs
- requirements, or null
prefs
- preferences, or null
NullPointerException
- if any element of an argument is
null
public InvocationConstraints(Collection reqs, Collection prefs)
reqs
, added as requirements if the collection
is a non-null
value, and has all of the constraints from
the second collection, prefs
, added as preferences if the
collection is a non-null
value. Duplicate requirements,
duplicate preferences, and preferences that are duplicates of
requirements are all removed. The arguments passed to the constructor
are neither modified nor retained; subsequent changes to those
arguments have no effect on the instance created.
reqs
- requirements, or null
prefs
- preferences, or null
NullPointerException
- if any element of an argument is
null
IllegalArgumentException
- if any element of an argument is not
an instance of InvocationConstraint
Method Detail |
---|
public static InvocationConstraints combine(InvocationConstraints constraints1, InvocationConstraints constraints2)
null
argument added as requirements and has all
of the preferences from each non-null
argument added as
preferences. Duplicate requirements, duplicate preferences, and
preferences that are duplicates of requirements are all removed.
constraints1
- constraints, or null
constraints2
- constraints, or null
null
argument added as requirements and has all
of the preferences from each non-null
argument added as
preferencespublic InvocationConstraints makeAbsolute(long baseTime)
RelativeTimeConstraint
with
the result of invoking that constraint's makeAbsolute
method with the specified base time, and creating a new instance of
this class with duplicate requirements, duplicate preferences, and
preferences that are duplicates of requirements all removed.
baseTime
- an absolute time, specified in milliseconds from
midnight, January 1, 1970 UTC
RelativeTimeConstraint
with the result of invoking that constraint's makeAbsolute
method with the specified base time, and creating a new instance of
this class with duplicate requirements, duplicate preferences, and
preferences that are duplicates of requirements all removedpublic InvocationConstraints makeAbsolute()
RelativeTimeConstraint
replaced by the result of invoking the constraint's
makeAbsolute
method with the current time (as given by
System.currentTimeMillis
). Duplicate
requirements, duplicate preferences, and preferences that are
duplicates of requirements are all removed.
RelativeTimeConstraint
replaced by the result of invoking the constraint's
makeAbsolute
method with the current timepublic Set requirements()
UnsupportedOperationException
being thrown.
public Set preferences()
UnsupportedOperationException
being thrown.
public boolean isEmpty()
true
if the instance has no requirements and no
preferences; returns false
otherwise.
true
if the instance has no requirements and no
preferences; false
otherwisepublic int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
TrustEquivalence.checkTrustEquivalence
.
equals
in class Object
public String toString()
toString
in class Object
|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |