Package com.jetbrains

Interface Hotswap


@Service @Provided public interface Hotswap
JBR service for class redefinition notifications (hotswap). Typical usage: if (JBR.isHotswapSupported()) { Hotswap hotswap = JBR.getHotswap(); hotswap.addListener(...); }
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Defines a listener interface to handle notifications when one or more classes are successfully redefined or retransformed during the runtime.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Registers a hotswap listener.
    boolean
    Unregisters a previously registered hotswap listener.
  • Method Details

    • addListener

      void addListener(Hotswap.Listener l)
      Registers a hotswap listener.
      Parameters:
      l - the listener to remove Contract: - Typically called during agent startup (e.g. by HotswapAgent). - The same listener instance may be registered multiple times; the implementation is allowed to ignore duplicates. - Implementations must be thread-safe.
    • removeListener

      boolean removeListener(Hotswap.Listener l)
      Unregisters a previously registered hotswap listener.
      Parameters:
      l - the listener to remove
      Returns:
      true if the listener was previously registered and has been removed, false if the listener was not registered and nothing was changed. Contract: - Implementations must be thread-safe.