Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @WebServlet(urlPatterns = "/copylobby", asyncSupported = true, loadOnStartup = 1)
- public class CopyOfWebSocketLobbyServlet extends WebSocketServlet implements
- IWebSocketLobby {
- private static final long serialVersionUID = 2844592471347413432L;
- private final Logger LOGGER = LoggerFactory.getLogger(getClass().getName());
- @Inject
- private ObjectMapper jsonProvider;
- public void init() throws ServletException {
- LOGGER.info("Initialize Lobby WebSocket servlet");
- super.init();
- }
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.catalina.websocket.WebSocketServlet#createWebSocketInbound
- * (java.lang.String, javax.servlet.http.HttpServletRequest)
- */
- @Override
- protected StreamInbound createWebSocketInbound(String arg0,
- HttpServletRequest request) {
- // do sth...
- }
- @Override
- public void addConnection(LobbyKey lobbyKey,
- AbstractLobbyMessageInbound lobbyConnection) {
- LOGGER.info("adding a connection + {}", jsonProvider.getClass()
- .getSimpleName());
- }
- @Override
- public void removeConnection(LobbyKey lobbyKey,
- AbstractLobbyMessageInbound lobbyConnection) {
- LOGGER.info("removing a connection + {}", jsonProvider.getClass()
- .getSimpleName());
- }
- @Override
- public void processTextCommand(String jsonCommand,
- AbstractLobbyMessageInbound lobbyConnection) {
- LOGGER.info("processing a message: |{}|", jsonCommand);
- LOGGER.info("message + {}", jsonProvider.getClass().getSimpleName());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment