Search in sources :

Example 1 with HttpServletDispatcher

use of org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher in project metron by apache.

the class PcapService method main.

public static void main(String[] args) throws IOException {
    PcapServiceCli cli = new PcapServiceCli(args);
    cli.parse();
    ConfigurationUtil.setPcapOutputPath(cli.getPcapHdfsPath());
    LOG.info("Pcap location set to {}", cli.getPcapHdfsPath());
    ConfigurationUtil.setTempQueryOutputPath(cli.getQueryHdfsPath());
    LOG.info("Query temp location set to {}", cli.getQueryHdfsPath());
    Server server = new Server(cli.getPort());
    ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
    context.setContextPath("/");
    ServletHolder h = new ServletHolder(new HttpServletDispatcher());
    h.setInitParameter("javax.ws.rs.Application", "org.apache.metron.pcapservice.rest.JettyServiceRunner");
    context.addServlet(h, "/*");
    server.setHandler(context);
    try {
        server.start();
        server.join();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : PcapServiceCli(org.apache.metron.api.helper.service.PcapServiceCli) Server(org.eclipse.jetty.server.Server) ServletHolder(org.eclipse.jetty.servlet.ServletHolder) ServletContextHandler(org.eclipse.jetty.servlet.ServletContextHandler) IOException(java.io.IOException) HttpServletDispatcher(org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher)

Example 2 with HttpServletDispatcher

use of org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher in project brave by openzipkin.

the class ITTracingFeature_Container method init.

@Override
public void init(ServletContextHandler handler) {
    // Adds application programmatically as opposed to using web.xml
    handler.addServlet(new ServletHolder(new HttpServletDispatcher()), "/*");
    handler.addEventListener(new TracingBootstrap(httpTracing, new TestResource(httpTracing)));
}
Also used : ServletHolder(org.eclipse.jetty.servlet.ServletHolder) HttpServletDispatcher(org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher)

Example 3 with HttpServletDispatcher

use of org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher in project brave by openzipkin.

the class ITDeclarativeSampling method init.

@Override
public void init(ServletContextHandler handler) {
    // Adds application programmatically as opposed to using web.xml
    handler.addServlet(new ServletHolder(new HttpServletDispatcher()), "/*");
    handler.addEventListener(new TracingBootstrap(httpTracing, new Resource()));
}
Also used : TracingBootstrap(brave.jaxrs2.TracingBootstrap) ServletHolder(org.eclipse.jetty.servlet.ServletHolder) HttpServletDispatcher(org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher)

Example 4 with HttpServletDispatcher

use of org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher in project brave by openzipkin.

the class ITSpanCustomizingContainerFilter method init.

@Override
public void init(ServletContextHandler handler) {
    // Adds application programmatically as opposed to using web.xml
    handler.addServlet(new ServletHolder(new HttpServletDispatcher()), "/*");
    handler.addEventListener(new TaggingBootstrap(new TestResource(httpTracing)));
    addFilter(handler, TracingFilter.create(httpTracing));
}
Also used : ServletHolder(org.eclipse.jetty.servlet.ServletHolder) HttpServletDispatcher(org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher)

Aggregations

ServletHolder (org.eclipse.jetty.servlet.ServletHolder)4 HttpServletDispatcher (org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher)4 TracingBootstrap (brave.jaxrs2.TracingBootstrap)1 IOException (java.io.IOException)1 PcapServiceCli (org.apache.metron.api.helper.service.PcapServiceCli)1 Server (org.eclipse.jetty.server.Server)1 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)1