tyrus icon indicating copy to clipboard operation
tyrus copied to clipboard

Multiple text decoders

Open glassfishrobot opened this issue 8 years ago • 1 comments

I seem to be getting Text MessageHandler already registered when trying to register multiple JSON decoders for multiple types of POJOs. Shouldn't it be possible to register multiple types of decoders for the same type, considering there is Boolean willDecode(String) method in Decoder.Text<T> interface? For example:

    void onOpen(Session session)
    {
        session.addMessageHandler(GatewayHello.class, this::onHello);
        session.addMessageHandler(GatewayAck.class, this::onGatewayAck);
        session.addMessageHandler(GatewayInvalid.class, this::onGatewayInvalid);
    }
    
    void onHello(GatewayHello request)
    {
        
    }
    void onGatewayAck(GatewayAck request)
    {
        
    }
    void onGatewayInvalid(GatewayInvalid request)
    {
        
    }

And in @ClientEndpoint annotation

@ClientEndpoint(
    decoders = {HelloDecoder.class, AckDecoder.class, InvalidDecoder.class}
)

glassfishrobot avatar Aug 11 '17 12:08 glassfishrobot

  • Issue Imported From: https://github.com/tyrus-project/tyrus/issues/619
  • Original Issue Raised By:@Dragas
  • Original Issue Assigned To: Unassigned

glassfishrobot avatar Feb 10 '18 20:02 glassfishrobot