public final class EJBClientInvocationContext extends Attachable
Modifier and Type | Field and Description |
---|---|
static String |
PRIVATE_ATTACHMENTS_KEY |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitCancellationResult()
Wait to determine whether this invocation was cancelled.
|
void |
discardResult()
Discard the result from this request.
|
EJBClientContext |
getClientContext()
Get the EJB client context associated with this invocation.
|
int |
getCompressionLevel()
Get the compression hint level.
|
Map<String,Object> |
getContextData()
Get the context data.
|
Method |
getInvokedMethod()
Get the invoked proxy method.
|
Object |
getInvokedProxy()
Get the invoked proxy object.
|
EJBLocator<?> |
getLocator()
Get the locator for the invocation target.
|
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.
|
Object |
getResult()
Get the invocation result from this request.
|
Transaction |
getTransaction()
Get the transaction associated with the invocation.
|
ClientTransactionPolicy |
getTransactionPolicy()
Determine whether the method has an explicit transaction policy set.
|
Class<?> |
getViewClass()
Get the invoked view class.
|
Affinity |
getWeakAffinity()
Get the invocation weak affinity.
|
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 |
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.
|
void |
setTransaction(Transaction transaction)
Set the transaction associated with the invocation.
|
void |
setWeakAffinity(Affinity weakAffinity)
Set the invocation weak affinity.
|
getAttachment, getAttachments, putAttachment, putAttachmentIfAbsent, removeAttachment, removeAttachment, replaceAttachment, replaceAttachment
public static final String PRIVATE_ATTACHMENTS_KEY
public <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 EJBClientContext getClientContext()
public 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 Map<String,Object> getContextData()
InvocationContext.getContextData()
method, and thus
can be used to pass data from the client to the server (as long as all map values are
Serializable
).public EJBLocator<?> getLocator()
public <T> void setLocator(EJBLocator<T> locator)
locator
- the locator for the invocation targetpublic 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 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 Class<?> getViewClass()
public Transaction getTransaction()
null
is returned.null
if no transaction should be propagatedpublic void setTransaction(Transaction transaction)
null
should be set.transaction
- the transaction associated with the invocation, or null
if no transaction should be
propagatedpublic Affinity getWeakAffinity()
Affinity.NONE
if none (not null
)public void setWeakAffinity(Affinity weakAffinity)
weakAffinity
- the invocation weak affinity (must not be null
)public boolean awaitCancellationResult()
true
if the invocation was cancelled; false
if it completed or failed or the thread was
interruptedCopyright © 2017 JBoss by Red Hat. All rights reserved.