This commit is contained in:
Lucas Pleß 2012-03-02 01:18:14 +01:00
parent 0bd6c5acf7
commit 842f3aa8e8
2 changed files with 29 additions and 12 deletions

View File

@ -2,6 +2,7 @@ package de.ctdo.websocket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import com.sun.grizzly.tcp.Request;
import com.sun.grizzly.websockets.ProtocolHandler;
@ -11,6 +12,7 @@ import com.sun.grizzly.websockets.WebSocketListener;
import de.ctdo.control.BuntiController;
@Component
public class BuntiControllerApplication extends WebSocketApplication {
Logger logger = LoggerFactory.getLogger(BuntiControllerApplication.class);

View File

@ -7,26 +7,41 @@ import javax.servlet.http.HttpServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.sun.grizzly.websockets.WebSocketEngine;
public class BuntiControllerServlet extends HttpServlet {
// das klappt so jedenfalls alles noch nicht :)
@Component
public class BuntiControllerServlet { // extends HttpServlet {
private static final long serialVersionUID = 1L;
Logger logger = LoggerFactory.getLogger(BuntiControllerServlet.class);
private final BuntiControllerApplication app = new BuntiControllerApplication();
@Override
public void init(ServletConfig config) throws ServletException {
WebSocketEngine.getEngine().register(app);
logger.debug("registered BuntiControllerApplication");
private BuntiControllerApplication app;
@Autowired
public void setApp(BuntiControllerApplication app) {
this.app = app;
}
@Override
public void destroy() {
WebSocketEngine.getEngine().unregister(app);
logger.debug("unregistered BuntiControllerApplication");
public void BuntiControllerApplication() {
// WebSocketEngine.getEngine().register(app);
// logger.debug("registered BuntiControllerApplication");
}
// @Override
// public void init(ServletConfig config) throws ServletException {
// WebSocketEngine.getEngine().register(app);
// logger.debug("registered BuntiControllerApplication");
// }
//
// @Override
// public void destroy() {
// WebSocketEngine.getEngine().unregister(app);
// logger.debug("unregistered BuntiControllerApplication");
// }
}