Package com.illumon.iris.console.utils
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 Summary
Constructors Constructor Description PreemptiveWidgetUtils()
-
Method Summary
Modifier and Type Method Description static void
detachPreemptiveTable(Table table)
Unsubscribe from the specified table if it was aReplicatedTable
static Table
hookUpPreemptiveTable(Table table)
Attempt to subscribe to aPreemptiveUpdatesTable
without waiting for the initial data message.static Table
hookUpPreemptiveTable(Table table, boolean waitForData)
Attempt to subscribe to aPreemptiveUpdatesTable
optionally waiting for the initial data message.static Object
unpackIfValueCapsule(Object obj)
Get the internal value from the specified object if it was aValueCapsule
-
Constructor Details
-
PreemptiveWidgetUtils
public PreemptiveWidgetUtils()
-
-
Method Details
-
hookUpPreemptiveTable
Attempt to subscribe to aPreemptiveUpdatesTable
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 UncheckedTableExceptionAttempt to subscribe to aPreemptiveUpdatesTable
optionally waiting for the initial data message.- Parameters:
table
- the table to subscribe towaitForData
- 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
Unsubscribe from the specified table if it was aReplicatedTable
- Parameters:
table
- the table to unsubscribe
-
unpackIfValueCapsule
Get the internal value from the specified object if it was aValueCapsule
- Parameters:
obj
- the object- Returns:
- the unpacked value if it was a capsule, or the input object if it was not.
-