Class ProtocolRouter
java.lang.Object
org.simpleframework.http.socket.service.ProtocolRouter
- All Implemented Interfaces:
Router
The
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.- Author:
- Niall Gallagher
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionProtocolRouter(Map<String, Service> registry, Service primary) Constructor for theProtocolRouterobject. -
Method Summary
-
Constructor Details
-
ProtocolRouter
Constructor for theProtocolRouterobject. This is used to create a router using a selection of services that can be selected using theSec-WebSocket-Protocolheader sent in the initiating request by the client.- Parameters:
registry- this is the registry of available servicesprimary- this is the default service to use- Throws:
IOException
-
-
Method Details
-
route
This is used to route an incoming request to a service if the request represents a WebSocket handshake as defined by RFC 6455. If the request is not a session initiating handshake then this will return a null value to allow it to be processed by some other part of the server.
-