|
||||||||||
| 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 Request to Response 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)
Transform data of a given type into a result of the different type. |
void |
cancel()
|
protected abstract RESPONSE |
convertResponse(Response response)
Convert the JAX-RS response to supported response data type. |
Response |
getResponse()
|
protected void |
interruptTask()
|
boolean |
isSuspended()
|
void |
resume(java.lang.Exception response)
|
void |
resume(java.lang.Object 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)
Inflector
apply in interface Inflector<REQUEST,com.google.common.util.concurrent.ListenableFuture<RESPONSE>>request - data to be transformed into a result.
null.public InvocationContext.State state()
InvocationContext
state in interface InvocationContextpublic void resume(java.lang.Object response)
resume in interface ExecutionContextpublic void resume(java.lang.Exception response)
resume in interface ExecutionContext
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 ExecutionContextprotected abstract RESPONSE convertResponse(Response response)
response to supported response data type.
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 | |||||||||