Skip to content

Commit

Permalink
Code clean up.
Browse files Browse the repository at this point in the history
Signed-off-by: Presti <dxssucuk@hotmail.com>
  • Loading branch information
DxsSucuk committed Oct 10, 2024
1 parent c880360 commit 03ea599
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ private CustomEventContainerCreator() {
* Load all actions.
*/
public static void loadAll() {
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
configurationBuilder.addClassLoaders(ClasspathHelper.staticClassLoader());
Reflections reflections = new Reflections(configurationBuilder);
Set<Class<? extends IEventAction>> classes = reflections.getSubTypesOf(IEventAction.class);

for (Class<? extends IEventAction> aClass : classes) {
if (aClass.isAnnotationPresent(ActionInfo.class)) {
String actionName = aClass.getAnnotation(ActionInfo.class).name();
if (!cachedActions.containsKey(actionName)) {
cachedActions.put(actionName, aClass);
}
}
}
}

/**
Expand Down

0 comments on commit 03ea599

Please sign in to comment.