- java.lang.Object
-
- org.redkale.boot.ModuleEngine
-
- 直接已知子类:
CachedModuleEngine
,ClusterModuleEngine
,LockedModuleEngine
,MessageModuleEngine
,ScheduledModuleEngine
,SourceModuleEngine
public abstract class ModuleEngine extends Object
各组件的引擎类, 由Application管理详情见: https://redkale.org
- 从以下版本开始:
- 2.8.0
- 作者:
- zhangjx
-
-
字段概要
字段 修饰符和类型 字段 说明 protected Application
application
protected Environment
environment
protected Logger
logger
protected ResourceFactory
resourceFactory
-
构造器概要
构造器 构造器 说明 ModuleEngine(Application application)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 org.redkale.asm.AsmMethodBoost
createAsmMethodBoost(boolean remote, Class serviceClass)
动态扩展类的方法Application
getApplication()
Environment
getEnvironment()
ResourceFactory
getResourceFactory()
AnyValue.MergeEnum
mergeAppConfigStrategy(String path, String key, AnyValue val1, AnyValue val2)
判断模块的配置项合并策略, 返回null表示模块不识别此配置项void
onAppPostInit()
结束Application.init方法前被调用void
onAppPostShutdown()
结束Application.shutdown方法前被调用void
onAppPostStart()
结束Application.start方法前被调用void
onAppPreInit()
进入Application.init方法时被调用 此时状态: 1、远程配置项未获取 2、WorkExecutor未初始化void
onAppPreShutdown()
进入Application.shutdown方法被调用void
onAppPreStart()
进入Application.start方法被调用void
onEnvironmentChanged(String namespace, List<ResourceEvent> events)
配置项变更时被调用void
onEnvironmentLoaded(Properties allProps)
配置项加载后被调用void
onPostCompile()
Application 在运行Compile后调用void
onPreCompile()
Application 在运行Compile前调用void
onServersPostStart()
服务全部启动后被调用void
onServersPostStop()
服务全部停掉后被调用void
onServersPreStart()
服务全部启动前被调用void
onServersPreStop()
服务全部停掉前被调用void
onServicePostDestroy(NodeServer server, Service service)
执行Service.destroy方法后被调用void
onServicePostInit(NodeServer server, Service service)
执行Service.init方法后被调用void
onServicePreDestroy(NodeServer server, Service service)
执行Service.destroy方法前被调用void
onServicePreInit(NodeServer server, Service service)
执行Service.init方法前被调用
-
-
-
字段详细资料
-
logger
protected final Logger logger
-
application
protected final Application application
-
resourceFactory
protected final ResourceFactory resourceFactory
-
environment
protected final Environment environment
-
-
构造器详细资料
-
ModuleEngine
public ModuleEngine(Application application)
-
-
方法详细资料
-
getResourceFactory
public final ResourceFactory getResourceFactory()
-
getEnvironment
public final Environment getEnvironment()
-
getApplication
public final Application getApplication()
-
mergeAppConfigStrategy
public AnyValue.MergeEnum mergeAppConfigStrategy(String path, String key, AnyValue val1, AnyValue val2)
判断模块的配置项合并策略, 返回null表示模块不识别此配置项- 参数:
path
- 配置项路径key
- 配置项名称val1
- 配置项原值val2
- 配置项新值- 返回:
- MergeEnum
-
createAsmMethodBoost
public org.redkale.asm.AsmMethodBoost createAsmMethodBoost(boolean remote, Class serviceClass)
动态扩展类的方法- 参数:
remote
- 是否远程模式serviceClass
- 类- 返回:
- 方法动态扩展器
-
onAppPreInit
public void onAppPreInit()
进入Application.init方法时被调用 此时状态: 1、远程配置项未获取 2、WorkExecutor未初始化
-
onAppPostInit
public void onAppPostInit()
结束Application.init方法前被调用
-
onAppPreStart
public void onAppPreStart()
进入Application.start方法被调用
-
onAppPostStart
public void onAppPostStart()
结束Application.start方法前被调用
-
onEnvironmentLoaded
public void onEnvironmentLoaded(Properties allProps)
配置项加载后被调用- 参数:
allProps
- 配置项全量
-
onEnvironmentChanged
public void onEnvironmentChanged(String namespace, List<ResourceEvent> events)
配置项变更时被调用- 参数:
namespace
- 命名空间events
- 变更项
-
onPreCompile
public void onPreCompile()
Application 在运行Compile前调用
-
onPostCompile
public void onPostCompile()
Application 在运行Compile后调用
-
onServersPreStart
public void onServersPreStart()
服务全部启动前被调用
-
onServersPostStart
public void onServersPostStart()
服务全部启动后被调用
-
onServicePreInit
public void onServicePreInit(NodeServer server, Service service)
执行Service.init方法前被调用- 参数:
server
- NodeServerservice
- Service
-
onServicePostInit
public void onServicePostInit(NodeServer server, Service service)
执行Service.init方法后被调用- 参数:
server
- NodeServerservice
- Service
-
onServicePreDestroy
public void onServicePreDestroy(NodeServer server, Service service)
执行Service.destroy方法前被调用- 参数:
server
- NodeServerservice
- Service
-
onServicePostDestroy
public void onServicePostDestroy(NodeServer server, Service service)
执行Service.destroy方法后被调用- 参数:
server
- NodeServerservice
- Service
-
onServersPreStop
public void onServersPreStop()
服务全部停掉前被调用
-
onServersPostStop
public void onServersPostStop()
服务全部停掉后被调用
-
onAppPreShutdown
public void onAppPreShutdown()
进入Application.shutdown方法被调用
-
onAppPostShutdown
public void onAppPostShutdown()
结束Application.shutdown方法前被调用
-
-