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 Enterprise Bean client context. An Enterprise Bean client context may be associated with (and used by) one or more threads concurrently.
- Author:
- David M. Lloyd
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder for Enterprise Beans client contexts. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.wildfly.discovery.ServiceTypeThe service type to use for Enterprise Beans discovery.static final StringThe discovery attribute name which contains a cluster name.static final StringThe discovery attribute name which contains the application and module name of the located Enterprise Beans.static final StringThe discovery attribute name which contains the application and module name with the distinct name of the located Enterprise Beans.static final StringThe discovery attribute name which contains a node name.static final StringThe discovery attribute name for when a rule only applies to a specific source IP address range. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Get the pre-configured connections for this context.static org.wildfly.common.context.ContextManager<EJBClientContext>Get the context manager.static EJBClientContextGet the current client context for this thread.intGet the initially configured clusters for this context.org.wildfly.common.context.ContextManager<EJBClientContext>Get the context manager.longGet the configured invocation timeout.intGet the maximum connected cluster nodes setting, for connection-based protocols which support eager connection.registerInterceptor(int priority, EJBClientInterceptor clientInterceptor) Deprecated.Please use EJBClientContext.Builder to manipulate the EJBClientInterceptors.static EJBClientContextGet the current client context for this thread.withAddedInterceptors(EJBClientInterceptor... interceptors) Get a copy of this context with the given interceptor(s) added.withAddedTransportProviders(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, replaceAttachmentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 Details
-
EJB_SERVICE_TYPE
public static final org.wildfly.discovery.ServiceType EJB_SERVICE_TYPEThe service type to use for Enterprise Beans discovery. -
FILTER_ATTR_EJB_MODULE
The discovery attribute name which contains the application and module name of the located Enterprise Beans.- See Also:
-
FILTER_ATTR_EJB_MODULE_DISTINCT
The discovery attribute name which contains the application and module name with the distinct name of the located Enterprise Beans.- See Also:
-
FILTER_ATTR_NODE
The discovery attribute name which contains a node name.- See Also:
-
FILTER_ATTR_CLUSTER
The discovery attribute name which contains a cluster name.- See Also:
-
FILTER_ATTR_SOURCE_IP
The discovery attribute name for when a rule only applies to a specific source IP address range.- See Also:
-
-
Method Details
-
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
Get the context manager. Simply calls thestaticmethodgetContextManager().- Specified by:
getInstanceContextManagerin interfaceorg.wildfly.common.context.Contextual<EJBClientContext>- Returns:
- the context manager (not
null)
-
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
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
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
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
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
Get the current client context for this thread.- Returns:
- the current client context
-
requireCurrent
Get the current client context for this thread. Delegates togetCurrent().- Returns:
- the current client context for this thread
-
getDefaultCompression
public int getDefaultCompression()
-