PrivilegedExceptionAction (Java SE 10 & JDK 10 )
-
public interface PrivilegedExceptionAction<T>A computation to be performed with privileges enabled, that throws one or more checked exceptions. The computation is performed by invoking
AccessController.doPrivilegedon thePrivilegedExceptionActionobject. This interface is used only for computations that throw checked exceptions; computations that do not throw checked exceptions should usePrivilegedActioninstead.
-
-
Method Detail
-
run
T run() throws Exception
Performs the computation. This method will be called by
AccessController.doPrivilegedafter enabling privileges.- Returns:
- a class-dependent value that may represent the results of the
computation. Each class that implements
PrivilegedExceptionActionshould document what (if anything) this value represents. - Throws:
Exception- an exceptional condition has occurred. Each class that implementsPrivilegedExceptionActionshould document the exceptions that its run method can throw.- See Also:
AccessController.doPrivileged(PrivilegedExceptionAction),AccessController.doPrivileged(PrivilegedExceptionAction,AccessControlContext)
-
-
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2018, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.