Package org.jboss.ejb.client
Class EJBClientContext
- java.lang.Object
-
- org.jboss.ejb.client.Attachable
-
- org.jboss.ejb.client.EJBClientContext
-
- All Implemented Interfaces:
org.wildfly.common.context.Contextual<EJBClientContext>
public final class EJBClientContext extends Attachable implements org.wildfly.common.context.Contextual<EJBClientContext>
The public API for an EJB client context. An EJB client context may be associated with (and used by) one or more threads concurrently.- Author:
- David M. Lloyd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEJBClientContext.BuilderA builder for EJB client contexts.
-
Field Summary
Fields Modifier and Type Field Description static org.wildfly.discovery.ServiceTypeEJB_SERVICE_TYPEThe service type to use for EJB discovery.static StringFILTER_ATTR_CLUSTERThe discovery attribute name which contains a cluster name.static StringFILTER_ATTR_EJB_MODULEThe discovery attribute name which contains the application and module name of the located EJB.static StringFILTER_ATTR_EJB_MODULE_DISTINCTThe discovery attribute name which contains the application and module name with the distinct name of the located EJB.static StringFILTER_ATTR_NODEThe discovery attribute name which contains a node name.static StringFILTER_ATTR_SOURCE_IPThe discovery attribute name for when a rule only applies to a specific source IP address range.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()List<EJBClientConnection>getConfiguredConnections()Get the pre-configured connections for this context.static org.wildfly.common.context.ContextManager<EJBClientContext>getContextManager()Get the context manager.static EJBClientContextgetCurrent()Get the current client context for this thread.intgetDefaultCompression()Collection<EJBClientCluster>getInitialConfiguredClusters()Get the initially configured clusters for this context.org.wildfly.common.context.ContextManager<EJBClientContext>getInstanceContextManager()Get the context manager.longgetInvocationTimeout()Get the configured invocation timeout.intgetMaximumConnectedClusterNodes()Get the maximum connected cluster nodes setting, for connection-based protocols which support eager connection.EJBClientInterceptor.RegistrationregisterInterceptor(int priority, EJBClientInterceptor clientInterceptor)Deprecated.Please use EJBClientContext.Builder to manipulate the EJBClientInterceptors.static EJBClientContextrequireCurrent()Get the current client context for this thread.EJBClientContextwithAddedInterceptors(EJBClientInterceptor... interceptors)Get a copy of this context with the given interceptor(s) added.EJBClientContextwithAddedTransportProviders(EJBTransportProvider... transportProviders)Get a copy of this context with the given transport provider(s) added.-
Methods inherited from class org.jboss.ejb.client.Attachable
getAttachment, getAttachments, putAttachment, putAttachmentIfAbsent, removeAttachment, removeAttachment, replaceAttachment, replaceAttachment
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.common.context.Contextual
run, runAction, runBiConsumer, runBiFunction, runBiPredicate, runCallable, runConsumer, runExBiConsumer, runExBiFunction, runExBiPredicate, runExceptionAction, runExConsumer, runExFunction, runExIntFunction, runExLongFunction, runExPredicate, runFunction, runIntFunction, runLongFunction, runPredicate
-
-
-
-
Field Detail
-
EJB_SERVICE_TYPE
public static final org.wildfly.discovery.ServiceType EJB_SERVICE_TYPE
The service type to use for EJB discovery.
-
FILTER_ATTR_EJB_MODULE
public static final String FILTER_ATTR_EJB_MODULE
The discovery attribute name which contains the application and module name of the located EJB.- See Also:
- Constant Field Values
-
FILTER_ATTR_EJB_MODULE_DISTINCT
public static final String FILTER_ATTR_EJB_MODULE_DISTINCT
The discovery attribute name which contains the application and module name with the distinct name of the located EJB.- See Also:
- Constant Field Values
-
FILTER_ATTR_NODE
public static final String FILTER_ATTR_NODE
The discovery attribute name which contains a node name.- See Also:
- Constant Field Values
-
FILTER_ATTR_CLUSTER
public static final String FILTER_ATTR_CLUSTER
The discovery attribute name which contains a cluster name.- See Also:
- Constant Field Values
-
FILTER_ATTR_SOURCE_IP
public static final String FILTER_ATTR_SOURCE_IP
The discovery attribute name for when a rule only applies to a specific source IP address range.- See Also:
- Constant Field Values
-
-
Method Detail
-
registerInterceptor
@Deprecated public EJBClientInterceptor.Registration registerInterceptor(int priority, EJBClientInterceptor clientInterceptor) throws IllegalArgumentException
Deprecated.Please use EJBClientContext.Builder to manipulate the EJBClientInterceptors.Register a client interceptor with this client context. If the passedclientInterceptoris already added to this context, then this method just returns the oldEJBClientInterceptor.Registration.Note: If an interceptor is added or removed after a proxy is used, this will not affect the proxy interceptor list.
- Parameters:
priority- the absolute priority of this interceptor (lower runs earlier; higher runs later)clientInterceptor- the interceptor to register- Returns:
- a handle which may be used to later remove this registration
- Throws:
IllegalArgumentException
-
getInstanceContextManager
public org.wildfly.common.context.ContextManager<EJBClientContext> getInstanceContextManager()
Get the context manager. Simply calls thestaticmethodgetContextManager().- Specified by:
getInstanceContextManagerin interfaceorg.wildfly.common.context.Contextual<EJBClientContext>- Returns:
- the context manager (not
null)
-
getContextManager
public static org.wildfly.common.context.ContextManager<EJBClientContext> getContextManager()
Get the context manager.- Returns:
- the context manager (not
null)
-
getInvocationTimeout
public long getInvocationTimeout()
Get the configured invocation timeout. A value of zero indicates that invocations never time out.- Returns:
- the configured invocation timeout
-
getConfiguredConnections
public List<EJBClientConnection> getConfiguredConnections()
Get the pre-configured connections for this context. This information may not be used by some transport providers and mainly exists for legacy compatibility purposes.- Returns:
- the pre-configured connections for this context (not
null)
-
getInitialConfiguredClusters
public Collection<EJBClientCluster> getInitialConfiguredClusters()
Get the initially configured clusters for this context. The collection will not reflect any topology updates received from peers.- Returns:
- the initially configured clusters for this context
-
getMaximumConnectedClusterNodes
public int getMaximumConnectedClusterNodes()
Get the maximum connected cluster nodes setting, for connection-based protocols which support eager connection.- Returns:
- the maximum connected cluster nodes count
-
withAddedInterceptors
public EJBClientContext withAddedInterceptors(EJBClientInterceptor... interceptors)
Get a copy of this context with the given interceptor(s) added. If the array isnullor empty, the current context is returned as-is.- Parameters:
interceptors- the interceptor(s) to add- Returns:
- the new context (not
null)
-
withAddedTransportProviders
public EJBClientContext withAddedTransportProviders(EJBTransportProvider... transportProviders)
Get a copy of this context with the given transport provider(s) added. If the array isnullor empty, the current context is returned as-is.- Parameters:
transportProviders- the transport providers(s) to add- Returns:
- the new context (not
null)
-
close
public void close()
-
getCurrent
public static EJBClientContext getCurrent()
Get the current client context for this thread.- Returns:
- the current client context
-
requireCurrent
public static EJBClientContext requireCurrent()
Get the current client context for this thread. Delegates togetCurrent().- Returns:
- the current client context for this thread
-
getDefaultCompression
public int getDefaultCompression()
-
-