|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.common.util.concurrent.AbstractFuture<RESPONSE>
org.glassfish.jersey.process.internal.AsyncInflectorAdapter<REQUEST,RESPONSE>
REQUEST - request processing data type.RESPONSE - response processing data type.public abstract class AsyncInflectorAdapter<REQUEST,RESPONSE>
Suspendable, asynchronous inflector adapter
that provides implementation of the request suspend/resume capabilities of the
invocation context and returns
a listenable response future instead of a plain response
object.
| Nested Class Summary | |
|---|---|
static interface |
AsyncInflectorAdapter.Builder<REQUEST,RESPONSE>
Asynchronous inflector adapter factory. |
| Nested classes/interfaces inherited from interface org.glassfish.jersey.process.internal.InvocationContext |
|---|
InvocationContext.State |
| Constructor Summary | |
|---|---|
protected |
AsyncInflectorAdapter(Inflector<REQUEST,RESPONSE> wrapped,
InvocationCallback<RESPONSE> callback)
Construct and initialize asynchronous inflector adapter for an inflector. |
| Method Summary | |
|---|---|
com.google.common.util.concurrent.ListenableFuture<RESPONSE> |
apply(REQUEST request)
Invoke request on the wrapped inflector. |
void |
cancel()
|
protected abstract RESPONSE |
convertResponse(REQUEST originatingRequest,
Response response)
Convert the JAX-RS response to supported response data type. |
Response |
getResponse()
|
protected void |
interruptTask()
|
boolean |
isSuspended()
|
void |
resume(java.lang.Object response)
|
void |
resume(java.lang.Throwable response)
|
void |
setResponse(java.lang.Object response)
|
void |
setSuspendTimeout(long time,
java.util.concurrent.TimeUnit unit)
|
InvocationContext.State |
state()
Get the current state of the invocation context. |
void |
suspend()
|
void |
suspend(long millis)
|
void |
suspend(long time,
java.util.concurrent.TimeUnit unit)
|
java.lang.String |
toString()
|
boolean |
trySuspend()
Try to suspend the request invocation. |
| Methods inherited from class com.google.common.util.concurrent.AbstractFuture |
|---|
addListener, cancel, get, get, isCancelled, isDone, set, setException |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.ws.rs.core.ExecutionContext |
|---|
isCancelled, isDone |
| Constructor Detail |
|---|
protected AsyncInflectorAdapter(Inflector<REQUEST,RESPONSE> wrapped,
InvocationCallback<RESPONSE> callback)
wrapped - wrapped inflector.callback - invocation callback.| Method Detail |
|---|
public com.google.common.util.concurrent.ListenableFuture<RESPONSE> apply(REQUEST request)
listenable response future.
apply in interface Inflector<REQUEST,com.google.common.util.concurrent.ListenableFuture<RESPONSE>>request - request data to be processed.
null.public InvocationContext.State state()
InvocationContext
state in interface InvocationContextpublic void resume(java.lang.Object response)
resume in interface ExecutionContext
public void resume(java.lang.Throwable response)
throws java.lang.IllegalStateException
resume in interface ExecutionContextjava.lang.IllegalStateException
public void setSuspendTimeout(long time,
java.util.concurrent.TimeUnit unit)
setSuspendTimeout in interface ExecutionContextpublic boolean trySuspend()
InvocationContextsuspend the request invocation.
Unlike the suspend() method, this method does not throw an exception
in case the suspend operation fails. Instead, the method returns true
if the invocation has been suspended successfully, returns false
otherwise.
trySuspend in interface InvocationContexttrue if the invocation has been suspended successfully,
returns false otherwise.public void suspend()
suspend in interface ExecutionContextpublic void suspend(long millis)
suspend in interface ExecutionContext
public void suspend(long time,
java.util.concurrent.TimeUnit unit)
suspend in interface ExecutionContextpublic void cancel()
cancel in interface ExecutionContextpublic boolean isSuspended()
isSuspended in interface ExecutionContextprotected void interruptTask()
interruptTask in class com.google.common.util.concurrent.AbstractFuture<RESPONSE>public void setResponse(java.lang.Object response)
setResponse in interface ExecutionContextpublic Response getResponse()
getResponse in interface ExecutionContext
protected abstract RESPONSE convertResponse(REQUEST originatingRequest,
Response response)
response to supported response data type.
originatingRequest - originating request data.response - JAX-RS response.
response converted to supported response data
type.public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||