public final class SystemPropertyValue extends Object implements Value<String>, PrivilegedAction<String>
System.getProperty(String)| Constructor and Description |
|---|
SystemPropertyValue(String propertyName)
Construct a new instance.
|
SystemPropertyValue(String propertyName,
AccessControlContext accessControlContext)
Construct a new instance.
|
SystemPropertyValue(String propertyName,
AccessControlContext accessControlContext,
Value<?> defaultValue)
Construct a new instance.
|
SystemPropertyValue(String propertyName,
Value<?> defaultValue)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getValue()
Get the actual value.
|
String |
run()
Fetch the property in an unprivileged context.
|
public SystemPropertyValue(String propertyName)
propertyName - the property name to readpublic SystemPropertyValue(String propertyName, AccessControlContext accessControlContext)
propertyName - the property name to readaccessControlContext - the access control context in which to fetch the property valuepublic SystemPropertyValue(String propertyName, Value<?> defaultValue)
propertyName - the property name to readdefaultValue - the value to use if the property is unsetpublic SystemPropertyValue(String propertyName, AccessControlContext accessControlContext, Value<?> defaultValue)
propertyName - the property name to readaccessControlContext - the access control context in which to fetch the property valuedefaultValue - the value to use if the property is unsetpublic String getValue() throws IllegalStateException, IllegalArgumentException
getValue in interface Value<String>IllegalStateException - if the value is time-sensitive and the current state does not allow retrieval.IllegalArgumentException - when the value cannot be read due to misconfigurationpublic String run()
run in interface PrivilegedAction<String>Copyright © 2017 JBoss by Red Hat. All rights reserved.