public abstract class AbstractLifecycleComponent<ConfT extends ComponentConfiguration> extends AbstractComponent<ConfT> implements LifecycleComponent
AbstractComponent and LifecycleComponent.| Modifier and Type | Field and Description |
|---|---|
protected Lifecycle |
lifecycle |
protected org.apache.bookkeeper.stats.StatsLogger |
statsLogger |
protected java.lang.Thread.UncaughtExceptionHandler |
uncaughtExceptionHandler |
componentName, conf| Modifier | Constructor and Description |
|---|---|
protected |
AbstractLifecycleComponent(java.lang.String componentName,
ConfT conf,
org.apache.bookkeeper.stats.StatsLogger statsLogger) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(LifecycleListener listener) |
void |
close() |
protected abstract void |
doClose() |
protected abstract void |
doStart() |
protected abstract void |
doStop() |
protected org.apache.bookkeeper.stats.StatsLogger |
getStatsLogger() |
Lifecycle.State |
lifecycleState() |
void |
removeLifecycleListener(LifecycleListener listener) |
void |
setExceptionHandler(java.lang.Thread.UncaughtExceptionHandler handler)
Set the default handler invoked when a lifecycle component
abruptly terminates due an uncaught exception.
|
void |
start() |
void |
stop() |
getConf, getNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, publishInfoprotected final Lifecycle lifecycle
protected final org.apache.bookkeeper.stats.StatsLogger statsLogger
protected volatile java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler
protected AbstractLifecycleComponent(java.lang.String componentName,
ConfT conf,
org.apache.bookkeeper.stats.StatsLogger statsLogger)
public void setExceptionHandler(java.lang.Thread.UncaughtExceptionHandler handler)
LifecycleComponentsetExceptionHandler in interface LifecycleComponenthandler - handler invoked when an uncaught exception happens
in the lifecycle component.protected org.apache.bookkeeper.stats.StatsLogger getStatsLogger()
public Lifecycle.State lifecycleState()
lifecycleState in interface LifecycleComponentpublic void addLifecycleListener(LifecycleListener listener)
addLifecycleListener in interface LifecycleComponentpublic void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener in interface LifecycleComponentpublic void start()
start in interface LifecycleComponentprotected abstract void doStart()
public void stop()
stop in interface LifecycleComponentprotected abstract void doStop()
public void close()
close in interface java.lang.AutoCloseableclose in interface LifecycleComponentprotected abstract void doClose()
throws java.io.IOException
java.io.IOExceptionCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.