Klasse FauxAsyncContext
java.lang.Object
org.jupnp.transport.impl.blocking.FauxAsyncContext
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
KonstruktorenKonstruktorBeschreibungFauxAsyncContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidcomplete()Mark this as completed and stop blocking.javax.servlet.http.HttpServletRequestReturns current HttpServletRequestjavax.servlet.http.HttpServletResponseReturns current HttpServletResponselongTimeout value in miliseconds.booleanReturns true if the complete() method was called, false if we have reached a timeout.voidsetTimeout(long timeout) Sets the current timeout value in miliseconds - only positive numbers are acceptedvoidBlocks the current thread for the set timeout, can be stopped by calling the complete() method.
-
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.
-