Class TyrusHttpUpgradeHandler

  • All Implemented Interfaces:
    java.util.EventListener, javax.servlet.http.HttpUpgradeHandler, javax.servlet.ReadListener

    public class TyrusHttpUpgradeHandler
    extends java.lang.Object
    implements javax.servlet.http.HttpUpgradeHandler, javax.servlet.ReadListener
    HttpUpgradeHandler and ReadListener implementation.

    Reads data from ServletInputStream and passes it further to the Tyrus runtime.

    Author:
    Jitendra Kotamraju, Pavel Bucek (pavel.bucek at oracle.com)
    • Field Detail

      • FRAME_BUFFER_SIZE

        public static final java.lang.String FRAME_BUFFER_SIZE
        See Also:
        Constant Field Values
    • Constructor Detail

      • TyrusHttpUpgradeHandler

        public TyrusHttpUpgradeHandler()
    • Method Detail

      • init

        public void init​(javax.servlet.http.WebConnection wc)
        Specified by:
        init in interface javax.servlet.http.HttpUpgradeHandler
      • onDataAvailable

        public void onDataAvailable()
        Specified by:
        onDataAvailable in interface javax.servlet.ReadListener
      • onAllDataRead

        public void onAllDataRead()
        Specified by:
        onAllDataRead in interface javax.servlet.ReadListener
      • onError

        public void onError​(java.lang.Throwable t)
        Specified by:
        onError in interface javax.servlet.ReadListener
      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.http.HttpUpgradeHandler
      • sessionDestroyed

        public void sessionDestroyed()
        Called when related HttpSession is destroyed or invalidated.

        Implementation is required to call onClose() on server-side with corresponding close code (1008, see WebSocket spec 7.2) - only when there is an authorized user for this session.

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setIncomingBufferSize

        public void setIncomingBufferSize​(int incomingBufferSize)