Search in sources :

Example 1 with StoreServlet

use of voldemort.server.http.StoreServlet in project voldemort by voldemort.

the class ServerTestUtils method getJettyServer.

public static Context getJettyServer(String clusterXml, String storesXml, String storeName, RequestFormatType requestFormat, int port) throws Exception {
    StoreRepository repository = getStores(storeName, clusterXml, storesXml);
    // initialize servlet
    Server server = new Server(port);
    server.setSendServerVersion(false);
    Context context = new Context(server, "/", Context.NO_SESSIONS);
    RequestHandler handler = getSocketRequestHandlerFactory(clusterXml, storesXml, repository).getRequestHandler(requestFormat);
    context.addServlet(new ServletHolder(new StoreServlet(handler)), "/stores");
    server.start();
    return context;
}
Also used : Context(org.mortbay.jetty.servlet.Context) Server(org.mortbay.jetty.Server) VoldemortServer(voldemort.server.VoldemortServer) RequestHandler(voldemort.server.protocol.RequestHandler) ServletHolder(org.mortbay.jetty.servlet.ServletHolder) StoreRepository(voldemort.server.StoreRepository) StoreServlet(voldemort.server.http.StoreServlet)

Aggregations

Server (org.mortbay.jetty.Server)1 Context (org.mortbay.jetty.servlet.Context)1 ServletHolder (org.mortbay.jetty.servlet.ServletHolder)1 StoreRepository (voldemort.server.StoreRepository)1 VoldemortServer (voldemort.server.VoldemortServer)1 StoreServlet (voldemort.server.http.StoreServlet)1 RequestHandler (voldemort.server.protocol.RequestHandler)1