Interface Request

  • All Known Subinterfaces:
    InvocationRequest, SessionOpenRequest

    public interface Request
    The base type of any Enterprise Bean server request. This type is implemented by protocol implementations and consumed by Enterprise Bean invocation servers.
    Author:
    David M. Lloyd
    • Method Detail

      • getRequestExecutor

        Executor getRequestExecutor()
        Get the request executor. This is an executor which is associated with the transport provider which may be used to execute requests.
        Returns:
        the request executor
      • getPeerAddress

        default SocketAddress getPeerAddress()
        Get the peer address that the request was received from, if known.
        Returns:
        the peer address, or null if it is not known
      • getLocalAddress

        default SocketAddress getLocalAddress()
        Get the local address that the request was received to, if known.
        Returns:
        the local address, or null if it is not known
      • getProtocol

        String getProtocol()
        Get the protocol of this request.
        Returns:
        the protocol of this request (must not be null)
      • isBlockingCaller

        boolean isBlockingCaller()
        Determine if this request is blocking a local thread.
        Returns:
        true if the request is blocking the caller thread, false otherwise
      • getEJBIdentifier

        @NotNull
        EJBIdentifier getEJBIdentifier()
        Get the identifier of the target Enterprise Beans.
        Returns:
        the identifier of the target Enterprise Beans (must not be null)
      • getSecurityIdentity

        org.wildfly.security.auth.server.SecurityIdentity getSecurityIdentity()
        Get the security identity that is associated with this invocation.
        Returns:
        the security identity, or null if the connection is not bound to a security domain
      • writeException

        void writeException​(@NotNull
                            Exception exception)
        Write a message indicating that an exception was thrown by the operation.
        Parameters:
        exception - the exception that was thrown (must not be null)
      • writeNoSuchEJB

        void writeNoSuchEJB()
        Write a message indicating that the Enterprise Bean is not found on this server. The request should be abandoned after invoking this method.
      • writeWrongViewType

        void writeWrongViewType()
        Write a message indicating that the Enterprise Bean exists but the locator does not refer to a remote view. The request should be abandoned after invoking this method.
      • writeCancelResponse

        void writeCancelResponse()
        Write a response indicating that the request was successfully cancelled.
      • writeNotStateful

        void writeNotStateful()
        Write a message indicating that given Enterprise Bean is not actually stateful. The request should be abandoned after invoking this method.
      • convertToStateful

        void convertToStateful​(@NotNull
                               SessionID sessionId)
                        throws IllegalArgumentException,
                               IllegalStateException
        Attempt to convert the current invocation into a stateful invocation. For session creation requests, this method must be called. For regular method invocations, this method may be called if the invoked Enterprise Bean is stateful but the locator is stateless, in order to auto-create the session.
        Parameters:
        sessionId - the new session ID (must not be null)
        Throws:
        IllegalArgumentException - if the current invocation cannot be converted to a stateful invocation because it is already stateful or the target Enterprise Bean is not a stateful Enterprise Bean
        IllegalStateException - if the invocation was already converted to be stateful with a different session ID
      • updateStrongAffinity

        default void updateStrongAffinity​(@NotNull
                                          Affinity affinity)
        Hint to the implementation that the strong affinity of the client proxy should be updated if possible. Not all transports support all affinity types; as this is only a hint, the transport is free to ignore these calls.
        Parameters:
        affinity - the affinity to set (must not be null)
      • updateWeakAffinity

        default void updateWeakAffinity​(@NotNull
                                        Affinity affinity)
        Hint to the implementation that the weak affinity of the client proxy should be updated if possible. Not all transports support all affinity types; as this is only a hint, the transport is free to ignore these calls.
        Parameters:
        affinity - the affinity to set (must not be null)
      • getProviderInterface

        default <C> C getProviderInterface​(Class<C> providerInterfaceType)
        Get the provider interface associated with the request.
        Type Parameters:
        C - the provider interface type
        Parameters:
        providerInterfaceType - the provider interface type class (must not be null)
        Returns:
        the provider interface, or null if it is not known