diff --git a/src/main/java/de/thm/arsnova/config/ExtraConfig.java b/src/main/java/de/thm/arsnova/config/ExtraConfig.java index 0e6ba84af71b0f683501b2501b4f14608f9abc3c..45b375c2351a2774c7c8233fa17fb66d19613020 100644 --- a/src/main/java/de/thm/arsnova/config/ExtraConfig.java +++ b/src/main/java/de/thm/arsnova/config/ExtraConfig.java @@ -33,6 +33,7 @@ import org.springframework.core.io.Resource; import de.thm.arsnova.connector.client.ConnectorClient; import de.thm.arsnova.connector.client.ConnectorClientImpl; +import de.thm.arsnova.socket.ARSnovaSocket; import de.thm.arsnova.socket.ARSnovaSocketIOServer; @Configuration @@ -80,7 +81,7 @@ public class ExtraConfig { @Profile("!test") @Bean(name = "socketServer", initMethod = "startServer", destroyMethod = "stopServer") - public ARSnovaSocketIOServer socketServer() { + public ARSnovaSocket socketServer() { final ARSnovaSocketIOServer socketServer = new ARSnovaSocketIOServer(); socketServer.setHostIp(socketIp); socketServer.setPortNumber(socketPort); @@ -92,7 +93,7 @@ public class ExtraConfig { @Profile("test") @Bean(name = "socketServer", initMethod = "startServer", destroyMethod = "stopServer") - public ARSnovaSocketIOServer socketTestServer() { + public ARSnovaSocket socketTestServer() { final int testSocketPort = 1234; final ARSnovaSocketIOServer socketServer = new ARSnovaSocketIOServer(); socketServer.setHostIp(socketIp); diff --git a/src/main/java/de/thm/arsnova/controller/SocketController.java b/src/main/java/de/thm/arsnova/controller/SocketController.java index 7d5945d809e58a9dcd0d9501f3381758d55b9566..9c698087b26423478f2b23517612b164c4e3a3ee 100644 --- a/src/main/java/de/thm/arsnova/controller/SocketController.java +++ b/src/main/java/de/thm/arsnova/controller/SocketController.java @@ -35,7 +35,7 @@ import org.springframework.web.bind.annotation.RestController; import de.thm.arsnova.entities.User; import de.thm.arsnova.services.IUserService; import de.thm.arsnova.services.UserSessionService; -import de.thm.arsnova.socket.ARSnovaSocketIOServer; +import de.thm.arsnova.socket.ARSnovaSocket; @RestController @RequestMapping("/socket") @@ -48,7 +48,7 @@ public class SocketController extends AbstractController { private UserSessionService userSessionService; @Autowired - private ARSnovaSocketIOServer server; + private ARSnovaSocket server; private static final Logger LOGGER = LoggerFactory.getLogger(SocketController.class); diff --git a/src/main/java/de/thm/arsnova/domain/LearningProgressFactory.java b/src/main/java/de/thm/arsnova/domain/LearningProgressFactory.java index ef69aadcb13a197a2d3516f09a8cbb8fa8419332..ab378a4635b50a47828487fb0e837b60712b1d2a 100644 --- a/src/main/java/de/thm/arsnova/domain/LearningProgressFactory.java +++ b/src/main/java/de/thm/arsnova/domain/LearningProgressFactory.java @@ -26,12 +26,15 @@ import de.thm.arsnova.events.DeleteAllLectureAnswersEvent; import de.thm.arsnova.events.DeleteAllPreparationAnswersEvent; import de.thm.arsnova.events.DeleteAllQuestionsAnswersEvent; import de.thm.arsnova.events.DeleteAnswerEvent; +import de.thm.arsnova.events.DeleteFeedbackForSessionsEvent; import de.thm.arsnova.events.DeleteInterposedQuestionEvent; import de.thm.arsnova.events.DeleteQuestionEvent; import de.thm.arsnova.events.NewAnswerEvent; +import de.thm.arsnova.events.NewFeedbackEvent; import de.thm.arsnova.events.NewInterposedQuestionEvent; import de.thm.arsnova.events.NewQuestionEvent; import de.thm.arsnova.events.NovaEventVisitor; +import de.thm.arsnova.events.StatusSessionEvent; @Component public class LearningProgressFactory implements NovaEventVisitor, ILearningProgressFactory { @@ -82,4 +85,13 @@ public class LearningProgressFactory implements NovaEventVisitor, ILearningProgr @Override public void visit(DeleteAllLectureAnswersEvent event) {} + @Override + public void visit(NewFeedbackEvent newFeedbackEvent) {} + + @Override + public void visit(DeleteFeedbackForSessionsEvent deleteFeedbackEvent) {} + + @Override + public void visit(StatusSessionEvent statusSessionEvent) {} + } diff --git a/src/main/java/de/thm/arsnova/events/DeleteFeedbackForSessionsEvent.java b/src/main/java/de/thm/arsnova/events/DeleteFeedbackForSessionsEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..857e59374c9ca1a8bf87ae40229ff38478bbe38e --- /dev/null +++ b/src/main/java/de/thm/arsnova/events/DeleteFeedbackForSessionsEvent.java @@ -0,0 +1,52 @@ +/* + * This file is part of ARSnova Backend. + * Copyright (C) 2012-2015 The ARSnova Team + * + * ARSnova Backend is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ARSnova Backend is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +package de.thm.arsnova.events; + +import java.util.Set; + +import de.thm.arsnova.entities.Session; +import de.thm.arsnova.entities.User; + +public class DeleteFeedbackForSessionsEvent extends NovaEvent { + + private static final long serialVersionUID = 1L; + + private final Set<Session> sessions; + + private final User user; + + public DeleteFeedbackForSessionsEvent(Object source, Set<Session> sessions, User user) { + super(source); + this.sessions = sessions; + this.user = user; + } + + public Set<Session> getSessions() { + return sessions; + } + + public User getUser() { + return user; + } + + @Override + public void accept(NovaEventVisitor visitor) { + visitor.visit(this); + } + +} diff --git a/src/main/java/de/thm/arsnova/events/NewFeedbackEvent.java b/src/main/java/de/thm/arsnova/events/NewFeedbackEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..c06f84cac7eb727f92425427794b6d1ce194932a --- /dev/null +++ b/src/main/java/de/thm/arsnova/events/NewFeedbackEvent.java @@ -0,0 +1,35 @@ +/* + * This file is part of ARSnova Backend. + * Copyright (C) 2012-2015 The ARSnova Team + * + * ARSnova Backend is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ARSnova Backend is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +package de.thm.arsnova.events; + +import de.thm.arsnova.entities.Session; + +public class NewFeedbackEvent extends SessionEvent { + + private static final long serialVersionUID = 1L; + + public NewFeedbackEvent(Object source, Session session) { + super(source, session); + } + + @Override + public void accept(NovaEventVisitor visitor) { + visitor.visit(this); + } + +} diff --git a/src/main/java/de/thm/arsnova/events/NovaEventVisitor.java b/src/main/java/de/thm/arsnova/events/NovaEventVisitor.java index 75968075ada5649b6c912060fd90de94e8550da4..ab820bf2fa9c0661ffcfdf23a4a7a1053c2f4e57 100644 --- a/src/main/java/de/thm/arsnova/events/NovaEventVisitor.java +++ b/src/main/java/de/thm/arsnova/events/NovaEventVisitor.java @@ -37,4 +37,10 @@ public interface NovaEventVisitor { void visit(DeleteAllLectureAnswersEvent deleteAllLectureAnswersEvent); + void visit(NewFeedbackEvent newFeedbackEvent); + + void visit(DeleteFeedbackForSessionsEvent deleteFeedbackEvent); + + void visit(StatusSessionEvent statusSessionEvent); + } diff --git a/src/main/java/de/thm/arsnova/events/StatusSessionEvent.java b/src/main/java/de/thm/arsnova/events/StatusSessionEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..19034dc9ae13ab7f3ee000cc90d9c99be876a26b --- /dev/null +++ b/src/main/java/de/thm/arsnova/events/StatusSessionEvent.java @@ -0,0 +1,35 @@ +/* + * This file is part of ARSnova Backend. + * Copyright (C) 2012-2015 The ARSnova Team + * + * ARSnova Backend is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ARSnova Backend is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +package de.thm.arsnova.events; + +import de.thm.arsnova.entities.Session; + +public class StatusSessionEvent extends SessionEvent { + + private static final long serialVersionUID = 1L; + + public StatusSessionEvent(Object source, Session session) { + super(source, session); + } + + @Override + public void accept(NovaEventVisitor visitor) { + visitor.visit(this); + } + +} diff --git a/src/main/java/de/thm/arsnova/services/FeedbackService.java b/src/main/java/de/thm/arsnova/services/FeedbackService.java index 7b1782291da0dee937d011b9079a1a6695e52fc7..bb594d0e39d462560c9e1f5e74092c80bd2ac5cf 100644 --- a/src/main/java/de/thm/arsnova/services/FeedbackService.java +++ b/src/main/java/de/thm/arsnova/services/FeedbackService.java @@ -27,6 +27,8 @@ import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationEventPublisher; +import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; @@ -35,18 +37,16 @@ import de.thm.arsnova.dao.IDatabaseDao; import de.thm.arsnova.entities.Feedback; import de.thm.arsnova.entities.Session; import de.thm.arsnova.entities.User; +import de.thm.arsnova.events.DeleteFeedbackForSessionsEvent; +import de.thm.arsnova.events.NewFeedbackEvent; import de.thm.arsnova.exceptions.NoContentException; import de.thm.arsnova.exceptions.NotFoundException; -import de.thm.arsnova.socket.ARSnovaSocketIOServer; @Service -public class FeedbackService implements IFeedbackService { +public class FeedbackService implements IFeedbackService, ApplicationEventPublisherAware { private static final int DEFAULT_SCHEDULER_DELAY = 5000; - @Autowired - private ARSnovaSocketIOServer server; - /** * minutes, after which the feedback is deleted */ @@ -58,6 +58,8 @@ public class FeedbackService implements IFeedbackService { private FeedbackStorage feedbackStorage; + private ApplicationEventPublisher publisher; + public final void setDatabaseDao(final IDatabaseDao newDatabaseDao) { databaseDao = newDatabaseDao; } @@ -96,11 +98,11 @@ public class FeedbackService implements IFeedbackService { for (Map.Entry<User, Set<Session>> entry : affectedSessionsOfUsers.entrySet()) { final User user = entry.getKey(); final Set<Session> arsSessions = entry.getValue(); - server.reportDeletedFeedback(user, arsSessions); + this.publisher.publishEvent(new DeleteFeedbackForSessionsEvent(this, arsSessions, user)); } // For each session that has deleted feedback, send the new feedback to all clients for (Session session : deletedFeedbackOfUsersInSession.keySet()) { - server.reportUpdatedFeedbackForSession(session); + this.publisher.publishEvent(new NewFeedbackEvent(this, session)); } } @@ -152,7 +154,8 @@ public class FeedbackService implements IFeedbackService { throw new NotFoundException(); } feedbackStorage.saveFeedback(session, value, user); - server.reportUpdatedFeedbackForSession(session); + + this.publisher.publishEvent(new NewFeedbackEvent(this, session)); return true; } @@ -164,4 +167,9 @@ public class FeedbackService implements IFeedbackService { } return feedbackStorage.getMyFeedback(session, user); } + + @Override + public void setApplicationEventPublisher(ApplicationEventPublisher publisher) { + this.publisher = publisher; + } } diff --git a/src/main/java/de/thm/arsnova/services/QuestionService.java b/src/main/java/de/thm/arsnova/services/QuestionService.java index 4bff1ebf7f4bc0986abe532be291d0ed416ad7c7..e5a4adfbd5c2a1f348a5828007d2b7aff488b3dc 100644 --- a/src/main/java/de/thm/arsnova/services/QuestionService.java +++ b/src/main/java/de/thm/arsnova/services/QuestionService.java @@ -56,7 +56,6 @@ import de.thm.arsnova.events.NewQuestionEvent; import de.thm.arsnova.exceptions.BadRequestException; import de.thm.arsnova.exceptions.NotFoundException; import de.thm.arsnova.exceptions.UnauthorizedException; -import de.thm.arsnova.socket.ARSnovaSocketIOServer; @Service public class QuestionService implements IQuestionService, ApplicationEventPublisherAware { @@ -67,9 +66,6 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis @Autowired private IUserService userService; - @Autowired - private ARSnovaSocketIOServer socketIoServer; - @Value("${upload.filesize_b}") private int uploadFileSizeByte; diff --git a/src/main/java/de/thm/arsnova/services/SessionService.java b/src/main/java/de/thm/arsnova/services/SessionService.java index 7f3a9f719a809f47d47de212c3080e1196a47f9a..e9b739e1985db2ea91feb804ea7fad73af0b4221 100644 --- a/src/main/java/de/thm/arsnova/services/SessionService.java +++ b/src/main/java/de/thm/arsnova/services/SessionService.java @@ -25,6 +25,8 @@ import java.util.UUID; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationEventPublisher; +import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.stereotype.Service; import org.slf4j.Logger; @@ -41,14 +43,14 @@ import de.thm.arsnova.entities.Session; import de.thm.arsnova.entities.SessionInfo; import de.thm.arsnova.entities.User; import de.thm.arsnova.entities.transport.ImportExportSession; +import de.thm.arsnova.events.StatusSessionEvent; import de.thm.arsnova.exceptions.ForbiddenException; import de.thm.arsnova.exceptions.NotFoundException; import de.thm.arsnova.exceptions.BadRequestException; import de.thm.arsnova.exceptions.RequestEntityTooLargeException; -import de.thm.arsnova.socket.ARSnovaSocketIOServer; @Service -public class SessionService implements ISessionService { +public class SessionService implements ISessionService, ApplicationEventPublisherAware { public static class SessionNameComparator implements Comparator<Session>, Serializable { private static final long serialVersionUID = 1L; @@ -92,9 +94,6 @@ public class SessionService implements ISessionService { @Autowired private IUserService userService; - @Autowired - private ARSnovaSocketIOServer socketIoServer; - @Autowired private ILearningProgressFactory learningProgressFactory; @@ -104,6 +103,8 @@ public class SessionService implements ISessionService { @Value("${pp.logofilesize_b}") private int uploadFileSizeByte; + private ApplicationEventPublisher publisher; + public static final Logger LOGGER = LoggerFactory.getLogger(SessionService.class); public void setDatabaseDao(final IDatabaseDao newDatabaseDao) { @@ -278,7 +279,7 @@ public class SessionService implements ISessionService { throw new ForbiddenException(); } session.setActive(lock); - socketIoServer.reportSessionStatus(sessionkey, lock); + this.publisher.publishEvent(new StatusSessionEvent(this, session)); return databaseDao.updateSession(session); } @@ -337,4 +338,9 @@ public class SessionService implements ISessionService { } return info; } + + @Override + public void setApplicationEventPublisher(ApplicationEventPublisher publisher) { + this.publisher = publisher; + } } diff --git a/src/main/java/de/thm/arsnova/services/UserService.java b/src/main/java/de/thm/arsnova/services/UserService.java index 6ea5398051859444da664560c7b78e94c46902b7..ced1cd28f6984f6f6a9fb1a45608816fd938ea98 100644 --- a/src/main/java/de/thm/arsnova/services/UserService.java +++ b/src/main/java/de/thm/arsnova/services/UserService.java @@ -70,7 +70,6 @@ import de.thm.arsnova.entities.User; import de.thm.arsnova.exceptions.BadRequestException; import de.thm.arsnova.exceptions.NotFoundException; import de.thm.arsnova.exceptions.UnauthorizedException; -import de.thm.arsnova.socket.ARSnovaSocketIOServer; @Service public class UserService implements IUserService { @@ -93,9 +92,6 @@ public class UserService implements IUserService { @Autowired private IDatabaseDao databaseDao; - @Autowired - private ARSnovaSocketIOServer socketIoServer; - @Autowired private JavaMailSender mailSender; diff --git a/src/main/java/de/thm/arsnova/socket/ARSnovaSocket.java b/src/main/java/de/thm/arsnova/socket/ARSnovaSocket.java new file mode 100644 index 0000000000000000000000000000000000000000..4d0351f467b0d497dba5dfc6d3997c03df87f7ba --- /dev/null +++ b/src/main/java/de/thm/arsnova/socket/ARSnovaSocket.java @@ -0,0 +1,31 @@ +/* + * This file is part of ARSnova Backend. + * Copyright (C) 2012-2015 The ARSnova Team + * + * ARSnova Backend is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ARSnova Backend is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +package de.thm.arsnova.socket; + +/** + * This interface is used to auto-wire the Socket Server. + * + * Extend this interface as you see fit. + */ +public interface ARSnovaSocket { + + boolean isUseSSL(); + + int getPortNumber(); + +} \ No newline at end of file diff --git a/src/main/java/de/thm/arsnova/socket/ARSnovaSocketIOServer.java b/src/main/java/de/thm/arsnova/socket/ARSnovaSocketIOServer.java index 59eaa008d0d2bf7ca3e3e01981b87136ee2200f2..e68d991781a86c7a4746c68ffec82002a20085dc 100644 --- a/src/main/java/de/thm/arsnova/socket/ARSnovaSocketIOServer.java +++ b/src/main/java/de/thm/arsnova/socket/ARSnovaSocketIOServer.java @@ -32,7 +32,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Required; -import org.springframework.context.ApplicationListener; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; import com.corundumstudio.socketio.AckRequest; @@ -53,13 +53,15 @@ import de.thm.arsnova.events.DeleteAllLectureAnswersEvent; import de.thm.arsnova.events.DeleteAllPreparationAnswersEvent; import de.thm.arsnova.events.DeleteAllQuestionsAnswersEvent; import de.thm.arsnova.events.DeleteAnswerEvent; +import de.thm.arsnova.events.DeleteFeedbackForSessionsEvent; import de.thm.arsnova.events.DeleteInterposedQuestionEvent; import de.thm.arsnova.events.DeleteQuestionEvent; import de.thm.arsnova.events.NewAnswerEvent; +import de.thm.arsnova.events.NewFeedbackEvent; import de.thm.arsnova.events.NewInterposedQuestionEvent; import de.thm.arsnova.events.NewQuestionEvent; -import de.thm.arsnova.events.NovaEvent; import de.thm.arsnova.events.NovaEventVisitor; +import de.thm.arsnova.events.StatusSessionEvent; import de.thm.arsnova.exceptions.UnauthorizedException; import de.thm.arsnova.exceptions.NoContentException; import de.thm.arsnova.exceptions.NotFoundException; @@ -72,7 +74,7 @@ import de.thm.arsnova.socket.message.Question; import de.thm.arsnova.socket.message.Session; @Component -public class ARSnovaSocketIOServer implements ApplicationListener<NovaEvent>, NovaEventVisitor { +public class ARSnovaSocketIOServer implements ARSnovaSocket, NovaEventVisitor { @Autowired private IFeedbackService feedbackService; @@ -253,6 +255,7 @@ public class ARSnovaSocketIOServer implements ApplicationListener<NovaEvent>, No } + @Override public int getPortNumber() { return portNumber; } @@ -288,6 +291,7 @@ public class ARSnovaSocketIOServer implements ApplicationListener<NovaEvent>, No this.keystore = keystore; } + @Override public boolean isUseSSL() { return useSSL; } @@ -440,6 +444,7 @@ public class ARSnovaSocketIOServer implements ApplicationListener<NovaEvent>, No this.reportAudienceQuestionAvailable(event.getSession(), event.getQuestion()); } + @Async @Override public void visit(NewAnswerEvent event) { final String sessionKey = event.getSession().getKeyword(); @@ -458,6 +463,7 @@ public class ARSnovaSocketIOServer implements ApplicationListener<NovaEvent>, No } } + @Async @Override public void visit(DeleteAnswerEvent event) { final String sessionKey = event.getSession().getKeyword(); @@ -498,7 +504,18 @@ public class ARSnovaSocketIOServer implements ApplicationListener<NovaEvent>, No } @Override - public void onApplicationEvent(NovaEvent event) { - event.accept(this); + public void visit(NewFeedbackEvent event) { + this.reportUpdatedFeedbackForSession(event.getSession()); + } + + @Override + public void visit(DeleteFeedbackForSessionsEvent event) { + this.reportDeletedFeedback(event.getUser(), event.getSessions()); + + } + + @Override + public void visit(StatusSessionEvent event) { + this.reportSessionStatus(event.getSession().getKeyword(), event.getSession().isActive()); } } diff --git a/src/main/java/de/thm/arsnova/socket/ARSnovaSocketListener.java b/src/main/java/de/thm/arsnova/socket/ARSnovaSocketListener.java new file mode 100644 index 0000000000000000000000000000000000000000..68cae59e1920b9c90c026cb10dfa9a8d61c8872b --- /dev/null +++ b/src/main/java/de/thm/arsnova/socket/ARSnovaSocketListener.java @@ -0,0 +1,41 @@ +/* + * This file is part of ARSnova Backend. + * Copyright (C) 2012-2015 The ARSnova Team + * + * ARSnova Backend is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ARSnova Backend is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +package de.thm.arsnova.socket; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationListener; +import org.springframework.stereotype.Component; + +import de.thm.arsnova.events.NovaEvent; + +/** + * An external Listener is required because otherwise the event methods are not called through a Spring proxy. + * This would result in Spring method annotations not working. + */ +@Component +public class ARSnovaSocketListener implements ApplicationListener<NovaEvent> { + + @Autowired + private ARSnovaSocketIOServer socketServer; + + @Override + public void onApplicationEvent(NovaEvent event) { + event.accept(socketServer); + } + +}