Class JettyService
java.lang.Object
com.linecorp.armeria.server.jetty.JettyService
- All Implemented Interfaces:
Unwrappable,HttpService,Service<HttpRequest,HttpResponse>
An
HttpService that dispatches its requests to a web application running in an embedded
Jetty.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic JettyServiceBuilderbuilder()Returns a newJettyServiceBuilder.exchangeType(RoutingContext routingContext) static JettyServiceCreates a newJettyServicefrom an existing JettyServer.static JettyServiceCreates a newJettyServicefrom an existing JettyServer.static JettyServiceCreates a newJettyServicefrom an existing JettyServer.serve(ServiceRequestContext ctx, HttpRequest req) Serves an incomingRequest.voidInvoked when this service has been added to aServerwith the specified configuration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.linecorp.armeria.server.HttpService
decorate, decorateMethods inherited from interface com.linecorp.armeria.server.Service
as, shouldCachePath, unwrapMethods inherited from interface com.linecorp.armeria.common.util.Unwrappable
equalsIgnoreWrapper, unwrapAll
-
Method Details
-
of
Creates a newJettyServicefrom an existing JettyServer.- Parameters:
jettyServer- the JettyServer
-
of
Creates a newJettyServicefrom an existing JettyServer.- Parameters:
jettyServer- the JettyServerhostname- the default hostname, ornullto use Armeria's default virtual host name.
-
of
public static JettyService of(Server jettyServer, @Nullable @Nullable String hostname, boolean tlsReverseDnsLookup) Creates a newJettyServicefrom an existing JettyServer.- Parameters:
jettyServer- the JettyServerhostname- the default hostname, ornullto use Armeria's default virtual host name.tlsReverseDnsLookup- whether perform reverse DNS lookup for the remote IP address on a TLS connection. SeeJettyServiceBuilder.tlsReverseDnsLookup(boolean)for more information.
-
builder
Returns a newJettyServiceBuilder. -
serviceAdded
Description copied from interface:ServiceInvoked when this service has been added to aServerwith the specified configuration. Please note that this method can be invoked more than once if this service has been added more than once.- Specified by:
serviceAddedin interfaceService<HttpRequest,HttpResponse>
-
serve
Description copied from interface:ServiceServes an incomingRequest.- Specified by:
servein interfaceHttpService- Specified by:
servein interfaceService<HttpRequest,HttpResponse> - Parameters:
ctx- the context of the receivedRequestreq- the receivedRequest- Returns:
- the
Response
-
exchangeType
Description copied from interface:HttpServiceDetermines anExchangeTypefor thisHttpServicefrom the givenRoutingContext. By default,ExchangeType.BIDI_STREAMINGis set.Note that an
HttpRequestwill be aggregated before serving theHttpServiceifExchangeType.UNARYorExchangeType.RESPONSE_STREAMINGis set.- Specified by:
exchangeTypein interfaceHttpService
-