Commit 30b99839 authored by michael.simon's avatar michael.simon
Browse files

Remove circular reference

parent bb5f56b5
......@@ -127,8 +127,7 @@ public class ApplicationBootstrap {
}
logger.info("Initializing Hooks");
hookManager.reloadUserHooks();
hookManager.reloadGroupHooks();
hookManager.reloadHooks();
userService.convertLegacyUsers();
......@@ -153,16 +152,6 @@ public class ApplicationBootstrap {
standardScheduler.initialize();
}
public void reloadConfig() {
boolean reloaded = appConfig.reload();
if (reloaded) {
logger.info("Reloading Hooks");
hookManager.reloadUserHooks();
hookManager.reloadGroupHooks();
}
}
private void checkGroup(String name, Integer createActual) {
GroupEntity entity = groupService.findByName(name);
if (entity == null) {
......
......@@ -41,6 +41,13 @@ public class HookManager {
userHooks = new HashSet<UserServiceHook>();
}
public void reloadHooks() {
logger.info("Reloading User Hooks");
reloadUserHooks();
logger.info("Reloading Group Hooks");
reloadGroupHooks();
}
public void reloadUserHooks() {
Set<UserServiceHook> newUserHooks = new HashSet<UserServiceHook>();
......
......@@ -26,7 +26,7 @@ import javax.inject.Inject;
import org.slf4j.Logger;
import edu.kit.scc.webreg.bootstrap.ApplicationBootstrap;
import edu.kit.scc.webreg.bootstrap.ApplicationConfig;
import edu.kit.scc.webreg.bootstrap.NodeConfiguration;
import edu.kit.scc.webreg.drools.BpmProcessService;
import edu.kit.scc.webreg.entity.JobClassEntity;
......@@ -34,6 +34,7 @@ import edu.kit.scc.webreg.entity.JobScheduleEntity;
import edu.kit.scc.webreg.job.ExecutableJob;
import edu.kit.scc.webreg.service.JobClassService;
import edu.kit.scc.webreg.service.JobScheduleService;
import edu.kit.scc.webreg.service.impl.HookManager;
@Singleton
public class StandardSchedulerImpl implements StandardScheduler, Serializable {
......@@ -62,7 +63,10 @@ public class StandardSchedulerImpl implements StandardScheduler, Serializable {
private BpmProcessService bpmProcessService;
@Inject
private ApplicationBootstrap appBootstrap;
private ApplicationConfig appConfig;
@Inject
private HookManager hookManager;
@Override
public void initialize() {
......@@ -159,7 +163,13 @@ public class StandardSchedulerImpl implements StandardScheduler, Serializable {
bpmProcessService.reload();
// Reload App Config here
appBootstrap.reloadConfig();
boolean reloaded = appConfig.reload();
// Reload Hooks if app config was reloaded
if (reloaded) {
hookManager.reloadHooks();
}
}
private void cancelTimer(Timer t) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment