XMLWordPrintable

Details

    • Sub-task
    • Resolution: Done
    • Major
    • 2.19.0.Final
    • 2.17.0.Final
    • Java EE

    Description

      It would be good to be able to create a Websocket Server endpoint with the following command :

      websocket-new-server-endpoint --name MyServerEndpoint 
      

      This would generate the following code with the default URI myServer:

      @ServerEndpoint("/myServer")
      public class MyServerEndpoint {
      }
      

      A uri parameter would allow to customize the URI of the endpoint

      websocket-new-server-endpoint --name MyServerEndpoint --uri abc
      

      This would generate the following code with a abc URI:

      @ServerEndpoint("/abc")
      public class MyServerEndpoint {
      }
      

      As a shortcut (see FORGE-2394 we could easily implement basic methods such as :

      websocket-new-server-endpoint --name MyServerEndpoint --uri abc --methods ON_OPEN ON_CLOSE ON_ERROR ON_MESSAGE
      

      This would generate a server endpoint with the four following methods :

      @ServerEndpoint("/abc")
      public class MyServerEndpoint {
      
          @OnOpen
          public void onOpen(Session session) {
          }
      
          @OnClose
          public void onClose(Session session, CloseReason closeReason) {
          }
      
          @OnMessage
          public void onMessage(Session session, String message) {
          }
          
          @OnError
          public void onError(Throwable t) {
          }
      }
      

      Attachments

        Activity

          People

            agoncal Antonio Goncalves (Inactive)
            agoncal Antonio Goncalves (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: