public abstract class LifecycleHandlerInspector extends Object
LifecycleHandler
s to be registered to the Configuration
. A StartHandler
annotated lifecycle handler will be registered through LifecycleOperations.onStart(int,
LifecycleHandler)
, whilst a ShutdownHandler
annotated lifecycle handler will be registered through LifecycleOperations.onShutdown(int, LifecycleHandler)
.ShutdownHandler
,
StartHandler
,
LifecycleHandler
Modifier and Type | Method and Description |
---|---|
static void |
registerLifecycleHandlers(Configuration configuration,
Object component)
Register any lifecycle handlers found on given
component with given configuration . |
public static void registerLifecycleHandlers(Configuration configuration, Object component)
component
with given configuration
.
If given component
implements Lifecycle
, will allow it to register lifecycle handlers with
the configuration. Otherwise, will resolve StartHandler
and ShutdownHandler
annotated lifecycle
handlers in the given component
. If present, they will be registered on the given configuration
through the LifecycleOperations.onStart(int, LifecycleHandler)
and
LifecycleOperations.onShutdown(int, LifecycleHandler)
methods. If the given component
is null
it will be ignored.
configuration
- the Configuration
to register resolved lifecycle handlers tocomponent
- the object to resolve lifecycle handlers forCopyright © 2010–2023. All rights reserved.