Interface ServiceRegistration

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AggregateServiceRegistration

public interface ServiceRegistration extends AutoCloseable
A service registration handle, which can be used to remove a previously registered service.
Author:
David M. Lloyd
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ServiceRegistration
    An empty service registration handle, which has no effect.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Re-activate this registration immediately and indefinitely.
    aggregate(ServiceRegistration... registrations)
    Create an aggregate of registrations which are all controlled as one.
    void
    Close and remove this registration immediately.
    void
    Invalidate this registration immediately (possibly temporarily) without closing it.
    default void
    Hint to this registration that deactivation of the service is likely at the given time.
  • Field Details

    • EMPTY

      static final ServiceRegistration EMPTY
      An empty service registration handle, which has no effect.
  • Method Details

    • close

      void close()
      Close and remove this registration immediately.
      Specified by:
      close in interface AutoCloseable
    • deactivate

      void deactivate()
      Invalidate this registration immediately (possibly temporarily) without closing it.
    • activate

      void activate()
      Re-activate this registration immediately and indefinitely.
    • hintDeactivateAt

      default void hintDeactivateAt(Instant instant)
      Hint to this registration that deactivation of the service is likely at the given time.
      Parameters:
      instant - the time at which deactivation is likely (must not be null)
    • aggregate

      static ServiceRegistration aggregate(ServiceRegistration... registrations)
      Create an aggregate of registrations which are all controlled as one.
      Parameters:
      registrations - the registrations to control
      Returns:
      the aggregated handle