public final class EJBClientInvocationContext extends AbstractInvocationContext
Modifier and Type | Field and Description |
---|---|
static String |
PRIVATE_ATTACHMENTS_KEY |
static String |
RETURNED_CONTEXT_DATA_KEY
A context data key that may contain a Set of Strings.
|
Modifier and Type | Method and Description |
---|---|
void |
addReturnedContextDataKey(String key)
Indicates to the server that a client side interceptor is interested in the context data that is stored
under the given key.
|
void |
addSuppressed(Supplier<? extends Throwable> cause)
Add a suppressed exception to the request.
|
void |
addSuppressed(Throwable cause)
Add a suppressed exception to the request.
|
boolean |
awaitCancellationResult()
Wait to determine whether this invocation was cancelled.
|
void |
discardResult()
Discard the result from this request.
|
AuthenticationContext |
getAuthenticationContext() |
int |
getCompressionLevel()
Get the compression hint level.
|
Method |
getInvokedMethod()
Get the invoked proxy method.
|
Object |
getInvokedProxy()
Get the invoked proxy object.
|
EJBMethodLocator |
getMethodLocator()
Get the EJB method locator.
|
String |
getMethodSignatureString()
Get the method type signature string, used to identify the method.
|
Object[] |
getParameters()
Get the invocation method parameters.
|
<T> T |
getProxyAttachment(AttachmentKey<T> key)
Get a value attached to the proxy.
|
long |
getRemainingInvocationTime(TimeUnit timeUnit)
Get the remaining invocation time in the given unit.
|
Object |
getResult()
Get the invocation result from this request.
|
ClientTransactionPolicy |
getTransactionPolicy()
Determine whether the method has an explicit transaction policy set.
|
boolean |
isBlockingCaller()
Determine whether this invocation is currently blocking the calling thread.
|
boolean |
isClientAsync()
Determine whether the method is marked client-asynchronous, meaning that invocation should be asynchronous regardless
of whether the server-side method is asynchronous.
|
boolean |
isCompressRequest()
Determine whether the request is expected to be compressed.
|
boolean |
isCompressResponse()
Determine whether the response is expected to be compressed.
|
boolean |
isIdempotent()
Determine whether the method is marked idempotent, meaning that the method may be invoked more than one time with
no additional effect.
|
boolean |
isSynchronous()
Determine whether the method is definitely synchronous, that is, it is not marked client-async, and the return
value of the method is not
void or Future<?> . |
<T> T |
removeProxyAttachment(AttachmentKey<T> key)
Remove a value attached to the proxy.
|
void |
requestRetry()
Request that the current operation be retried if possible.
|
void |
sendRequest()
Proceed with sending the request normally.
|
void |
setBlockingCaller(boolean blockingCaller)
Establish whether this invocation is currently blocking the calling thread.
|
<T> void |
setLocator(EJBLocator<T> locator)
Set the locator for the invocation target.
|
getClientContext, getContextData, getDestination, getInitialCluster, getLocator, getTargetAffinity, getTransaction, getViewClass, getWeakAffinity, setDestination, setTargetAffinity, setTransaction, setWeakAffinity
getAttachment, getAttachments, putAttachment, putAttachmentIfAbsent, removeAttachment, removeAttachment, replaceAttachment, replaceAttachment
public static final String PRIVATE_ATTACHMENTS_KEY
public static final String RETURNED_CONTEXT_DATA_KEY
public void addReturnedContextDataKey(String key)
InvocationContext.getContextData()
that is
present at the end of the server invocation will be serialised and returned to the client.
If an object is present under this key and is not serializable then the request will fail.key
- The context data key the client interceptor is interested inpublic <T> T getProxyAttachment(AttachmentKey<T> key)
T
- the value typekey
- the attachment keynull
if there is nonepublic <T> T removeProxyAttachment(AttachmentKey<T> key)
T
- the value typekey
- the attachment keynull
if there is nonepublic boolean isClientAsync()
true
if the method is marked client-asynchronous, false
otherwisepublic boolean isSynchronous()
void
or Future<?>
.true
if the method is definitely synchronous, false
if the method may be asynchronouspublic boolean isIdempotent()
true
if the method is marked idempotent, false
otherwisepublic ClientTransactionPolicy getTransactionPolicy()
null
if none was explicitly setpublic boolean isCompressRequest()
true
if the request is expected to be compressed, false
otherwisepublic boolean isCompressResponse()
true
if the response is expected to be compressed, false
otherwisepublic int getCompressionLevel()
public String getMethodSignatureString()
public EJBMethodLocator getMethodLocator()
public boolean isBlockingCaller()
true
if the calling thread is being blocked; false
otherwisepublic void setBlockingCaller(boolean blockingCaller)
blockingCaller
- true
if the calling thread is being blocked; false
otherwisepublic void addSuppressed(Throwable cause)
cause
- the suppressed exception (must not be null
)public void addSuppressed(Supplier<? extends Throwable> cause)
cause
- the suppressed exception (must not be null
)public void requestRetry()
AbstractInvocationContext
requestRetry
in class AbstractInvocationContext
public void sendRequest() throws Exception
Exception
- if the request was not successfully sentpublic Object getResult() throws Exception
EJBClientInterceptor.handleInvocationResult(EJBClientInvocationContext)
.Exception
- if the invocation did not succeedpublic void discardResult() throws IllegalStateException
EJBClientInterceptor.handleInvocationResult(EJBClientInvocationContext)
.IllegalStateException
- if there is no result to discardpublic Object getInvokedProxy()
public Method getInvokedMethod()
public Object[] getParameters()
public long getRemainingInvocationTime(TimeUnit timeUnit)
Long.MAX_VALUE
is
always returned. If the invocation time has elapsed, 0 is returned.timeUnit
- the time unit (must not be null
)public <T> void setLocator(EJBLocator<T> locator)
AbstractInvocationContext
setLocator
in class AbstractInvocationContext
locator
- the locator for the invocation target@NotNull public AuthenticationContext getAuthenticationContext()
public boolean awaitCancellationResult()
true
if the invocation was cancelled; false
if it completed or failed or the thread was
interruptedCopyright © 2021 JBoss by Red Hat. All rights reserved.