Interface ThreadIdentityService
public interface ThreadIdentityService
Manages the security environment associated with the thread.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines if application thread identity is enabled.void
Reset the native thread identity with the SAF identity represented by the token parameter.Called whenever the server must perform an internal operation as the server ID.The set method is invoked at the following times: 1.
-
Method Details
-
set
The set method is invoked at the following times: 1. In the context of a web container request, it is called AFTER authentication and BEFORE dispatching the request. The reset method is called after the dispatch completes. 2. From WSSubject.doAs/doAsPrivileged, the reset method is called after the doAs code block completes. 3. In a WorkManager/AsyncBeans context, it is called ifis enabled. The reset method is called after the async work completes. Note: In all cases, isAppThreadIdentityEnabled is called first and must return true for set() to be called. This method shall return null IF AND ONLY IF the thread identity support is disabled. - Parameters:
subject
- The subject to set as the thread identity.- Returns:
- A token representing the identity previously on the thread.
-
reset
Reset the native thread identity with the SAF identity represented by the token parameter. The token was returned from a previous call to set. It represents the identity that was on the thread prior to being swapped off by the call to setThreadIdentity.- Parameters:
tokenReturnedFromSet
- The token returned by a previous call to set.
-
runAsServer
Object runAsServer()Called whenever the server must perform an internal operation as the server ID. The reset method is called after the internal operation is complete.- Returns:
- A token representing the identity previously on the thread.
-
isAppThreadIdentityEnabled
boolean isAppThreadIdentityEnabled()Determines if application thread identity is enabled.- Returns:
- true if application thread identity is enabled; false otherwise.
-