use of act.event.meta.SimpleEventListenerMetaInfo in project actframework by actframework.
the class SimpleEventListenerByteCodeScanner method scanFinished.
@Override
public void scanFinished(String className) {
if (!metaInfoList.isEmpty()) {
final EventBus eventBus = app().eventBus();
JobManager jobManager = app().jobManager();
for (final SimpleEventListenerMetaInfo metaInfo : metaInfoList) {
SysEventId hookOn = metaInfo.beforeAppStart() ? SysEventId.DEPENDENCY_INJECTOR_PROVISIONED : SysEventId.PRE_START;
jobManager.on(hookOn, new Runnable() {
@Override
public void run() {
for (final Object event : metaInfo.events()) {
final boolean isStatic = metaInfo.isStatic();
eventBus.bind(event, new ReflectedSimpleEventListener(metaInfo.className(), metaInfo.methodName(), metaInfo.paramTypes(), isStatic));
}
}
});
}
}
}
Aggregations