0 Replies Latest reply on Jan 11, 2014 9:15 AM by blackhm

    Pb with WebSocket API

    blackhm

      Hello all!

       

      I try to use websocket api of WildFly.

       

      I have a problem with configurators.

      I used the annotation @ServerEndPoint to configure an end point like this :

      @ServerEndpoint(

             value="/test",

             encoders={

                  MessageEncoder.class    

             },

             decoders={

                  MessageDecoder.class    

             },

             configurator=MainConfigurator.class

      )

      public class TestWS {

       

        private static final Logger logger = Logger.getLogger(TestWS.class.getName());

       

        @OnOpen

        public void onOpen(final Session session, EndpointConfig config) {

             logger.info("open a new connection");

        }

      }

       

      And the configurator :

      public class MainConfigurator extends ServerEndpointConfig.Configurator {

        private static final Logger logger = Logger.getLogger(MainConfigurator.class.getName());

       

        @Override

        public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {

             logger.info("modify handshake");

             super.modifyHandshake(sec, request, response);

        }

       

        @Override

        public <T> T getEndpointInstance(Class<T> endpointClass) throws InstantiationException {

             logger.info("get end point instance");

              return super.getEndpointInstance(endpointClass);

        }

      }

       

      The method "modifyHandshake" is well walled but not the method getEndpointInstance. I want to proxied the end point like this.

       

      Is there a bug or i'm missing something?

       

      Thanks for your help.