Interface WebSocketTracesInterceptor
public interface WebSocketTracesInterceptor
This interface must be implemented as a CDI bean by an extension that needs to collect WebSockets traces.
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when a WebSocket connection is opened.voidonConnectionClosingFailed(Throwable throwable, WebSocketEndpointContext context) Called when a closing of a WebSocket connection failed.onConnectionOpened(String route, EndpointKind endpointKind) Called when a WebSocket connection is opened.voidonConnectionOpeningFailed(Throwable cause, String route, EndpointKind endpointKind, Map<String, Object> connectionOpenedContext) Called when an opening of a WebSocket connection failed.
-
Method Details
-
onConnectionOpened
Called when a WebSocket connection is opened. Any data that should be shared between other events (likeonConnectionClosed(WebSocketEndpointContext)) must be returned as a context data.- Parameters:
route- endpoint routeendpointKind- whether invoked endpoint is a server endpoint or a client endpoint- Returns:
- context data or null (when no context data are required)
-
onConnectionOpeningFailed
void onConnectionOpeningFailed(Throwable cause, String route, EndpointKind endpointKind, Map<String, Object> connectionOpenedContext) Called when an opening of a WebSocket connection failed.- Parameters:
cause-Throwableroute- endpoint routeendpointKind- whether invoked endpoint is a server endpoint or a client endpointconnectionOpenedContext- context data produced by theonConnectionOpened(String, EndpointKind)
-
onConnectionClosed
Called when a WebSocket connection is opened.- Parameters:
context- WebSocketEndpointContext
-
onConnectionClosingFailed
Called when a closing of a WebSocket connection failed.- Parameters:
throwable-Throwablecontext- endpoint context
-