JBR service for class redefinition notifications (hotswap).
Typical usage:
if (JBR.isHotswapSupported()) {
Hotswap hotswap = JBR.getHotswap();
hotswap.addListener(...);
}
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDefines a listener interface to handle notifications when one or more classes are successfully redefined or retransformed during the runtime. -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters a hotswap listener.booleanUnregisters a previously registered hotswap listener.
-
Method Details
-
addListener
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
Unregisters a previously registered hotswap listener.- Parameters:
l- the listener to remove- Returns:
trueif the listener was previously registered and has been removed,falseif the listener was not registered and nothing was changed. Contract: - Implementations must be thread-safe.
-