|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public static interface RequestInvoker.InvocationContext
Injectable invocation context that can be used to control various aspects of the invocation, e.g. the threading model.
| Nested Class Summary | |
|---|---|
static class |
RequestInvoker.InvocationContext.Status
Invocation context status. |
| Method Summary | |
|---|---|
javax.ws.rs.core.Response |
getResponse()
Returns default response to be send back to the client in case the suspended request invocation times out. |
RequestScope.Snapshot |
popRequestScope()
Retrieve a request scope snapshot stored in the internal stack. |
void |
pushRequestScope(RequestScope.Snapshot snapshot)
Store a request scope snapshot in the internal stack. |
void |
resume(javax.ws.rs.core.Response response)
Resume the previously suspended request invocation with a response. |
void |
resume(Throwable exception)
Resume the previously suspended request invocation with an exception. |
void |
setResponse(javax.ws.rs.core.Response response)
Set the default response to be used in case the suspended request invocation times out. |
RequestInvoker.InvocationContext.Status |
status()
Get the current status of the invocation context. |
Future<?> |
suspend()
Suspend a request invocation. |
Future<?> |
suspend(long timeInMillis)
Suspend a request invocation for up to the specified time in milliseconds. |
Future<?> |
suspend(long time,
TimeUnit unit)
Suspend a request invocation for up to the specified time. |
long |
suspesionTimeout()
Get the remaining time to the suspension timeout in milliseconds. |
| Method Detail |
|---|
void pushRequestScope(RequestScope.Snapshot snapshot)
snapshot - request scope snapshot to be stored.RequestScope.Snapshot popRequestScope()
RequestInvoker.InvocationContext.Status status()
void resume(javax.ws.rs.core.Response response)
response - response to be used in the resumed invocation processing.
IllegalStateException - in case the invocation context
has not been suspended yet or has already been resumed.ExecutionContext.resume(Object)void resume(Throwable exception)
exception - exception to be used in the resumed invocation processing.
IllegalStateException - in case the invocation context
has not been suspended yet or has already been resumed.ExecutionContext.resume(Exception)Future<?> suspend()
resumed or
canceled already, the call to suspend is ignored.
future representing a handle of the suspended
request invocation that can be used for querying its current state
via one of the Future.isXxx() methods. The handle can also
be used to cancel the invocation
altogether.ExecutionContext.suspend()Future<?> suspend(long timeInMillis)
System.currentTimeMillis() + timeInMillis
.
In case the invocation has been resumed or
canceled already, the call to suspend is ignored.
timeInMillis - suspension timeout in milliseconds.
future representing a handle of the suspended
request invocation that can be used for querying its current state
via one of the Future.isXxx() methods. The handle can also
be used to cancel the invocation
altogether.ExecutionContext.suspend(long)
Future<?> suspend(long time,
TimeUnit unit)
System.currentTimeMillis() + unit.toMillis(time)
.
In case the invocation has been resumed or
canceled already, the call to suspend is ignored.
time - suspension timeout value.unit - suspension timeout time unit.
future representing a handle of the suspended
request invocation that can be used for querying its current state
via one of the Future.isXxx() methods. The handle can also
be used to cancel the invocation
altogether.ExecutionContext.suspend(long, TimeUnit)long suspesionTimeout()
void setResponse(javax.ws.rs.core.Response response)
response - data to be sent back to the client in case the suspended
request invocation times out.ExecutionContext.setResponse(Object)javax.ws.rs.core.Response getResponse()
null if no default
response was set in the invocation context.
null if no default response
was set.ExecutionContext.getResponse()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||