public class PriviAction extends Object implements PrivilegedAction
AccessController.doPrivileged(PrivilegedAction)
calls.Constructor and Description |
---|
PriviAction()
Creates a PrivilegedAction to get the current security policy object.
|
PriviAction(AccessibleObject object)
Creates a PrivilegedAction to disable the access checks to the given
object.
|
PriviAction(String property)
Creates a PrivilegedAction to return the value of the system property
with the given key.
|
PriviAction(String property,
String defaultAnswer)
Creates a PrivilegedAction to return the value of the system property
with the given key.
|
Modifier and Type | Method and Description |
---|---|
static PrivilegedAction |
getSecurityProperty(String property)
Creates a PrivilegedAction to get the security property with the given
name.
|
Object |
run()
Performs the actual privileged computation as defined by the constructor.
|
public PriviAction()
Policy.getPolicy()
public PriviAction(AccessibleObject object)
object
- the object whose accessible flag will be set to
true
AccessibleObject.setAccessible(boolean)
public PriviAction(String property)
property
- the key of the system propertySystem.getProperty(String)
public PriviAction(String property, String defaultAnswer)
property
- the key of the system propertydefaultAnswer
- the return value if the system property does not existSystem.getProperty(String, String)
public static PrivilegedAction getSecurityProperty(String property)
property
- the name of the propertySecurity.getProperty(java.lang.String)
public Object run()
run
in interface PrivilegedAction
PrivilegedAction.run()