APISonar


voldemort.server.ServiceType.HTTP

> voldemort > server > ServiceType > HTTP
voldemort APIs server APIs ServiceType APIs HTTP APIs

Example 1
public HttpService(VoldemortServer server,
                       StoreRepository storeRepository,
                       RequestFormatType requestType,
                       int numberOfThreads,
                       int httpPort) {
        super(ServiceType.HTTP);
        this.port = httpPort;
        this.numberOfThreads = numberOfThreads;
        this.server = server;
        this.velocityEngine = new VelocityEngine(VoldemortServletContextListener.VOLDEMORT_TEMPLATE_DIR);
        this.requestHandler = new SocketRequestHandlerFactory(server.getStoreRepository(),
                                                              server.getMetadataStore(),
                                                              server.getVoldemortConfig(),
                                                              server.getAsyncRunner()).getRequestHandler(requestType);
    }
Example 2
public void init() throws ServletException {
        super.init();
        // if we don't already have a stores map, attempt to initialize from the
        // servlet context
        if(this.requestHandler == null) {
            ServletContext context = this.getServletContext();
            VoldemortServer server = (VoldemortServer) Utils.notNull(context.getAttribute(VoldemortServletContextListener.SERVER_CONFIG_KEY));
            HttpService httpService = (HttpService) server.getService(ServiceType.HTTP);
            this.requestHandler = httpService.getRequestHandler();
        }
    }