2012-02-25 15:55:47 +00:00
|
|
|
package de.ctdo.websocket;
|
|
|
|
|
|
|
|
import javax.servlet.ServletConfig;
|
|
|
|
import javax.servlet.ServletException;
|
2012-02-26 00:47:08 +00:00
|
|
|
import javax.servlet.annotation.WebServlet;
|
2012-02-25 15:55:47 +00:00
|
|
|
import javax.servlet.http.HttpServlet;
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
import com.sun.grizzly.websockets.WebSocketEngine;
|
|
|
|
|
2012-03-01 23:51:12 +00:00
|
|
|
|
2012-02-26 00:47:08 +00:00
|
|
|
public class BuntiControllerServlet extends HttpServlet {
|
2012-02-25 15:55:47 +00:00
|
|
|
private static final long serialVersionUID = 1L;
|
2012-02-26 00:47:08 +00:00
|
|
|
Logger logger = LoggerFactory.getLogger(BuntiControllerServlet.class);
|
2012-02-25 15:55:47 +00:00
|
|
|
|
2012-02-26 00:47:08 +00:00
|
|
|
private final BuntiControllerApplication app = new BuntiControllerApplication();
|
2012-02-25 15:55:47 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void init(ServletConfig config) throws ServletException {
|
|
|
|
WebSocketEngine.getEngine().register(app);
|
2012-03-01 23:51:12 +00:00
|
|
|
logger.debug("registered BuntiControllerApplication");
|
2012-02-25 15:55:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void destroy() {
|
|
|
|
WebSocketEngine.getEngine().unregister(app);
|
2012-03-01 23:51:12 +00:00
|
|
|
logger.debug("unregistered BuntiControllerApplication");
|
2012-02-25 15:55:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|