Class Runners
java.lang.Object
com.iohao.net.framework.core.runner.Runners
Manages the lifecycle of
Runner instances registered with a BarSkeleton.
Runners are invoked in two phases:
onStart()-- before the network connection is established.onStartAfter()-- after the network connection is established (delayed by one second).
onStart() has been called will throw an exception.- Author:
- 渔民小镇
- See Also:
- date:
- 2023-04-23
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegister a runner to be executed during the startup lifecycle.Return the display names of all registered runners.voidonStart()Execute all runners'Runner.onStart(BarSkeleton)callbacks (idempotent).voidExecute all runners'Runner.onStartAfter(BarSkeleton)callbacks (idempotent, delayed).voidsetBarSkeleton(BarSkeleton barSkeleton)
-
Constructor Details
-
Runners
public Runners()Create a new instance and register internal runners.
-
-
Method Details
-
addRunner
Register a runner to be executed during the startup lifecycle.- Parameters:
runner- the runner to add (must not be null)- Throws:
RuntimeException- if runners have already been started
-
onStart
public void onStart()Execute all runners'Runner.onStart(BarSkeleton)callbacks (idempotent). -
onStartAfter
public void onStartAfter()Execute all runners'Runner.onStartAfter(BarSkeleton)callbacks (idempotent, delayed). -
listRunnerName
-
getRunnerList
-
setBarSkeleton
-