Package org.jboss.resteasy.core

## Class SynchronousExecutionContext

- java.lang.Object
- - org.jboss.resteasy.core.AbstractExecutionContext
  - - org.jboss.resteasy.core.SynchronousExecutionContext

- All Implemented Interfaces:
    `ResteasyAsynchronousContext`

      public class SynchronousExecutionContext
      extends AbstractExecutionContext

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `protected class` | `SynchronousExecutionContext.SynchronousAsynchronousResponse` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected ResteasyAsynchronousResponse` | `asynchronousResponse` |
    `protected boolean` | `done` |
    `protected Object` | `responseLock` |
    `protected CountDownLatch` | `syncLatch` |
    `protected long` | `timeout` |
    `protected TimeUnit` | `timeoutUnit` |
    `protected boolean` | `wasSuspended` |

    - ### Fields inherited from class org.jboss.resteasy.core.AbstractExecutionContext

      `dispatcher, request, response`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SynchronousExecutionContext​(SynchronousDispatcher dispatcher, HttpRequest request, HttpResponse response)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `complete()` |
    `CompletionStage<Void>` | `executeAsyncIo​(CompletionStage<Void> f)` |
    `CompletionStage<Void>` | `executeBlockingIo​(RunnableWithException f, boolean hasInterceptors)` |
    `ResteasyAsynchronousResponse` | `getAsyncResponse()` |
    `boolean` | `isSuspended()` |
    `ResteasyAsynchronousResponse` | `suspend()` |
    `ResteasyAsynchronousResponse` | `suspend​(long millis)` |
    `ResteasyAsynchronousResponse` | `suspend​(long time, TimeUnit unit)` |

    - ### Methods inherited from class org.jboss.resteasy.core.AbstractExecutionContext

      `initialRequestEnded, initialRequestStarted, isOnInitialRequest`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### syncLatch

          protected final CountDownLatch syncLatch

    - #### timeout

          protected long timeout

    - #### timeoutUnit

          protected TimeUnit timeoutUnit

    - #### wasSuspended

          protected boolean wasSuspended

    - #### done

          protected volatile boolean done

    - #### responseLock

          protected Object responseLock

    - #### asynchronousResponse

          protected ResteasyAsynchronousResponse asynchronousResponse

  - ### Constructor Detail

    - #### SynchronousExecutionContext

          public SynchronousExecutionContext​(SynchronousDispatcher dispatcher,
                                             HttpRequest request,
                                             HttpResponse response)

  - ### Method Detail

    - #### suspend

          public ResteasyAsynchronousResponse suspend()
                                               throws IllegalStateException

      Throws:
        `IllegalStateException`

    - #### suspend

          public ResteasyAsynchronousResponse suspend​(long millis)
                                               throws IllegalStateException

      Throws:
        `IllegalStateException`

    - #### suspend

          public ResteasyAsynchronousResponse suspend​(long time,
                                                      TimeUnit unit)
                                               throws IllegalStateException

      Throws:
        `IllegalStateException`

    - #### getAsyncResponse

          public ResteasyAsynchronousResponse getAsyncResponse()

    - #### isSuspended

          public boolean isSuspended()

    - #### complete

          public void complete()

    - #### executeBlockingIo

          public CompletionStage<Void> executeBlockingIo​(RunnableWithException f,
                                                         boolean hasInterceptors)

    - #### executeAsyncIo

          public CompletionStage<Void> executeAsyncIo​(CompletionStage<Void> f)