Class 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
    • 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 passed clientInterceptor is already added to this context, then this method just returns the old EJBClientInterceptor.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 the static method getContextManager().
        Specified by:
        getInstanceContextManager in interface org.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 is null 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 is null 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 to getCurrent().
        Returns:
        the current client context for this thread
      • getDefaultCompression

        public int getDefaultCompression()