public class ProtocolRouter extends Object implements Router
ProtocolRouter is used when there are multiple
services that can be used. Each service is selected based on the
protocol 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 |
|---|
ProtocolRouter(Map<String,Service> registry,
Service primary)
Constructor for the
ProtocolRouter 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 ProtocolRouter(Map<String,Service> registry, Service primary) throws IOException
ProtocolRouter object. This is
used to create a router using a selection of services that can
be selected using the Sec-WebSocket-Protocol header
sent in the initiating request by the client.registry - this is the registry of available servicesprimary - this is the default service to useIOExceptionpublic Service route(Request request, Response response)
Copyright © 2025. All rights reserved.