websocket-spec
  1. websocket-spec
  2. WEBSOCKET_SPEC-51

Unify annotation and programmatic API programming models

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      There needs to be one programming model. This will help to write an endpoint class and be deployed in standalone or Java EE environments.

      The endpoint class can be based on the annotations.
      @WebSocket("/echo")
      public class Echo {
      ...
      }

      1. The deployment in EE happens via DD(if anything needs to be configured/overwritten what is there in annotations). Many cases DD is optional. And we don't have to do DD in the first release. Just war the endpoints, deploy the war to app server.

      2. In the standalone case a deployment is driven by a programmatic API to configure things(if any). It will take the same endpoint class (which is annotated) that worked in EE. Annotation processing is happening only one time and saying that we don't use annotated endpoints for standalone deployment doesn't make sense. For e.g see javax.xml.ws.Endpoint class for JAX-WS standalone deployment. In this case,

      Endpoint e = Endpoint.publish("ws://localhost:8080/echo", Echo.class) // Same class with annotations
      ...
      e.stop();

      Of course, certain features that are available in EE cannot be done(or optional) in standalone. JAX-WS/JAX-RS followed this programming model successfully. This will help moving things from one deployment model to another easily. Easy to test. Developers don't have to learn two programming models.

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            jitu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: