Annotation Interface ServerEndpoint


@Retention(RUNTIME) @Target(TYPE) public @interface ServerEndpoint
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.

For example:

 
 @ServerEndpoint("/hello");
 public class HelloServer {

     @OnMessage
     public void processGreeting(String message, Session session) {
         System.out.println("Greeting received:" + message);
     }

 }