mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 21:15:56 +08:00
Feat: add event bus and service framework
- introduce EventBus singleton wrapping eventpp::EventDispatcher with typed event ids and const void* payloads - post EventClassFileLoadHook from ClassFileLoadHook callback - add IService base with typed listen<>() helper that binds a member function directly to an event, no virtual onEvent dispatch - add ServiceManager to register, initialize and shutdown services - add BytecodeService that subscribes to ClassFileLoadHook - wire Services::initializeAll() into Agent::init()
This commit is contained in:
1 parent
6bf2d31798
commit
6962c4a477
9 files changed
+258
-3
No files matched your search
@@ -3,6 +3,7 @@
|
||||
#include <JuiceAgent.hpp>
|
||||
#include <JuiceAgent/Config.hpp>
|
||||
#include <jni_common.hpp>
|
||||
#include <services.hpp>
|
||||
|
||||
namespace JuiceAgent {
|
||||
// Singleton
|
||||
@@ -93,6 +94,12 @@ namespace JuiceAgent {
|
||||
spdlog::error("[JuiceAgent] Could not enable JVMTI event notifications: {}", result);
|
||||
}
|
||||
|
||||
// Initialize services (and their plugins)
|
||||
if(!JuiceAgent::Services::initializeAll()) {
|
||||
spdlog::error("[JuiceAgent] Failed to initialize services");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user