类 RpcModule
- java.lang.Object
-
- network.nerve.core.rpc.modulebootstrap.RpcModule
-
- 所有已实现的接口:
InitializingBean
public abstract class RpcModule extends Object implements InitializingBean
-
-
构造器概要
构造器 构造器 说明 RpcModule()
-
方法概要
所有方法 静态方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 voidafterPropertiesSet()该方法在所有属性被设置之后调用,用于辅助对象初始化 This method is invoked after all properties are set, and is used to assist object initialization.abstract Module[]declareDependent()申明此模块的依赖模块abstract booleandoStart()已完成spring init注入,开始启动模块 模块进入ready状态前的准备工作,模块启动时触发 如果准备完毕返回true 条件未达到返回falseSet<Module>getDependencies()Map<Module,Boolean>getFollowerList()protected StringgetLanguagePath()NotifySendergetNotifySender()protected StringgetRole()static StringgetROLE()Set<String>getRpcCmdPackage()指定RpcCmd的包名RpcModuleStategetState()protected longgetTryRuningTimeout()booleanhasDependent(ModuleE moduleE)booleanhasDependent(Module module)voidinit()初始化模块 在onStart前会调用此方法protected booleanisDependencieReady()依赖模块都以进入Ready状态booleanisDependencieReady(String moduleName)booleanisDependencieReady(Module module)获取依赖模块的准备状态protected booleanisReady()模块是否已准备好protected booleanisRunning()模块是否已运行abstract ModulemoduleInfo()返回当前模块的描述abstract RpcModuleStateonDependenciesLoss(Module dependenciesModule)某个外部依赖连接丢失后,会调用此方法, 可控制模块状态,如果返回Ready,则表明模块退化到Ready状态,当依赖重新准备完毕后,将重新触发onDependenciesReady方法, 若返回的状态是Running,将不会重新触发onDependenciesReadyabstract RpcModuleStateonDependenciesReady()所有外部依赖进入ready状态后会调用此方法,正常启动后返回Running状态voidonDependenciesReady(Module module)voidsetDependentReadyState(Map<Module,Boolean> dependentReadyState)voidsetFollowerList(Map<Module,Boolean> followerList)voidsetNotifySender(NotifySender notifySender)voidsetState(RpcModuleState state)StringtoString()
-
-
-
方法详细资料
-
afterPropertiesSet
public final void afterPropertiesSet() throws NulsException从接口复制的说明:InitializingBean该方法在所有属性被设置之后调用,用于辅助对象初始化 This method is invoked after all properties are set, and is used to assist object initialization.- 指定者:
afterPropertiesSet在接口中InitializingBean- 抛出:
NulsException
-
getTryRuningTimeout
protected long getTryRuningTimeout()
-
getRole
protected String getRole()
-
isRunning
protected boolean isRunning()
模块是否已运行- 返回:
-
isReady
protected boolean isReady()
模块是否已准备好- 返回:
-
isDependencieReady
public boolean isDependencieReady(Module module)
获取依赖模块的准备状态- 参数:
module-- 返回:
- true 已准备好
-
hasDependent
public boolean hasDependent(ModuleE moduleE)
-
hasDependent
public boolean hasDependent(Module module)
-
isDependencieReady
public boolean isDependencieReady(String moduleName)
-
isDependencieReady
protected boolean isDependencieReady()
依赖模块都以进入Ready状态
-
declareDependent
public abstract Module[] declareDependent()
申明此模块的依赖模块- 返回:
-
moduleInfo
public abstract Module moduleInfo()
返回当前模块的描述- 返回:
-
onDependenciesReady
public void onDependenciesReady(Module module)
-
init
public void init()
初始化模块 在onStart前会调用此方法
-
doStart
public abstract boolean doStart()
已完成spring init注入,开始启动模块 模块进入ready状态前的准备工作,模块启动时触发 如果准备完毕返回true 条件未达到返回false- 返回:
-
onDependenciesReady
public abstract RpcModuleState onDependenciesReady()
所有外部依赖进入ready状态后会调用此方法,正常启动后返回Running状态- 返回:
-
onDependenciesLoss
public abstract RpcModuleState onDependenciesLoss(Module dependenciesModule)
某个外部依赖连接丢失后,会调用此方法, 可控制模块状态,如果返回Ready,则表明模块退化到Ready状态,当依赖重新准备完毕后,将重新触发onDependenciesReady方法, 若返回的状态是Running,将不会重新触发onDependenciesReady- 参数:
dependenciesModule-- 返回:
-
getLanguagePath
protected String getLanguagePath()
-
getROLE
public static String getROLE()
-
getState
public RpcModuleState getState()
-
setState
public void setState(RpcModuleState state)
-
setDependentReadyState
public void setDependentReadyState(Map<Module,Boolean> dependentReadyState)
-
getNotifySender
public NotifySender getNotifySender()
-
setNotifySender
public void setNotifySender(NotifySender notifySender)
-
-