Klasse FauxAsyncContext

java.lang.Object
org.jupnp.transport.impl.blocking.FauxAsyncContext

public class FauxAsyncContext extends Object
Faux implementation mimicking Servlet 3.0's AsyncContext. Used to provide blocking execution for Async Servlet 3.0 operations when ran on Servlet 2.4.
Autor:
Ivan Iliev - Initial contribution and API
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    FauxAsyncContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    void
    Mark this as completed and stop blocking.
    javax.servlet.http.HttpServletRequest
    Returns current HttpServletRequest
    javax.servlet.http.HttpServletResponse
    Returns current HttpServletResponse
    long
    Timeout value in miliseconds.
    boolean
    Returns true if the complete() method was called, false if we have reached a timeout.
    void
    setTimeout(long timeout)
    Sets the current timeout value in miliseconds - only positive numbers are accepted
    void
    Blocks the current thread for the set timeout, can be stopped by calling the complete() method.

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • FauxAsyncContext

      public FauxAsyncContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
  • Methodendetails

    • setTimeout

      public void setTimeout(long timeout)
      Sets the current timeout value in miliseconds - only positive numbers are accepted
      Parameter:
      timeout -
    • getTimeout

      public long getTimeout()
      Timeout value in miliseconds. If unset the timeout for blocking operations is Long.MAX_VALUE
      Gibt zurück:
    • getResponse

      public javax.servlet.http.HttpServletResponse getResponse()
      Returns current HttpServletResponse
      Gibt zurück:
    • getRequest

      public javax.servlet.http.HttpServletRequest getRequest()
      Returns current HttpServletRequest
      Gibt zurück:
    • complete

      public void complete()
      Mark this as completed and stop blocking.
    • isCompleted

      public boolean isCompleted()
      Returns true if the complete() method was called, false if we have reached a timeout.
      Gibt zurück:
    • waitForTimeoutOrCompletion

      public void waitForTimeoutOrCompletion()
      Blocks the current thread for the set timeout, can be stopped by calling the complete() method.