Class VirtualHostAnnotatedServiceBindingBuilder

java.lang.Object
com.linecorp.armeria.server.VirtualHostAnnotatedServiceBindingBuilder

public final class VirtualHostAnnotatedServiceBindingBuilder extends Object
A builder class for binding an HttpService to a virtual host fluently. This class can be instantiated through VirtualHostBuilder.annotatedService().

Call build(Object) to build the HttpService and return to the VirtualHostBuilder.


 ServerBuilder sb = Server.builder();
 sb.virtualHost("foo.com")                       // Return a new instance of {@link VirtualHostBuilder}
   .annotatedService()                           // Return a new instance of this class
   .requestTimeoutMillis(5000)
   .maxRequestLength(8192)
   .exceptionHandler((ctx, request, cause) -> HttpResponse.of(400))
   .pathPrefix("/foo")
   .verboseResponses(true)
   .build(new FooService())                      // Return to {@link VirtualHostBuilder}
   .and()                                        // Return to {@link ServerBuilder}
   .annotatedService(new MyDefaultHostService())
   .build();
 
See Also: