public class PathRouter extends Object implements Router
PathRouter
is used when there are multiple
services that can be used. Each service is selected based on the
path sent in the initiating request. If a match cannot be made
based on the request then a default service us chosen.RouterContainer
Constructor and Description |
---|
PathRouter(Map<String,Service> registry,
Service primary)
Constructor for the
PathRouter object. |
Modifier and Type | Method and Description |
---|---|
Service |
route(Request request,
Response response)
This is used to route an incoming request to a service if
the request represents a WebSocket handshake as defined by
RFC 6455.
|
public PathRouter(Map<String,Service> registry, Service primary) throws IOException
PathRouter
object. This is used
to create a router using a selection of services that can be
selected using the path provided in the initiating request.registry
- this is the registry of available servicesprimary
- this is the default service to useIOException
public Service route(Request request, Response response)
Copyright © 2015. All rights reserved.