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 JettyServiceBuilder
builder()
Returns a newJettyServiceBuilder
.exchangeType
(RoutingContext routingContext) static JettyService
of
(org.eclipse.jetty.server.Server jettyServer) Creates a newJettyService
from an existing JettyServer
.static JettyService
Creates a newJettyService
from an existing JettyServer
.static JettyService
of
(org.eclipse.jetty.server.Server jettyServer, @Nullable String hostname, boolean tlsReverseDnsLookup) Creates a newJettyService
from an existing JettyServer
.serve
(ServiceRequestContext ctx, HttpRequest req) Serves an incomingRequest
.void
Invoked when this service has been added to aServer
with the specified configuration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.linecorp.armeria.server.HttpService
decorate, decorate
Methods inherited from interface com.linecorp.armeria.server.Service
as, shouldCachePath, unwrap
Methods inherited from interface com.linecorp.armeria.common.util.Unwrappable
equalsIgnoreWrapper, unwrapAll
-
Method Details
-
of
Creates a newJettyService
from an existing JettyServer
.- Parameters:
jettyServer
- the JettyServer
-
of
public static JettyService of(org.eclipse.jetty.server.Server jettyServer, @Nullable @Nullable String hostname) Creates a newJettyService
from an existing JettyServer
.- Parameters:
jettyServer
- the JettyServer
hostname
- the default hostname, ornull
to use Armeria's default virtual host name.
-
of
public static JettyService of(org.eclipse.jetty.server.Server jettyServer, @Nullable @Nullable String hostname, boolean tlsReverseDnsLookup) Creates a newJettyService
from an existing JettyServer
.- Parameters:
jettyServer
- the JettyServer
hostname
- the default hostname, ornull
to 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:Service
Invoked when this service has been added to aServer
with 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:
serviceAdded
in interfaceService<HttpRequest,
HttpResponse>
-
serve
Description copied from interface:Service
Serves an incomingRequest
.- Specified by:
serve
in interfaceHttpService
- Specified by:
serve
in interfaceService<HttpRequest,
HttpResponse> - Parameters:
ctx
- the context of the receivedRequest
req
- the receivedRequest
- Returns:
- the
Response
-
exchangeType
Description copied from interface:HttpService
Determines anExchangeType
for thisHttpService
from the givenRoutingContext
. By default,ExchangeType.BIDI_STREAMING
is set.Note that an
HttpRequest
will be aggregated before serving theHttpService
ifExchangeType.UNARY
orExchangeType.RESPONSE_STREAMING
is set.- Specified by:
exchangeType
in interfaceHttpService
-