Package org.jboss.ejb.client
Class AbstractInvocationContext
- java.lang.Object
-
- org.jboss.ejb.client.Attachable
-
- org.jboss.ejb.client.AbstractInvocationContext
-
- Direct Known Subclasses:
EJBClientInvocationContext,EJBSessionCreationInvocationContext
public abstract class AbstractInvocationContext extends Attachable
The base class of invocation contexts consumed by interceptors and receivers.- Author:
- David M. Lloyd
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.wildfly.security.auth.client.AuthenticationContextgetAuthenticationContext()EJBClientContextgetClientContext()Get the Enterprise Beans client context associated with this invocation.Map<String,Object>getContextData()Get the context data.URIgetDestination()Get the resolved destination of this invocation.StringgetInitialCluster()Gets the initial cluster assignment by discovery, if anyEJBLocator<?>getLocator()Get the locator for the invocation target.AffinitygetTargetAffinity()Get the resolved target affinity of this invocation.org.wildfly.transaction.client.AbstractTransactiongetTransaction()Get the transaction associated with the invocation.Class<?>getViewClass()Get the invoked view class.AffinitygetWeakAffinity()Get the invocation weak affinity.abstract voidrequestRetry()Request that the current operation be retried if possible.voidsetDestination(URI destination)Set the resolved destination of this invocation.<T> voidsetLocator(EJBLocator<T> locator)Set the locator for the invocation target.voidsetTargetAffinity(Affinity targetAffinity)Set the resolved target affinity of this invocation.voidsetTransaction(org.wildfly.transaction.client.AbstractTransaction transaction)Set the transaction associated with the invocation.voidsetWeakAffinity(Affinity weakAffinity)Set the invocation weak affinity.-
Methods inherited from class org.jboss.ejb.client.Attachable
getAttachment, getAttachments, putAttachment, putAttachmentIfAbsent, removeAttachment, removeAttachment, replaceAttachment, replaceAttachment
-
-
-
-
Method Detail
-
getInitialCluster
public String getInitialCluster()
Gets the initial cluster assignment by discovery, if any- Returns:
- the initial cluster if assigned
-
getAuthenticationContext
public org.wildfly.security.auth.client.AuthenticationContext getAuthenticationContext()
-
getClientContext
public EJBClientContext getClientContext()
Get the Enterprise Beans client context associated with this invocation.- Returns:
- the Enterprise Beans client context
-
getContextData
public Map<String,Object> getContextData()
Get the context data. This same data will be made available verbatim to server-side interceptors via theInvocationContext.getContextData()method, and thus can be used to pass data from the client to the server (as long as all map values areSerializable).- Returns:
- the context data
-
getLocator
public EJBLocator<?> getLocator()
Get the locator for the invocation target.- Returns:
- the locator
-
setLocator
public <T> void setLocator(EJBLocator<T> locator)
Set the locator for the invocation target.- Parameters:
locator- the locator for the invocation target
-
getDestination
public URI getDestination()
Get the resolved destination of this invocation. If the destination is not yet decided,nullis returned.- Returns:
- the resolved destination of this invocation, or
nullif it is not yet known
-
setDestination
public void setDestination(URI destination)
Set the resolved destination of this invocation. The destination must be decided by the end of the interceptor chain, otherwise an exception will result.- Parameters:
destination- the resolved destination of this invocation
-
getTargetAffinity
public Affinity getTargetAffinity()
Get the resolved target affinity of this invocation. If the target affinity is not yet decided,nullis returned. The target affinity is retained only for the lifetime of the invocation; it may be used to aid in resolving the destination to set.- Returns:
- the resolved target affinity of this invocation, or
nullif it is not yet known
-
setTargetAffinity
public void setTargetAffinity(Affinity targetAffinity)
Set the resolved target affinity of this invocation.- Parameters:
targetAffinity- the resolved target affinity of this invocation
-
getWeakAffinity
public Affinity getWeakAffinity()
Get the invocation weak affinity.- Returns:
- the invocation weak affinity, or
Affinity.NONEif none (notnull)
-
setWeakAffinity
public void setWeakAffinity(Affinity weakAffinity)
Set the invocation weak affinity.- Parameters:
weakAffinity- the invocation weak affinity (must not benull)
-
getViewClass
public Class<?> getViewClass()
Get the invoked view class.- Returns:
- the invoked view class
-
requestRetry
public abstract void requestRetry()
Request that the current operation be retried if possible.
-
getTransaction
public org.wildfly.transaction.client.AbstractTransaction getTransaction()
Get the transaction associated with the invocation. If there is no transaction (i.e. transactions should not be propagated),nullis returned.- Returns:
- the transaction associated with the invocation, or
nullif no transaction should be propagated
-
setTransaction
public void setTransaction(org.wildfly.transaction.client.AbstractTransaction transaction)
Set the transaction associated with the invocation. If there is no transaction (i.e. transactions should not be propagated),nullshould be set.- Parameters:
transaction- the transaction associated with the invocation, ornullif no transaction should be propagated
-
-