Interface Resource.StateListener

Enclosing interface:
Resource
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface Resource.StateListener
Application listener for a Resource.

Listeners are usually registered at creation time.

Dispatching Guarantees:

  • Sequential: Listeners are invoked sequentially for a given resource. The library guarantees that state transitions are observed in the exact chronological order they occurred (e.g., a CLOSING event will never be dispatched before its preceding OPEN event).
*

Implementation Note: Implementations should avoid long-running or blocking operations. Blocking a listener will stall subsequent state notifications for that specific resource.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Handle state change.
  • Method Details

    • handle

      void handle(Resource.Context context)
      Handle state change.
      Parameters:
      context - state change context