jakarta.websocket.server.ServerEndpoint, POJOs that are annotated with this
annotation can have methods that, using the web socket method level annotations, are web socket lifecycle methods.
For example:
@ClientEndpoint(subprotocols="chat")
public class HelloServer {
@OnMessage
public void processMessageFromServer(String message, Session session) {
System.out.println("Message came from the server ! " + message);
}
}
| Modifier and Type | Method and Description |
|---|---|
| public Class | Returns: the custom configurator class, or ClientEndpointConfigurator.class if none was provided in the annotation.An optional custom configurator class that the developer would like to use to provide custom configuration of new instances of this endpoint. |
| public Class | Returns: the array of decoders.The array of Java classes that are to act as Decoders for messages coming into the client. |
| public Class | Returns: the array of decoders.The array of Java classes that are to act as Encoders for messages sent by the client. |
| public String[] | Returns: the array of names of the subprotocols.The names of the subprotocols this client supports. |
| configurator | back to summary |
|---|---|
| public Class An optional custom configurator class that the developer would like to use to provide custom configuration of new instances of this endpoint. The implementation creates a new instance of the configurator per logical endpoint.
| |
| decoders | back to summary |
|---|---|
| public Class The array of Java classes that are to act as Decoders for messages coming into the client. | |
| encoders | back to summary |
|---|---|
| public Class The array of Java classes that are to act as Encoders for messages sent by the client. | |
| subprotocols | back to summary |
|---|---|
| public String[] subprotocols() The names of the subprotocols this client supports.
| |