|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=TYPE) public @interface ClientEndpoint
The ClientEndpoint annotation a class level annotation is used to denote that a POJO
is a web socket client and can be deployed as such. Similar to
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);
}
}
Optional Element Summary | |
---|---|
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. |
public abstract String[] subprotocols
public abstract Class<? extends Decoder>[] decoders
public abstract Class<? extends Encoder>[] encoders
public abstract Class<? extends ClientEndpointConfig.Configurator> configurator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |