Class LifecycleComponentStack
- java.lang.Object
-
- org.apache.bookkeeper.common.component.LifecycleComponentStack
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,LifecycleComponent
public class LifecycleComponentStack extends java.lang.Object implements LifecycleComponent
A stack ofLifecycleComponent
s.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LifecycleComponentStack.Builder
Builder to build a stack ofLifecycleComponent
s.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLifecycleListener(LifecycleListener listener)
void
close()
LifecycleComponent
getComponent(int index)
java.lang.String
getName()
int
getNumComponents()
Lifecycle.State
lifecycleState()
static LifecycleComponentStack.Builder
newBuilder()
void
publishInfo(ComponentInfoPublisher componentInfoPublisher)
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()
-
-
-
Method Detail
-
newBuilder
public static LifecycleComponentStack.Builder newBuilder()
-
getNumComponents
public int getNumComponents()
-
getComponent
public LifecycleComponent getComponent(int index)
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceLifecycleComponent
-
lifecycleState
public Lifecycle.State lifecycleState()
- Specified by:
lifecycleState
in interfaceLifecycleComponent
-
addLifecycleListener
public void addLifecycleListener(LifecycleListener listener)
- Specified by:
addLifecycleListener
in interfaceLifecycleComponent
-
removeLifecycleListener
public void removeLifecycleListener(LifecycleListener listener)
- Specified by:
removeLifecycleListener
in interfaceLifecycleComponent
-
publishInfo
public void publishInfo(ComponentInfoPublisher componentInfoPublisher)
- Specified by:
publishInfo
in interfaceLifecycleComponent
-
start
public void start()
- Specified by:
start
in interfaceLifecycleComponent
-
stop
public void stop()
- Specified by:
stop
in interfaceLifecycleComponent
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceLifecycleComponent
-
setExceptionHandler
public void setExceptionHandler(java.lang.Thread.UncaughtExceptionHandler handler)
Description copied from interface:LifecycleComponent
Set the default handler invoked when a lifecycle component abruptly terminates due an uncaught exception.- Specified by:
setExceptionHandler
in interfaceLifecycleComponent
- Parameters:
handler
- handler invoked when an uncaught exception happens in the lifecycle component.
-
-