Class HttpWebSocketRequestHandler
java.lang.Object
dev.voidframework.web.server.http.HttpWebSocketRequestHandler
WebSocket incoming connection handler.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpWebSocketRequestHandler(com.google.inject.Injector injector) Build a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectconvertValuesToParameterTypeArray(List<String> valueList, Class<?> parameterTypeClass) Try to convert multiple values from a String into an array of needed parameter type.protected ObjectconvertValueToParameterType(String value, Class<?> parameterTypeClass) Try to convert value from a String into the needed parameter type.voidonIncomingConnection(WebSocketContext context) This method is called each time the framework need to handle an incoming WebSocket connection.
-
Field Details
-
EMPTY_FALLBACK_VALUE
- See Also:
-
-
Constructor Details
-
HttpWebSocketRequestHandler
public HttpWebSocketRequestHandler(com.google.inject.Injector injector) Build a new instance.- Parameters:
injector- The injector instance
-
-
Method Details
-
onIncomingConnection
This method is called each time the framework need to handle an incoming WebSocket connection.- Parameters:
context- The WebSocket context- Throws:
IOException- if something goes wrong with the newly open connection
-
convertValueToParameterType
Try to convert value from a String into the needed parameter type.- Parameters:
value- The string containing the value to convertparameterTypeClass- The needed output parameter type class- Returns:
- The converter value, otherwise, null
-
convertValuesToParameterTypeArray
protected Object convertValuesToParameterTypeArray(List<String> valueList, Class<?> parameterTypeClass) Try to convert multiple values from a String into an array of needed parameter type.- Parameters:
valueList- The list of string containing the value to convertparameterTypeClass- The needed output parameter type class- Returns:
- The converter values as array, otherwise, null
-