@Retention(RUNTIME) @Target(TYPE) public @interface ClientEndpoint
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 | Optional Element | Description |
---|---|---|
Class<? extends ClientEndpointConfig.Configurator> |
configurator |
An optional custom configurator class that the developer would like to use
to provide custom configuration of new instances of this endpoint.
|
Class<? extends Decoder>[] |
decoders |
The array of Java classes that are to act as Decoders for messages coming into
the client.
|
Class<? extends Encoder>[] |
encoders |
The array of Java classes that are to act as Encoders for messages sent by the client.
|
String[] |
subprotocols |
The names of the subprotocols this client supports.
|
String[] subprotocols
Class<? extends ClientEndpointConfig.Configurator> configurator
Copyright © 2019 JBoss by Red Hat. All rights reserved.