-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstatic.go
More file actions
39 lines (32 loc) · 820 Bytes
/
Copy pathstatic.go
File metadata and controls
39 lines (32 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package behavior
import (
"github.com/alkaid/behavior/handle"
)
var globalClassLoader = NewClassLoader()
var handlerPool = handle.NewHandlerPool()
var treeRegistry = NewTreeRegistry()
// GlobalClassLoader 全局类加载器
//
// @return *ClassLoader
func GlobalClassLoader() *ClassLoader {
return globalClassLoader
}
// GlobalHandlerPool 全局反射代理缓存池
//
// @return *handle.HandlerPool
func GlobalHandlerPool() *handle.HandlerPool {
return handlerPool
}
func GlobalTreeRegistry() *TreeRegistry {
return treeRegistry
}
func SetGlobalTreeRegistry(registry *TreeRegistry) {
treeRegistry = registry
}
// RegisterDelegatorType 注册代理类的反射信息
//
// @param name
// @param target
func RegisterDelegatorType(name string, target any) error {
return handlerPool.Register(name, target)
}