All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.basex.http.ws.WsServlet Maven / Gradle / Ivy

There is a newer version: 11.6
Show newest version
package org.basex.http.ws;

import java.io.*;
import java.time.*;

import org.basex.http.*;
import org.eclipse.jetty.websocket.server.*;

import jakarta.servlet.*;

/**
 * WebSocket servlet.
 *
 * @author BaseX Team, BSD License
 * @author Johannes Finckh
 */
public final class WsServlet extends JettyWebSocketServlet {
  @Override
  public void configure(final JettyWebSocketServletFactory factory) {
    factory.setIdleTimeout(Duration.ofHours(1));
    factory.setCreator(new WsCreator());
  }

  @Override
  public void init(final ServletConfig config) throws ServletException {
    super.init(config);
    try {
      HTTPContext.get().init(config.getServletContext());
    } catch(final IOException ex) {
      throw new ServletException(ex);
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy