@Component public class AnnotationScan extends Object implements org.springframework.context.SmartLifecycle
| Constructor and Description |
|---|
AnnotationScan() |
| Modifier and Type | Method and Description |
|---|---|
int |
getPhase()
如果工程中有多个实现接口SmartLifecycle的类,则这些类的start的执行顺序按getPhase方法返回值从小到大执行。
例如:1比2先执行,-1比0先执行。 stop方法的执行顺序则相反,getPhase返回值较大类的stop方法先被调用,小的后被调用。 |
boolean |
isAutoStartup()
根据该方法的返回值决定是否执行start方法。
返回true时start方法会被自动执行,返回false则不会。 |
boolean |
isRunning()
1.
|
void |
start()
1.
|
void |
stop()
接口Lifecycle的子类的方法,只有非SmartLifecycle的子类才会执行该方法。
1. |
void |
stop(Runnable callback)
SmartLifecycle子类的才有的方法,当isRunning方法返回true时,该方法才会被调用。
|
public static final String BANNE_JBA
public void start()
start in interface org.springframework.context.Lifecyclepublic int getPhase()
getPhase in interface org.springframework.context.Phasedpublic boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic void stop(Runnable callback)
stop in interface org.springframework.context.SmartLifecyclepublic void stop()
stop in interface org.springframework.context.LifecycleCopyright © 2019. All rights reserved.