Interface Subscription
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
Animation
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Something registered that can be removed again: a handler registered with
EventTarget.subscribe(EventType, int, EventHandler), which
can be removed before its target is discarded, or a registration in a registry such as
ComponentRegistry. Removing a component from its tree does not
remove its handlers; close the subscription. Close a handler's subscription on the
UI thread, as EventTarget requires; a registry's
subscriptions follow the registry's own threading rule.-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Same asunsubscribe(), so a subscription works in try-with-resources.voidRemoves the handler.
-
Method Details
-
unsubscribe
void unsubscribe()Removes the handler. Calling it again does nothing. -
close
default void close()Same asunsubscribe(), so a subscription works in try-with-resources.- Specified by:
closein interfaceAutoCloseable
-