Home > Articles > Programming > Java

  • Print
  • + Share This

Parameter Objects

A number of constructors in this specification take objects generically named feasibility parameters (classes named <string>Parameters where <string> identifies the kind of parameter). When a reference to a Parameters object is given as a parameter to a constructor the Parameters object becomes bound to the object being created. Changes to the values in the Parameters object affect the constructed object. For example, if a reference to a SchedulingParameters object, sp, is given to the constructor of a RealtimeThread, rt, then calls to sp.setPriority() will change the priority of rt. There is no restriction on the number of constructors to which a reference to a single Parameters object may be given. If a Parameters object is given to more than one constructor, then changes to the values in the Parameters object affect all of the associated schedulable objects. Note that this is a one-to-many relationship, not a many-to-many relationship, that is, a schedulable object (e.g., an instance of RealtimeThread) must have zero or one associated instance of each Parameter object type.

Caution: <string>Parameter objects are explicitly unsafe in multithreaded situations when they are being changed. No synchronization is done. It is assumed that users of this class who are mutating instances will be doing their own synchronization at a higher level.

  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.