Interface ThreadIdentityService
-
public interface ThreadIdentityService
Manages the security environment associated with the thread.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isAppThreadIdentityEnabled()
Determines if application thread identity is enabled.void
reset(java.lang.Object tokenReturnedFromSet)
Reset the native thread identity with the SAF identity represented by the token parameter.java.lang.Object
runAsServer()
Called whenever the server must perform an internal operation as the server ID.java.lang.Object
set(javax.security.auth.Subject subject)
The set method is invoked at the following times: 1.
-
-
-
Method Detail
-
set
java.lang.Object set(javax.security.auth.Subject subject)
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
void reset(java.lang.Object tokenReturnedFromSet)
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
java.lang.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.
-
-