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 Classes Modifier and Type Class Description static class
EJBClientContext.Builder
A builder for Enterprise Beans client contexts.
-
Field Summary
Fields Modifier and Type Field Description static org.wildfly.discovery.ServiceType
EJB_SERVICE_TYPE
The service type to use for Enterprise Beans discovery.static String
FILTER_ATTR_CLUSTER
The discovery attribute name which contains a cluster name.static String
FILTER_ATTR_EJB_MODULE
The discovery attribute name which contains the application and module name of the located Enterprise Beans.static String
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.static String
FILTER_ATTR_NODE
The discovery attribute name which contains a node name.static String
FILTER_ATTR_SOURCE_IP
The 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 void
close()
List<EJBClientConnection>
getConfiguredConnections()
Get the pre-configured connections for this context.static org.wildfly.common.context.ContextManager<EJBClientContext>
getContextManager()
Get the context manager.static EJBClientContext
getCurrent()
Get the current client context for this thread.int
getDefaultCompression()
Collection<EJBClientCluster>
getInitialConfiguredClusters()
Get the initially configured clusters for this context.org.wildfly.common.context.ContextManager<EJBClientContext>
getInstanceContextManager()
Get the context manager.long
getInvocationTimeout()
Get the configured invocation timeout.int
getMaximumConnectedClusterNodes()
Get the maximum connected cluster nodes setting, for connection-based protocols which support eager connection.EJBClientInterceptor.Registration
registerInterceptor(int priority, EJBClientInterceptor clientInterceptor)
Deprecated.Please use EJBClientContext.Builder to manipulate the EJBClientInterceptors.static EJBClientContext
requireCurrent()
Get the current client context for this thread.EJBClientContext
withAddedInterceptors(EJBClientInterceptor... interceptors)
Get a copy of this context with the given interceptor(s) added.EJBClientContext
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, 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 Enterprise Beans 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 Enterprise Beans.- 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 Enterprise Beans.- 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 passedclientInterceptor
is 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 thestatic
methodgetContextManager()
.- Specified by:
getInstanceContextManager
in 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 isnull
or 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 isnull
or 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()
-
-