Interface DriverManagedResource

All Known Implementing Classes:
IpcPublication, NetworkPublication, PublicationImage, SubscriptionLink

public interface DriverManagedResource
Common behaviour supported for driver resources such as publications and images.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close resources that are not external.
    default boolean
    Free external resources such as files.
    boolean
    Has resource reached end of its life and should be reclaimed?
    void
    onTimeEvent(long timeNs, long timeMs, DriverConductor conductor)
    Inform resource of timeNs passing and pass it DriverConductor to inform of any state transitions.
  • Method Details

    • free

      default boolean free()
      Free external resources such as files. If successful then return true.
      Returns:
      true if successful and false if it should be attempted again later.
    • close

      void close()
      Close resources that are not external. This will not call free(). That will need to be called separately at the appropriate time.
    • onTimeEvent

      void onTimeEvent(long timeNs, long timeMs, DriverConductor conductor)
      Inform resource of timeNs passing and pass it DriverConductor to inform of any state transitions.
      Parameters:
      timeNs - now in nanoseconds.
      timeMs - now in milliseconds for epoch.
      conductor - to inform of any state transitions.
    • hasReachedEndOfLife

      boolean hasReachedEndOfLife()
      Has resource reached end of its life and should be reclaimed?
      Returns:
      whether resource has reached end of life or not.