Class HasLifecycle
java.lang.Object
io.deephaven.web.client.api.event.HasEventHandling
io.deephaven.web.client.api.lifecycle.HasLifecycle
- Direct Known Subclasses:
JsFigure
,JsPartitionedTable
,JsTable
,JsTreeTable
An abstraction over simple lifecycle methods, to see if objects are currently connected to their server-side
counterparts.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.deephaven.web.client.api.event.HasEventHandling
HasEventHandling.EventPair<T>
-
Field Summary
Fields inherited from class io.deephaven.web.client.api.event.HasEventHandling
INTERNAL_EVENT_RELEASED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Signal that reconnect was attempted and failed due to differences between client and server state.void
Mark the object as (still) disconnected from its corresponding server-side object, but reconnect will be attempted in the future.elemental2.promise.Promise<Void>
Resolves immediately if connected, otherwise will resolve the next time this object is marked as connected, or reject if it can't connect.void
Mark the object as being connected to its corresponding server-side object.elemental2.promise.Promise<?>
refetch()
Indicate that a new session has been created on the server, and this object should re-create its corresponding server-side object if possible.Methods inherited from class io.deephaven.web.client.api.event.HasEventHandling
addEventListener, addEventListenerOneShot, addEventListenerOneShot, failureHandled, fireCriticalEvent, fireCriticalEvent, fireEvent, fireEvent, fireEvent, hasListener, hasListeners, isSuppress, logPrefix, nextEvent, removeEventListener, suppressEvents, unsuppressEvents
-
Constructor Details
-
HasLifecycle
public HasLifecycle()
-
-
Method Details
-
die
Signal that reconnect was attempted and failed due to differences between client and server state. -
reconnect
public void reconnect()Mark the object as being connected to its corresponding server-side object. -
refetch
public elemental2.promise.Promise<?> refetch()Indicate that a new session has been created on the server, and this object should re-create its corresponding server-side object if possible. Override this to implement custom behavior, being sure to call reconnect() when finished.- Returns:
- a promise that will resolve when this object is reconnected
-
disconnected
public void disconnected()Mark the object as (still) disconnected from its corresponding server-side object, but reconnect will be attempted in the future. -
nextReconnect
Resolves immediately if connected, otherwise will resolve the next time this object is marked as connected, or reject if it can't connect.
-