public class RuntimeLifecycleBinder extends Object implements IRuntimeLifecycleBinder
Note that this class implements a service. Hence, is not a part of the public API and is a subject to change.
IRuntimeLifecycleBinder.LifecycleEvent
Constructor and Description |
---|
RuntimeLifecycleBinder() |
Modifier and Type | Method and Description |
---|---|
void |
addBinding(IRuntimeLifecycleBinder.LifecycleEvent event,
LifecycleBinding binding)
Register a hook to run upon runtime lifecycle phase
|
void |
onShutdown(LifecycleBinding binding)
Register a hook to run upon runtime shutdown
|
void |
onShutdown(Runnable r)
Register an async hook to run upon runtime shutdown
|
void |
onShutdown(String description,
Runnable r)
Register an async hook to run upon runtime shutdown
|
void |
onStartup(LifecycleBinding binding)
Register a hook to run upon runtime startup
|
void |
onStartup(Runnable r)
Register a hook to run upon runtime startup
|
void |
onStartup(String description,
Runnable r)
Register a hook to run upon runtime startup
|
void |
visitBindings(IRuntimeLifecycleBinder.LifecycleEvent event,
Consumer<LifecycleBinding> consumer)
Visitor interface for inspecting all registered hooks for a particular lifecycle event.
|
public void onStartup(Runnable r)
IRuntimeLifecycleBinder
onStartup
in interface IRuntimeLifecycleBinder
public void onStartup(String description, Runnable r)
IRuntimeLifecycleBinder
onStartup
in interface IRuntimeLifecycleBinder
description
- Human-readable description of the hookpublic void onStartup(LifecycleBinding binding)
IRuntimeLifecycleBinder
onStartup
in interface IRuntimeLifecycleBinder
binding
- Hookpublic void onShutdown(Runnable r)
IRuntimeLifecycleBinder
onShutdown
in interface IRuntimeLifecycleBinder
public void onShutdown(String description, Runnable r)
IRuntimeLifecycleBinder
onShutdown
in interface IRuntimeLifecycleBinder
description
- Human-readable description of the hookpublic void onShutdown(LifecycleBinding binding)
IRuntimeLifecycleBinder
onShutdown
in interface IRuntimeLifecycleBinder
binding
- Hookpublic void addBinding(IRuntimeLifecycleBinder.LifecycleEvent event, LifecycleBinding binding)
IRuntimeLifecycleBinder
addBinding
in interface IRuntimeLifecycleBinder
event
- Lifecycle phase of the runtimebinding
- Hookpublic void visitBindings(IRuntimeLifecycleBinder.LifecycleEvent event, Consumer<LifecycleBinding> consumer)
IRuntimeLifecycleBinder
visitBindings
in interface IRuntimeLifecycleBinder
event
- Lifecycle eventconsumer
- Bindings consumer.Copyright © 2016–2021. All rights reserved.