Package io.camunda.zeebe.spring.util
Class ZeebeAutoStartUpLifecycle<T extends AutoCloseable>
- java.lang.Object
-
- io.camunda.zeebe.spring.util.ZeebeAutoStartUpLifecycle<T>
-
- Type Parameters:
T- type of delegate to start/stop
- All Implemented Interfaces:
Supplier<T>,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
public abstract class ZeebeAutoStartUpLifecycle<T extends AutoCloseable> extends Object implements org.springframework.context.SmartLifecycle, Supplier<T>
Implementation ofSmartLifecyclethat delegates to a delegate of typeTand defaults toautostart.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanautoStartupprotected Tdelegateprotected ZeebeObjectFactory<T>factoryprotected intphaseprotected booleanrunning
-
Constructor Summary
Constructors Constructor Description ZeebeAutoStartUpLifecycle(int phase, ZeebeObjectFactory<T> factory)Creates a new lifecycle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()intgetPhase()booleanisAutoStartup()booleanisRunning()voidstart()voidstop()voidstop(Runnable callback)
-
-
-
Field Detail
-
autoStartup
protected boolean autoStartup
-
running
protected boolean running
-
phase
protected final int phase
-
factory
protected final ZeebeObjectFactory<T extends AutoCloseable> factory
-
delegate
protected T extends AutoCloseable delegate
-
-
Constructor Detail
-
ZeebeAutoStartUpLifecycle
public ZeebeAutoStartUpLifecycle(int phase, ZeebeObjectFactory<T> factory)Creates a new lifecycle.- Parameters:
phase- the phase to run in
-
-
Method Detail
-
get
public T get()
- Specified by:
getin interfaceSupplier<T extends AutoCloseable>
-
isAutoStartup
public boolean isAutoStartup()
- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
start
public void start()
- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop(Runnable callback)
- Specified by:
stopin interfaceorg.springframework.context.SmartLifecycle
-
stop
public void stop()
- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()
- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
getPhase
public int getPhase()
- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-
-