Interface AtomicRefresh<T extends LifeCycle<T>>

Type Parameters:
T - The life cycle type
All Superinterfaces:
AutoCloseable, Closeable, LifeCycle<T>
All Known Implementing Classes:
DefaultEnvironment

@Internal public interface AtomicRefresh<T extends LifeCycle<T>> extends LifeCycle<T>
The LifeCycle.refresh() of DefaultEnvironment, which publishes the properties read by the refresh in one step.

The override lives here, declared against the type variable, and not in DefaultEnvironment to stay binary compatible. Declared there it would return Environment, and the compiler would add a bridge method with the erased descriptor of LifeCycle.refresh(). A subclass compiled against an earlier version that overrides refresh() and calls super.refresh() is linked against that erased descriptor: it would reach the bridge, which dispatches back to the subclass, and recurse until the stack overflows. Declared against the type variable the override has the erased descriptor itself and there is no bridge.

The interface is public only so that refresh() stays invocable through reflection on the environment class; it is not meant to be implemented by anything else.

Since:
4.10.32
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    Refreshes the current life cycle object.

    Methods inherited from interface io.micronaut.context.LifeCycle

    close, isRunning, start, stop