Class THttpServiceBuilder

java.lang.Object
com.linecorp.armeria.server.thrift.THttpServiceBuilder

public final class THttpServiceBuilder
extends Object
A fluent builder to build an instance of THttpService. This builder allows to bind multiple thrift service implementations along with mixing TMultiplexed protocol to a route.

Example


 Server server =
     Server.builder()
           .http(8080)
           .service("/", THttpService.builder()
                                     .addService(new FooService())              // foo() method
                                     .addService(new BarService())              // bar() method
                                     .addService("foobar", new FooBarService()) // TMultiplexed service
                                     .build())
           .build();
 

When the thrift request has a method foo() then FooService.foo() handles the request and similarly when thrift request has a method bar() then BarService.bar() handles the request. And when the service name is "foobar" then FooBarService

See Also:
THttpService, ThriftCallService