Class LifecycleComponentStack
java.lang.Object
org.apache.bookkeeper.common.component.LifecycleComponentStack
- All Implemented Interfaces:
AutoCloseable,LifecycleComponent
A stack of
LifecycleComponents.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLifecycleListener(LifecycleListener listener) voidclose()getComponent(int index) getName()intvoidpublishInfo(ComponentInfoPublisher componentInfoPublisher) voidremoveLifecycleListener(LifecycleListener listener) voidSet the default handler invoked when a lifecycle component abruptly terminates due an uncaught exception.voidstart()voidstop()
-
Method Details
-
newBuilder
-
getNumComponents
public int getNumComponents() -
getComponent
-
getName
- Specified by:
getNamein interfaceLifecycleComponent
-
lifecycleState
- Specified by:
lifecycleStatein interfaceLifecycleComponent
-
addLifecycleListener
- Specified by:
addLifecycleListenerin interfaceLifecycleComponent
-
removeLifecycleListener
- Specified by:
removeLifecycleListenerin interfaceLifecycleComponent
-
publishInfo
- Specified by:
publishInfoin interfaceLifecycleComponent
-
start
public void start()- Specified by:
startin interfaceLifecycleComponent
-
stop
public void stop()- Specified by:
stopin interfaceLifecycleComponent
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceLifecycleComponent
-
setExceptionHandler
Description copied from interface:LifecycleComponentSet the default handler invoked when a lifecycle component abruptly terminates due an uncaught exception.- Specified by:
setExceptionHandlerin interfaceLifecycleComponent- Parameters:
handler- handler invoked when an uncaught exception happens in the lifecycle component.
-