public abstract class AbstractSmartLifecycle extends Object implements ApplicationContextAware, SmartLifecycle
AbstractSmartLifecycle
is an abstract base class implementing the SpringSmartLifecycle
interface
to support custom implementations.SmartLifecycle
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_PHASE |
Constructor and Description |
---|
AbstractSmartLifecycle() |
Modifier and Type | Method and Description |
---|---|
protected Optional<ApplicationContext> |
getApplicationContext() |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
protected ApplicationContext |
requireApplicationContext() |
void |
setApplicationContext(ApplicationContext applicationContext) |
protected void |
setRunning(boolean running) |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
protected static final int DEFAULT_PHASE
public boolean isAutoStartup()
isAutoStartup
in interface SmartLifecycle
protected void setRunning(boolean running)
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
BeansException
protected Optional<ApplicationContext> getApplicationContext()
protected ApplicationContext requireApplicationContext()
public int getPhase()
getPhase
in interface Phased
getPhase
in interface SmartLifecycle
public void stop(Runnable callback)
stop
in interface SmartLifecycle
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.