java.lang.Object
com.linecorp.armeria.server.composition.AbstractCompositeService<T,I,O>
- All Implemented Interfaces:
Unwrappable
,Service<I,O>
- Direct Known Subclasses:
DocService
,SimpleCompositeRpcService
,SimpleCompositeService
@Deprecated public abstract class AbstractCompositeService<T extends Service<I,O>,I extends Request,O extends Response> extends Object implements Service<I,O>
Deprecated.
This class will be removed without replacement.
A skeletal
Service
implementation that enables composing multiple Service
s into one.
Extend this class to build your own composite Service
. e.g.
public class MyService extends AbstractCompositeService<HttpService, HttpRequest, HttpResponse> {
public MyService() {
super(CompositeServiceEntry.ofPrefix("/foo/", new FooService()),
CompositeServiceEntry.ofPrefix("/bar/", new BarService()),
CompositeServiceEntry.ofCatchAll(new OtherService()));
}
}
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCompositeService(CompositeServiceEntry<T>... services)
Deprecated.Creates a new instance with the specifiedCompositeServiceEntry
s.protected
AbstractCompositeService(Iterable<CompositeServiceEntry<T>> services)
Deprecated.Creates a new instance with the specifiedCompositeServiceEntry
s. -
Method Summary
Modifier and Type Method Description protected Routed<T>
findService(RoutingContext routingCtx)
Deprecated.O
serve(ServiceRequestContext ctx, I req)
Deprecated.Serves an incomingRequest
.void
serviceAdded(ServiceConfig cfg)
Deprecated.Invoked when this service has been added to aServer
with the specified configuration.protected T
serviceAt(int index)
Deprecated.protected List<CompositeServiceEntry<T>>
services()
Deprecated.Returns the list ofCompositeServiceEntry
s added to this compositeService
.
-
Constructor Details
-
AbstractCompositeService
Deprecated.Creates a new instance with the specifiedCompositeServiceEntry
s. -
AbstractCompositeService
Deprecated.Creates a new instance with the specifiedCompositeServiceEntry
s.
-
-
Method Details
-
serviceAdded
Deprecated.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. -
services
Deprecated.Returns the list ofCompositeServiceEntry
s added to this compositeService
. -
serviceAt
Deprecated. -
findService
Deprecated.- Parameters:
routingCtx
- a context to find theService
.- Returns:
- the
Service
wrapped byRouted
if there's a match.Routed.empty()
if there's no match.
-
serve
Deprecated.Description copied from interface:Service
Serves an incomingRequest
.
-