Package com.linkedin.r2.filter.message.rpc

Examples of com.linkedin.r2.filter.message.rpc.RpcRequestFilter


            .createServer(port, createDispatcher());
  }

  public static Client createHttpClient(FilterChain filters)
  {
    final TransportClient client = new HttpClientFactory(filters)
            .getClient(Collections.<String, String>emptyMap());
    return new TransportClientAdapter(client);
  }
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);
    return new HttpServer()
    {
      @Override
      public void start()
          throws IOException
      {
        server.start();
      }

      @Override
      public void stop()
          throws IOException
      {
        server.stop();
        engine.shutdown();
        executor.shutdown();
        scheduler.shutdown();
      }

      @Override
      public void waitForStop()
          throws InterruptedException
      {
        server.waitForStop();
      }
    };
  }
View Full Code Here

    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

TOP

Related Classes of com.linkedin.r2.filter.message.rpc.RpcRequestFilter

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.