|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=TYPE) public @interface WebSocketEndpoint
This class level annotation declares that the class it decorates
is a web socket endpoint that will be deployed and made available in the URI-space
of a web socket server. The annotation allows the developer to
define the URL (or URI template) which this endpoint will be published, and other
important properties of the endpoint to the websocket runtime, such as the encoders
it uses to send messages.
The annotated class
must have a public no-arg constructor.
@WebSocketEndpoint("/hello");
public class HelloServer {
@WebSocketMessage
public void processGreeting(String message, Session session) {
System.out.println("Greeting received:" + message);
}
}
Required Element Summary | |
---|---|
String |
value
The URI or URI-template, level-1 (See RFC 6570) where the endpoint will be deployed. |
Optional Element Summary | |
---|---|
Class<? extends DefaultServerConfiguration> |
configuration
The custom configuration class that the developer would like to use to configure new instances of this endpoint. |
Class<? extends Decoder>[] |
decoders
The ordered array of decoder classes this endpoint will use. |
Class<? extends Encoder>[] |
encoders
The ordered array of encoder classes this endpoint will use. |
String[] |
subprotocols
The ordered array of web socket protocols this endpoint supports. |
Element Detail |
---|
public abstract String value
@WebSocketEndpoint("/chat")
@WebSocketEndpoint("/chat/{user}")
@WebSocketEndpoint("/booking/{privilege-level}")
public abstract String[] subprotocols
public abstract Class<? extends Decoder>[] decoders
public abstract Class<? extends Encoder>[] encoders
public abstract Class<? extends DefaultServerConfiguration> configuration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |