@ServerEndpoint("/echo") private static class PerConnectionEchoEndpoint { @SuppressWarnings("unused") private final EchoService service; @Autowired public PerConnectionEchoEndpoint(EchoService service) { this.service = service; } }
@ServerEndpoint("/echo") private static class EchoEndpoint { @SuppressWarnings("unused") private final EchoService service; @Autowired public EchoEndpoint(EchoService service) { this.service = service; } }
@ServerEndpoint("/path") private static class AnnotatedDummyEndpoint { }
@ServerEndpoint("/path") private static class AnnotatedDummyEndpointBean { }
@Component("myComponentEchoEndpoint") @ServerEndpoint("/echo") private static class ComponentEchoEndpoint { @SuppressWarnings("unused") private final EchoService service; @Autowired public ComponentEchoEndpoint(EchoService service) { this.service = service; } }
@ServerEndpoint("/") public class ChromeRDPDebuggerEndpoint implements ChromeRDPExchange { public static final int MAX_MESSAGE_SIZE = 65534;
@ServerEndpoint("/basic") @Slf4j public class BasicSocket
@ServerEndpoint(value = "/query") public class WSQueryEndpoint {
@ServerEndpoint("/chat-room/{username}") public class ChatRoomServerEndpoint {
@ServerEndpoint(value = "/crash", configurator = Configurator.class) public class CRaSHConnector {
@ServerEndpoint("/chat") public class WebSocketChatServer {
@ServerEndpoint(value = "/websocket") @Component public class MyWebSocket {
@WebListener @ServerEndpoint(value = "/stream") public class Jsr356Impl implements StreamingSocketInterface, ServletContextListener {
/** * Created by fray on 8/17/17. */ @ServerEndpoint(value = "/ws") public class LevrResolverWebSocketSimple extends LevrResolverWebSocket { }
/** * Echo endpoint for string messages. * * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) */ @ServerEndpoint("/digest-auth-echo") public class DigestAuthEchoEndpoint { @OnMessage public String onMessage(String s) { return s; } }
/** * Echo endpoint for string messages. * * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) */ @ServerEndpoint("/basic-auth-echo") public class BasicAuthEchoEndpoint { @OnMessage public String onMessage(String s) { return s; } }
@ServerEndpoint("/websocket") public class ServerEndpointWebSocket { @Inject private SessionWebSocket sessionWebSocket; @OnOpen public void onNewUser(Session session){ LogUtils.generate("Nova Sessão WebSocket: " + session); sessionWebSocket.add(session); } @OnClose public void onClose(Session session, CloseReason closeReason) { LogUtils.generate("Fechando Sessão WebSocket: " + session + " Motivo: " + closeReason.getCloseCode().getCode() + " - " + closeReason.getReasonPhrase()); sessionWebSocket.remove(session); } @OnMessage public void onMessage(String message, Session session) { LogUtils.generate("Sessao: " + session + " Mensagem: " + message); sessionWebSocket.send(session, message); } }
/** * Test class which include method with wrong return type. */ @ServerEndpoint("/test-with-false-return") public class TestEndpointWithReturnTypeError { @OnMessage public int onText(String text, Session session) { return 0; } }
/** * Test class with mandatory parameters for a given javax.websocket annotation is missing according to JSR-356 * specification. */ @ServerEndpoint("/test-mandatory-parameters-missing") public class TestEndpointWithMandatoryParametersMissing { @OnError public void onError() { } }
@ServerEndpoint("/test") public class TestEndpoint { Logger log = LoggerFactory.getLogger(TestEndpoint.class); @OnOpen public void onOpen(Session session) { log.info(session.getId()); } @OnMessage public String onStringMessage(String str, Session session) { log.info("Test str is : " + str); return str; } @OnClose public void onClose(CloseReason closeReason, Session session) { } }