java.lang.Object | |
↳ | sun.security.action.GetLongAction |
A convenience class for retrieving the Long
value of a system
property as a privileged action.
An instance of this class can be used as the argument of
AccessController.doPrivileged
.
The following code retrieves the Long
value of the system
property named "prop"
as a privileged action. Since it does
not pass a default value to be used in case the property
"prop"
is not defined, it has to check the result for
null
:
Long tmp = java.security.AccessController.doPrivileged (new sun.security.action.GetLongAction("prop")); long l; if (tmp != null) { l = tmp.longValue(); }
The following code retrieves the Long
value of the system
property named "prop"
as a privileged action, and also passes
a default value to be used in case the property "prop"
is not
defined:
long l = java.security.AccessController.doPrivileged (new GetLongAction("prop")).longValue();
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor that takes the name of the system property whose
Long value needs to be determined. | |||||||||||
Constructor that takes the name of the system property and the default
value of that property.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Determines the
Long value of the system property whose
name was specified in the constructor. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Constructor that takes the name of the system property whose
Long
value needs to be determined.
theProp | the name of the system property. |
---|
Constructor that takes the name of the system property and the default value of that property.
theProp | the name of the system property. |
---|
Determines the Long
value of the system property whose
name was specified in the constructor.
If there is no property of the specified name, or if the property
does not have the correct numeric format, then a Long
object representing the default value that was specified in the
constructor is returned, or null
if no default value was
specified.
Long
value of the property.