| 
GigaSpaces XAP 9.7.2 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jini.action.GetIntegerAction
public class GetIntegerAction
A convenience class for retrieving the int value of a
 system property as a privileged action.
 
An instance of this class can be used as the argument of AccessController.doPrivileged or Security.doPrivileged.
 
The following code retrieves the int 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:
 
 Integer tmp = (Integer)
     Security.doPrivileged(new GetIntegerAction("prop"));
 int i;
 if (tmp != null) {
     i = tmp.intValue();
 }
 
 The following code retrieves the int 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:
 
 int i = ((Integer) Security.doPrivileged(
                 new GetIntegerAction("prop", 3))).intValue();
 
 If the protection domain of the immediate caller of
 doPrivileged or the protection domain of this class
 does not imply the permissions necessary for the operation, the
 behavior is as if the system property is not defined.
PrivilegedAction, 
AccessController, 
Security| Constructor Summary | |
|---|---|
GetIntegerAction(String theProp)
Constructor that takes the name of the system property whose int value needs to be determined. | 
|
GetIntegerAction(String theProp,
                 int defaultVal)
Constructor that takes the name of the system property and the default value of that property.  | 
|
| Method Summary | |
|---|---|
 Object | 
run()
Determines the int value of the system property
 whose name was specified in the constructor. | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public GetIntegerAction(String theProp)
int value needs to be determined.
theProp - the name of the system property
public GetIntegerAction(String theProp,
                        int defaultVal)
theProp - the name of the system propertydefaultVal - the default value| Method Detail | 
|---|
public Object run()
int value of the system property
 whose name was specified in the constructor.  The value is
 returned in an Integer object.
 If the system property is defined to be a value that can be
 parsed successfully by Integer.decode,
 then this method returns an Integer with the
 parsed value.  Otherwise, if a default value was supplied to
 this object's constructor, then this method returns an
 Integer with that default value, or else
 null is returned.
run in interface PrivilegedActionInteger representing the value of the
 system property or the default value, or null
  | 
GigaSpaces XAP 9.7.2 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||