Package org.opensearch.common.lifecycle
Class AbstractLifecycleComponent
java.lang.Object
org.opensearch.common.lifecycle.AbstractLifecycleComponent
- All Implemented Interfaces:
Closeable,AutoCloseable,Releasable,LifecycleComponent
Base class for a lifecycle component.
- Opensearch.internal:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLifecycleListener(LifecycleListener listener) voidclose()protected abstract voiddoClose()protected abstract voiddoStart()protected abstract voiddoStop()voidremoveLifecycleListener(LifecycleListener listener) voidstart()voidstop()
-
Field Details
-
lifecycle
-
-
Constructor Details
-
AbstractLifecycleComponent
protected AbstractLifecycleComponent()
-
-
Method Details
-
lifecycleState
- Specified by:
lifecycleStatein interfaceLifecycleComponent
-
addLifecycleListener
- Specified by:
addLifecycleListenerin interfaceLifecycleComponent
-
removeLifecycleListener
- Specified by:
removeLifecycleListenerin interfaceLifecycleComponent
-
start
public void start()- Specified by:
startin interfaceLifecycleComponent
-
doStart
protected abstract void doStart() -
stop
public void stop()- Specified by:
stopin interfaceLifecycleComponent
-
doStop
protected abstract void doStop() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceReleasable
-
doClose
- Throws:
IOException
-