mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 21:15:56 +08:00
Refactor: replace eventpp with a small typed event bus
- libagent: rewrite EventBus as a type-safe dispatcher keyed by event type; listeners are invoked with the concrete event type instead of 'const void*', and the bus is mutex-protected - libagent: services subscribe/unsubscribe by event type (IService::listen no longer takes an EventId) - libagent: remove the unused MethodEntry/MethodExit events and EventMethodEntry/EventMethodExit structs - build: drop the in-tree eventpp headers (23 files) and its license
This commit is contained in:
1 parent
4c3798735b
commit
5b0a26d49e
31 files changed
+101
-5481
No files matched your search
@@ -5,6 +5,7 @@
|
||||
#include <jni_common.hpp>
|
||||
#include <services.hpp>
|
||||
#include <eventbus.hpp>
|
||||
#include <event/event_type.hpp>
|
||||
|
||||
namespace JuiceAgent {
|
||||
// Singleton
|
||||
@@ -59,7 +60,7 @@ namespace JuiceAgent {
|
||||
// Post preload event (after environment is set so listeners
|
||||
// can access the agent state via Agent::getInstance())
|
||||
EventPreLoad preloadEvent{ jvm, env, jvmti };
|
||||
EventBus::getInstance().post(EventId::PreLoad, &preloadEvent);
|
||||
EventBus::getInstance().post(preloadEvent);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -112,7 +113,7 @@ namespace JuiceAgent {
|
||||
|
||||
// Post loaded event
|
||||
EventLoaded loadedEvent{ getJavaVM(), getJNIEnv(), getJVMTI() };
|
||||
EventBus::getInstance().post(EventId::Loaded, &loadedEvent);
|
||||
EventBus::getInstance().post(loadedEvent);
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user