Class LinkedDataControl

java.lang.Object
org.jtrim2.concurrent.query.LinkedDataControl

public final class LinkedDataControl extends Object
Defines a control object for AsyncDataController instances controlling the data retrieval process of two AsyncDataLink instances. AsyncDataController implementations understanding this class will then send the main control data to the AsyncDataLink they consider the primary AsyncDataLink instance and the secondary control data to the AsyncDataLink instance they consider secondary.

Note that the AsyncDataLink instance created by the AsyncLinks.convertResultAsync(AsyncDataLink, AsyncDataQuery) method understands this class.

Thread safety

The methods of this class are safe to be accessed by multiple threads concurrently. Instances of this class cannot be directly modified, only its internal control objects if they are mutable. In case these control objects are immutable (and they are recommended to be so), then the LinkedDataControl instance is completely immutable.

Synchronization transparency

The methods of this class are synchronization transparent.
See Also:
  • Constructor Details

    • LinkedDataControl

      public LinkedDataControl(Object mainControlData, Object secondaryControlData)
      Creates and initializes the LinkedDataControl instance with the specified control objects.
      Parameters:
      mainControlData - the control object used to control the primary AsyncDataLink instance. This argument cannot be null.
      secondaryControlData - the control object used to control the secondary AsyncDataLink instance. This argument cannot be null.
      Throws:
      NullPointerException - thrown if any of the arguments is null
  • Method Details

    • getMainControlData

      public Object getMainControlData()
      Returns the control object used to control the primary AsyncDataLink instance.
      Returns:
      the control object used to control the primary AsyncDataLink instance. This method never returns null.
    • getSecondaryControlData

      public Object getSecondaryControlData()
      Returns the control object used to control the secondary AsyncDataLink instance.
      Returns:
      the control object used to control the secondary AsyncDataLink instance. This method never returns null.
    • toString

      public String toString()
      Returns the string representation of this LinkedDataControl in no particular format. The string representation contains the string representation of both control objects.

      This method is intended to be used for debugging only.

      Overrides:
      toString in class Object
      Returns:
      the string representation of this object in no particular format. This method never returns null.