- java.lang.Object
-
- com.linecorp.armeria.server.composition.AbstractCompositeService<I,O>
-
- com.linecorp.armeria.server.composition.SimpleCompositeService<I,O>
-
- All Implemented Interfaces:
Unwrappable
,Service<I,O>
public class SimpleCompositeService<I extends Request,O extends Response> extends AbstractCompositeService<I,O>
A general purposeAbstractCompositeService
implementation. Useful when you do not want to define a new dedicatedService
type.
-
-
Constructor Summary
Constructors Constructor Description SimpleCompositeService(CompositeServiceEntry<I,O>... services)
Creates a new instance that is composed of the specified entries.SimpleCompositeService(Iterable<CompositeServiceEntry<I,O>> services)
Creates a new instance that is composed of the specified entries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Routed<Service<I,O>>
findService(RoutingContext routingCtx)
<T extends Service<I,O>>
TserviceAt(int index)
List<CompositeServiceEntry<I,O>>
services()
Returns the list ofCompositeServiceEntry
s added to this compositeService
.-
Methods inherited from class com.linecorp.armeria.server.composition.AbstractCompositeService
serve, serviceAdded
-
-
-
-
Constructor Detail
-
SimpleCompositeService
@SafeVarargs public SimpleCompositeService(CompositeServiceEntry<I,O>... services)
Creates a new instance that is composed of the specified entries.
-
SimpleCompositeService
public SimpleCompositeService(Iterable<CompositeServiceEntry<I,O>> services)
Creates a new instance that is composed of the specified entries.
-
-
Method Detail
-
services
public List<CompositeServiceEntry<I,O>> services()
Description copied from class:AbstractCompositeService
Returns the list ofCompositeServiceEntry
s added to this compositeService
.
-
serviceAt
public <T extends Service<I,O>> T serviceAt(int index)
Description copied from class:AbstractCompositeService
-
findService
public Routed<Service<I,O>> findService(RoutingContext routingCtx)
Description copied from class:AbstractCompositeService
- Overrides:
findService
in classAbstractCompositeService<I extends Request,O extends Response>
- Parameters:
routingCtx
- a context to find theService
.- Returns:
- the
Service
wrapped byRouted
if there's a match.Routed.empty()
if there's no match.
-
-