public interface SubjectSecurityContext extends javax.ws.rs.core.SecurityContext
ContainerRequest.setSecurityContext(javax.ws.rs.core.SecurityContext). When Jersey detects this kind of context is in the request scope, it will use
doAsSubject(java.security.PrivilegedAction)method to dispatch the request to a resource method (or to call a sub-resource locator).
|Modifier and Type||Method and Description|
Jersey wraps calls to resource methods and sub-resource locators in
Object doAsSubject(PrivilegedAction action)
PrivilegedActioninstance and passes it to this method when dispatching a request. Implementations should do the needful to establish a
Subjectand invoke the
PrivilegedActionpassed as the parameter using
The privileged action passed into the method may, when invoked, fail with either
Both these exceptions must be propagated to the caller without a modification.
PrivilegedActionthat represents a resource or sub-resource locator method invocation to be executed by this method after establishing a subject.
NullPointerException- if the
SecurityException- if the caller does not have permission to invoke the
javax.ws.rs.WebApplicationException- propagated exception from the privileged action. May be thrown in case the invocation of resource or sub-resource locator method in the privileged action results in this exception.
javax.ws.rs.ProcessingException- propagated exception from the privileged action. May be thrown in case the invocation of resource or sub-resource locator method in the privileged action has failed or resulted in a non-checked exception.
Copyright © 2007-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.