Class PreemptiveWidgetUtils

java.lang.Object
com.illumon.iris.console.utils.PreemptiveWidgetUtils

public class PreemptiveWidgetUtils extends Object
Utility functions for widgets that display data using preemptive tables.
  • Constructor Details

    • PreemptiveWidgetUtils

      public PreemptiveWidgetUtils()
  • Method Details

    • hookUpPreemptiveTable

      public static Table hookUpPreemptiveTable(@Nullable Table table) throws UncheckedTableException
      Attempt to subscribe to a PreemptiveUpdatesTable without waiting for the initial data message.
      Parameters:
      table - the table to subscribe to
      Returns:
      a newly subscribed preemptive table, or null if there was a problem
      Throws:
      UncheckedTableException - if an error occurs during subscription
    • hookUpPreemptiveTable

      public static Table hookUpPreemptiveTable(Table table, boolean waitForData) throws UncheckedTableException
      Attempt to subscribe to a PreemptiveUpdatesTable optionally waiting for the initial data message.
      Parameters:
      table - the table to subscribe to
      waitForData - if the method should wait for the initial data message before returning
      Returns:
      a newly subscribed preemptive table, or null if there was a problem
      Throws:
      UncheckedTableException - if an error occurs during subscription
    • detachPreemptiveTable

      public static void detachPreemptiveTable(Table table)
      Unsubscribe from the specified table if it was a ReplicatedTable
      Parameters:
      table - the table to unsubscribe
    • unpackIfValueCapsule

      public static Object unpackIfValueCapsule(Object obj)
      Get the internal value from the specified object if it was a ValueCapsule
      Parameters:
      obj - the object
      Returns:
      the unpacked value if it was a capsule, or the input object if it was not.