Class HandlerRegistration
java.lang.Object
top.magstar.framework.events.models.HandlerRegistration
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionHandlerRegistration(Class<?> eventType, EventHandler<?> handler, int priority, boolean isAsync, String pluginName) HandlerRegistration(Class<?> eventType, EventHandler<?> handler, int priority, boolean isAsync, String pluginName, Object listenerInstance) -
Method Summary
Modifier and TypeMethodDescriptionboolean检查是否属于指定的监听器实例booleanbelongsToPlugin(String pluginName) 检查是否属于指定的插件booleandouble获取平均执行时间获取处理器描述Class<?> 获取事件类型<T> EventHandler<T> 获取事件处理器获取处理器IDlong获取调用次数获取最后异常long获取最后调用时间long获取存活时间获取监听器实例获取性能统计信息获取插件名称int获取优先级long获取注册时间long获取总执行时间booleanhasHandler(EventHandler<?> handler) 检查处理器是否匹配inthashCode()booleanisAsync()是否为异步处理器booleanisHotspot(long threshold) 检查是否为热点处理器(高频调用)booleanisSlow(double thresholdMs) 检查是否为慢处理器voidrecordFailure(long executionTimeMs, Exception exception) 记录失败调用voidrecordInvocation(long executionTimeMs) 记录成功调用toString()
-
Constructor Details
-
HandlerRegistration
public HandlerRegistration(Class<?> eventType, EventHandler<?> handler, int priority, boolean isAsync, String pluginName) -
HandlerRegistration
public HandlerRegistration(Class<?> eventType, EventHandler<?> handler, int priority, boolean isAsync, String pluginName, Object listenerInstance)
-
-
Method Details
-
getEventType
获取事件类型 -
getHandler
获取事件处理器 -
getPriority
public int getPriority()获取优先级 -
isAsync
public boolean isAsync()是否为异步处理器 -
getPluginName
获取插件名称 -
getListenerInstance
-
getRegistrationTime
public long getRegistrationTime()获取注册时间 -
getHandlerId
获取处理器ID -
getInvocationCount
public long getInvocationCount()获取调用次数 -
getTotalExecutionTime
public long getTotalExecutionTime()获取总执行时间 -
getAverageExecutionTime
public double getAverageExecutionTime()获取平均执行时间 -
getLastInvocationTime
public long getLastInvocationTime()获取最后调用时间 -
getLastException
-
getLifetime
public long getLifetime()获取存活时间 -
recordInvocation
public void recordInvocation(long executionTimeMs) 记录成功调用 -
recordFailure
记录失败调用 -
belongsTo
检查是否属于指定的监听器实例 -
belongsToPlugin
检查是否属于指定的插件 -
hasHandler
检查处理器是否匹配 -
isHotspot
public boolean isHotspot(long threshold) 检查是否为热点处理器(高频调用) -
isSlow
public boolean isSlow(double thresholdMs) 检查是否为慢处理器 -
getDescription
获取处理器描述 -
getPerformanceStats
获取性能统计信息 -
equals
-
hashCode
-
toString
-