Package org.jboss.ejb.server
Interface Request
-
- All Known Subinterfaces:
InvocationRequest,SessionOpenRequest
public interface RequestThe base type of any EJB server request. This type is implemented by protocol implementations and consumed by EJB invocation servers.- Author:
- David M. Lloyd
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidconvertToStateful(SessionID sessionId)Attempt to convert the current invocation into a stateful invocation.EJBIdentifiergetEJBIdentifier()Get the identifier of the target EJB.default SocketAddressgetLocalAddress()Get the local address that the request was received to, if known.default SocketAddressgetPeerAddress()Get the peer address that the request was received from, if known.StringgetProtocol()Get the protocol of this request.default <C> CgetProviderInterface(Class<C> providerInterfaceType)Get the provider interface associated with the request.ExecutorgetRequestExecutor()Get the request executor.org.wildfly.security.auth.server.SecurityIdentitygetSecurityIdentity()Get the security identity that is associated with this invocation.booleanisBlockingCaller()Determine if this request is blocking a local thread.default voidupdateStrongAffinity(Affinity affinity)Hint to the implementation that the strong affinity of the client proxy should be updated if possible.default voidupdateWeakAffinity(Affinity affinity)Hint to the implementation that the weak affinity of the client proxy should be updated if possible.voidwriteCancelResponse()Write a response indicating that the request was successfully cancelled.voidwriteException(Exception exception)Write a message indicating that an exception was thrown by the operation.voidwriteNoSuchEJB()Write a message indicating that the EJB is not found on this server.voidwriteNotStateful()Write a message indicating that given EJB is not actually stateful.voidwriteWrongViewType()Write a message indicating that the EJB exists but the locator does not refer to a remote view.
-
-
-
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
nullif 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
nullif 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:
trueif the request is blocking the caller thread,falseotherwise
-
getEJBIdentifier
@NotNull EJBIdentifier getEJBIdentifier()
Get the identifier of the target EJB.- Returns:
- the identifier of the target EJB (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
nullif 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 benull)
-
writeNoSuchEJB
void writeNoSuchEJB()
Write a message indicating that the EJB is not found on this server. The request should be abandoned after invoking this method.
-
writeWrongViewType
void writeWrongViewType()
Write a message indicating that the EJB 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 EJB is not actually stateful. The request should be abandoned after invoking this method.
-
convertToStateful
void convertToStateful(@NotNull SessionID sessionId) throws IllegalArgumentException, IllegalStateExceptionAttempt 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 EJB is stateful but the locator is stateless, in order to auto-create the session.- Parameters:
sessionId- the new session ID (must not benull)- Throws:
IllegalArgumentException- if the current invocation cannot be converted to a stateful invocation because it is already stateful or the target EJB is not a stateful EJBIllegalStateException- 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 benull)
-
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 benull)
-
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 benull)- Returns:
- the provider interface, or
nullif it is not known
-
-