websocket-spec
  1. websocket-spec
  2. WEBSOCKET_SPEC-103

DefaultServerConfiguration used in @WebSocketEndpoint

    Details

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

      Description

      @WebSocketEndpoint javadoc:

          /**
           * The custom configuration class that the developer would like to use
           * to configure new instances of this endpoint.
           *
           * @return the custom configuration class.
           */
          public Class<? extends DefaultServerConfiguration> configuration();

      How should I implement my custom DefaultServerConfiguration? Seems like I have to call constructor (no-arg is private):

          public static class MyDefaultServerConfiguration extends DefaultServerConfiguration {
      
              public MyDefaultServerConfiguration(Class<? extends Endpoint> endpointClass, String path) {
                  super(endpointClass, path);
              }
          }

      what should be present in path argument? Why should I put it there if its available from @WebSocketEndpoint anotation? (value is path and annotated class is endpointClass). Is this supposed to be application wide configuration? It needs to be clear in javadoc.

      Additionally, if its per endpoint, shouldn't that be DefaultServerEndpointConfiguration?

      And last but not least - why is Default implementation forced here? User might want to provide its own - just and interface would look better for me.

        Activity

        Hide
        Pavel Bucek added a comment -

        spec must define what set of endocers/decoders should be used

        • only from provided configuration?
        • only from @WebSocketEndpoint?
        • merge? (in what order?)
        Show
        Pavel Bucek added a comment - spec must define what set of endocers/decoders should be used only from provided configuration? only from @WebSocketEndpoint? merge? (in what order?)
        Hide
        jitu added a comment -

        Yes. Alternatively, we can also think of giving information only once(perhaps, by removing encoders/decoders from the annotation)

        Show
        jitu added a comment - Yes. Alternatively, we can also think of giving information only once(perhaps, by removing encoders/decoders from the annotation)
        Hide
        dannycoward added a comment -

        I think all these messy issues in the old api are now fixed in the new one.

        Show
        dannycoward added a comment - I think all these messy issues in the old api are now fixed in the new one.

          People

          • Assignee:
            dannycoward
            Reporter:
            Pavel Bucek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved: