Interface PendingService.OwnedService<S,R>

Type Parameters:
S - type of service owned
R - type of value passed to the hook indicating that the service's pending has ended (the service became ready)
All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AbstractManagedPendingService.SafeOwnedService
Enclosing interface:
PendingService<O,S,R>

public static interface PendingService.OwnedService<S,R> extends AutoCloseable
An owned service which must be closed once the owner is ready with it.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    onceReady(@NonNull Consumer<R> serviceCallback)
    Specifies a callback to be called once the service's pending has ended (the service became ready).
    Service accessible until this instance gets closed.
  • Method Details

    • service

      S service()
      Service accessible until this instance gets closed.
      Returns:
      actual owned service
    • onceReady

      void onceReady(@NonNull @NonNull Consumer<R> serviceCallback)
      Specifies a callback to be called once the service's pending has ended (the service became ready).
      Parameters:
      serviceCallback - callback to be called when the service becomes ready
    • close

      void close()
      Specified by:
      close in interface AutoCloseable