public interface Param
Super-interface common to all parameter container of
CommunicationLifeCycle
objects.
ConnectionParam
, FilterParam
,
QueryParam
, SubscriptionParam
and TransactionParam
)
that implement this Param
interfaces share the concept of
being bound
.
Every time a parameter container (i.e. an object of the previous 5 classes)
is created it is not bound
.
When such parameter container is not bound then a specific parameter may be
set via a setSomething
method (e.g. a
setEntityClassID()
may be issued
on a SubscriptionParam
).
Once a parameter container is given as creation parameter of a
makeSomething
method of Context (e.g.
Context.makeSubscription()
) it becomes
bound
:
CommunicationLifeCycle
object, makeSomething
method of
Context;
setSomething
method will throw a
IllegalStateException
in this case.
Param
interface) has the concept of being acceptable.
E.g. the EntityClassID of a SubscriptionParam is acceptable only if it has been registered.
In this documentation each description of each single parameter has a
section, titled "Acceptable values:", that describes the acceptable
values for the corresponding parameter using a Java boolean
expression that must be satisfied, i.e. its computed value at run-time must
be true
.
E.g. a value for the EntityClassID of a SubscriptionParam is acceptable only if:
JFT.THIS.isRegistered(getEntityClassID())
// i.e. acceptable only if registered
These run-time checks (to see if a parameter has an acceptable value) are
not executed when the parameter is set (the various
setSomething
methods of sub-interface of Param), but instead
when it's given to a specific CommunicationLifeCycle
object creation
(the various makeSomething
methods of Context
).
E.g. the check to see if the value of the EntityClassID of a SubscriptionParam is acceptable is not made inside:
mySubscrParam.setEntityClassID(myEntityClassID);
// no check here
instead it's made inside:
myContext.makeSubscription(myConnection, mySubscrParam, mySubscrListener);
// here all mySubscrParam parameters are checked !
Please note that when a check is made it regards all the parameters used by the specific operation and not only the parameters explicitly set by the programmer.
E.g. inside a Subscription creation all the following parameters are checked to see if they have acceptable values:
EntityClassID, EntityClassVersion, EntityClassTimeStamp, QueryType, EntityKey, Filter, Flow and Mask.
If some has an unacceptable value (i.e. if some correspondingboolean
expression valuatedfalse
) then the operation fails and a IllegalArgumentException is thrown.
Method Summary | |
---|---|
boolean |
isBound()
Returns the bound-indication of this parameter container. |
Method Detail |
---|
boolean isBound()
A parameter container is bound if it was used as creation parameter in
some CommunicationLifeCycle
object.
setSomething
method invocation on bound objects will throw
a IllegalStateException
.