Package com.linkedin.r2.transport.http.server

Examples of com.linkedin.r2.transport.http.server.RAPServlet


    Map<String, Object> beans = getBeans();

    boolean[] enableAsyncOptions = {true, false};
    for (boolean enableAsync: enableAsyncOptions)
    {
      HttpServer server = MockHttpServerFactory.create(PORT, resourceClasses, beans, enableAsync);

      runTest(server);
    }
  }
View Full Code Here


    Map<String, Object> beans = getBeans();

    boolean[] enableAsyncOptions = {true, false};
    for (boolean enableAsync: enableAsyncOptions)
    {
      HttpServer server = MockHttpServerFactory.create(PORT,
                                                       new String[]{"com.linkedin.restli.example.impl"},
                                                       beans,
                                                       enableAsync);

      runTest(server);
View Full Code Here

*/
public class RestLiExampleBasicServer
{
  public static void main(String[] args) throws Exception
  {
    final HttpServer server = createServer();

    startServer(server);

    System.out.println("Basic example server running on port " + SERVER_PORT + ". Press any key to stop server.");
    System.in.read();
View Full Code Here

  {
    // write D2-related configuration to ZooKeeper
    // all the configuration here are permanent, no need to re-write as long as ZooKeeper still has the data
    // therefore in real case, do this "discovery" step separately

    final HttpServer server = RestLiExampleBasicServer.createServer();
    final ZooKeeperConnectionManager zkConn = createZkConn();

    startServer(server, zkConn);

    System.out.println("Example server with D2 is running with URL " + RestLiExampleBasicServer.getServerUrl() + ". Press any key to stop server.");
View Full Code Here

    TransportDispatcher dispatcher = new DelegatingTransportDispatcher(new RestLiServer(config,
                                                                                        resourceFactory,
                                                                                        engine));

    final FilterChain fc = FilterChains.empty().addLast(new SimpleLoggingFilter());
    final HttpServer server = new HttpServerFactory(fc).createServer(port,
                                                               HttpServerFactory.DEFAULT_CONTEXT_PATH,
                                                               NUM_THREADS,
                                                               dispatcher,
                                                               enableAsync,
                                                               enableAsync ? ASYNC_TIMEOUT : -1);
View Full Code Here

    // using InjectMockResourceFactory to keep examples spring-free
    final ResourceFactory factory = new InjectMockResourceFactory(beanProvider);

    final TransportDispatcher dispatcher = new DelegatingTransportDispatcher(new RestLiServer(config, factory));
    return new HttpServerFactory(FilterChains.empty()).createServer(SERVER_PORT, dispatcher);
  }
View Full Code Here

    return createHttpServer(HTTP_PORT, filters);
  }

  public static Server createHttpServer(int port, FilterChain filters)
  {
    return new HttpServerFactory(filters)
            .createServer(port, createDispatcher());
  }
View Full Code Here

  public RestliHttpRequestHandler(RestLiConfig config,
                                  SpringInjectResourceFactory injectResourceFactory,
                                  FilterChain filterChain)
  {
    _r2Servlet = new RAPServlet(
        new FilterChainDispatcher(
            new DelegatingTransportDispatcher(
                new RestLiServer(config, injectResourceFactory)),
            filterChain
        )
View Full Code Here

    }
    if (!useAsync)
    {
      log.info("Initializing Rest.li with a thread based request handling.  Set useAsync=true on a Servlet API 3.0 container to enable Rest.li's async servlet.");
      return new RAPServlet(dispatcher);
    }
    else
    {
      log.info("Initializing Rest.li with an async request handling enabled.");
      return new AsyncR2Servlet(dispatcher, asyncTimeOut);
View Full Code Here

  public GuiceRestliServlet(RestLiConfig config, // required
                            GuiceInjectResourceFactory resourceFactory, // injected automatically by Guice
                            OptionalFilterChain filterChain,
                            OptionalEngine engine)
  {
    _r2Servlet = new RAPServlet(
        new FilterChainDispatcher(
            new DelegatingTransportDispatcher(
                new RestLiServer(config, resourceFactory, engine.value)),
            filterChain.value
        )
View Full Code Here

TOP

Related Classes of com.linkedin.r2.transport.http.server.RAPServlet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.