Skip to content
Snippets Groups Projects
Commit ab40d47e authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Fix Spring event handling for Socket.IO server

parent a3f90113
Branches
Tags
No related merge requests found
...@@ -22,6 +22,7 @@ import org.springframework.context.ApplicationListener; ...@@ -22,6 +22,7 @@ import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import de.thm.arsnova.events.NovaEvent; import de.thm.arsnova.events.NovaEvent;
import de.thm.arsnova.events.NovaEventVisitor;
/** /**
* An external Listener is required because otherwise the event methods are not called through a Spring proxy. * An external Listener is required because otherwise the event methods are not called through a Spring proxy.
...@@ -31,11 +32,11 @@ import de.thm.arsnova.events.NovaEvent; ...@@ -31,11 +32,11 @@ import de.thm.arsnova.events.NovaEvent;
public class ARSnovaSocketListener implements ApplicationListener<NovaEvent> { public class ARSnovaSocketListener implements ApplicationListener<NovaEvent> {
@Autowired @Autowired
private ARSnovaSocketIOServer socketServer; private ARSnovaSocket socketServer;
@Override @Override
public void onApplicationEvent(NovaEvent event) { public void onApplicationEvent(NovaEvent event) {
event.accept(socketServer); event.accept((NovaEventVisitor) socketServer);
} }
} }
...@@ -40,4 +40,6 @@ ...@@ -40,4 +40,6 @@
</bean> </bean>
<bean id="databaseDao" class="de.thm.arsnova.dao.CouchDBDao" /> <bean id="databaseDao" class="de.thm.arsnova.dao.CouchDBDao" />
<bean id="socketListener" class="de.thm.arsnova.socket.ARSnovaSocketListener" />
</beans> </beans>
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