Package com.linkedin.r2.transport.common.bridge.server

Examples of com.linkedin.r2.transport.common.bridge.server.TransportDispatcher


  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


    AsyncCallableTask.register(engineBuilder, executor);

    final Engine engine = engineBuilder.build();
    ResourceFactory resourceFactory = createResourceFactory(beans);

    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,
View Full Code Here

    beanProvider.add("albumEntryDb", new AlbumEntryDatabaseImpl(photoDb, 3));

    // 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

public abstract class AbstractPerfServerFactory
{
  @SuppressWarnings("deprecation")
  public Server create(int port, URI echoUri)
  {
    final TransportDispatcher dispatcher = new TransportDispatcherBuilder()
          .addRpcHandler(echoUri, new RpcEchoServer(new EchoServiceImpl()))
          .addRestHandler(echoUri, new RestEchoServer(new EchoServiceImpl()))
          .build();

    return createServer(port, dispatcher);
View Full Code Here

{
  public static void main(String[] args) throws IOException
  {
    final int port = Integer.parseInt(System.getProperty(SERVER_PORT_PROP_NAME, DEFAULT_PORT));
    final URI relativeUri = MiscUtil.getUri(DEFAULT_RELATIVE_URI);
    final TransportDispatcher dispatcher = new TransportDispatcherBuilder()
    .addRestHandler(relativeUri, new RestEchoServer(new EchoServiceImpl()))
    .build();

    final Server server = new HttpServerFactory().createServer(port, dispatcher);
    //final Server server = new HttpServerFactory().createServer(port, createDispatcher(relativeUri));
View Full Code Here

        .setTaskExecutor(scheduler)
        .setTimerScheduler(scheduler)
        .build();

    final RestLiServer restServer = new RestLiServer(config, new PrototypeResourceFactory(), engine);
    final TransportDispatcher dispatcher = new DelegatingTransportDispatcher(restServer);
    System.err.println("Netty threadPoolSize: " + threadPoolSize);
    _server = new HttpNettyServerFactory(FilterChains.empty()).createServer(_port, threadPoolSize, dispatcher);
  }
View Full Code Here

    for (String validPath : _validPaths)
    {
      dispatcherBuilder.addRpcHandler(URI.create(validPath), rpcDispatcher);
      dispatcherBuilder.addRestHandler(URI.create(validPath), restDispatcher);
    }
    final TransportDispatcher dispatcher = dispatcherBuilder.build();

    // start the server
    if (_scheme.equals("http"))
    {
      _server = getHttpServer(dispatcher);
View Full Code Here

    SimpleBeanProvider beanProvider = new SimpleBeanProvider();
    beanProvider.add("GroupsRestApplication", app);
    //using InjectMockResourceFactory to keep examples spring-free
    ResourceFactory factory = new InjectMockResourceFactory(beanProvider);

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

    final FilterChain fc = FilterChains.empty().addLast(new ServerCompressionFilter(supportedCompression))
        .addLast(new SimpleLoggingFilter());
    return new HttpServerFactory(fc).createServer(port,
                                                  HttpServerFactory.DEFAULT_CONTEXT_PATH,
View Full Code Here

    return createServer(port, DEFAULT_THREAD_POOL_SIZE, transportDispatcher);
  }

  public HttpServer createServer(int port, int threadPoolSize, TransportDispatcher transportDispatcher)
  {
    final TransportDispatcher filterDispatcher = new FilterChainDispatcher(transportDispatcher, _filters);
    final HttpDispatcher dispatcher = new HttpDispatcher(filterDispatcher);
    return new HttpNettyServer(port, threadPoolSize, dispatcher);
  }
View Full Code Here

                                 int threadPoolSize,
                                 TransportDispatcher transportDispatcher,
                                 boolean useAsyncServletApi,
                                 int asyncTimeOut)
  {
    final TransportDispatcher filterDispatcher =
        new FilterChainDispatcher(transportDispatcher, _filters);
    final HttpDispatcher dispatcher = new HttpDispatcher(filterDispatcher);
    return new HttpJettyServer(port,
                               contextPath,
                               threadPoolSize,
View Full Code Here

TOP

Related Classes of com.linkedin.r2.transport.common.bridge.server.TransportDispatcher

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.