Interface IPrivilegedAction<T>
-
- Type Parameters:
T- The action return type.
- All Superinterfaces:
PrivilegedAction<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface IPrivilegedAction<T> extends PrivilegedAction<T>
Extension toPrivilegedActionwith aninvokeSafe()method that invokes theAccessControlleronly if a security manager is present.
This class is deprecated per Java 17, as the Java Security Manager is deprecated in that version. See https://openjdk.org/jeps/411 for details.- Author:
- Philip Helger
-
-
Method Summary
-
Methods inherited from interface java.security.PrivilegedAction
run
-
-
-
-
Method Detail
-
invokeSafe
@Nullable default T invokeSafe()
- Returns:
- The result of
PrivilegedAction.run()dependent if a system manager is installed or not.
-
invokeSafe
@Nullable static <T> T invokeSafe(@Nonnull IPrivilegedAction<T> aPA)
- Type Parameters:
T- The return type of the privileged action- Parameters:
aPA- The privileged action to run. May not benull.- Returns:
- The result of
PrivilegedAction.run()dependent if a system manager is installed or not. - Since:
- 9.4.7
-
asVoid
@Nonnull static IPrivilegedAction<Void> asVoid(@Nonnull Runnable aRunnable)
-
classLoaderGetParent
@Nonnull static IPrivilegedAction<ClassLoader> classLoaderGetParent(@Nonnull ClassLoader aBaseClassLoader)
-
getClassLoader
@Nonnull static IPrivilegedAction<ClassLoader> getClassLoader(@Nonnull Class<?> aClass)
-
getContextClassLoader
@Nonnull static IPrivilegedAction<ClassLoader> getContextClassLoader()
-
setContextClassLoader
@Nonnull static IPrivilegedAction<Void> setContextClassLoader(@Nonnull ClassLoader aClassLoader)
-
getSystemClassLoader
@Nonnull static IPrivilegedAction<ClassLoader> getSystemClassLoader()
-
systemClearProperty
@Nonnull static IPrivilegedAction<String> systemClearProperty(@Nonnull String sKey)
-
systemGetProperty
@Nonnull static IPrivilegedAction<String> systemGetProperty(@Nonnull String sKey)
-
systemGetProperties
@Nonnull static IPrivilegedAction<Properties> systemGetProperties()
-
systemSetProperty
@Nonnull static IPrivilegedAction<String> systemSetProperty(@Nonnull String sKey, @Nonnull String sValue)
-
proxySelectorGetDefault
@Nonnull static IPrivilegedAction<ProxySelector> proxySelectorGetDefault()
-
proxySelectorSetDefault
@Nonnull static IPrivilegedAction<Void> proxySelectorSetDefault(@Nullable ProxySelector aProxySelector)
-
authenticatorSetDefault
@Nonnull static IPrivilegedAction<Void> authenticatorSetDefault(@Nullable Authenticator aAuthenticator)
-
securityGetProviders
@Nonnull static IPrivilegedAction<Provider[]> securityGetProviders()
-
securityGetProviders
@Nonnull static IPrivilegedAction<Provider[]> securityGetProviders(@Nonnull String sFilter)
-
securityGetProvider
@Nonnull static IPrivilegedAction<Provider> securityGetProvider(@Nonnull String sName)
-
securityAddProvider
@Nonnull static IPrivilegedAction<Integer> securityAddProvider(@Nonnull Provider aProvider)
-
securityInsertProviderAt
@Nonnull static IPrivilegedAction<Integer> securityInsertProviderAt(@Nonnull Provider aProvider, int nIndex)
-
securityRemoveProvider
@Nonnull static IPrivilegedAction<Void> securityRemoveProvider(@Nonnull String sName)
-
-