Java Doc for SystemProperties.java in  » Science » Cougaar12_4 » org » cougaar » bootstrap » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Cougaar12_4 » org.cougaar.bootstrap 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.cougaar.bootstrap.SystemProperties

SystemProperties
public class SystemProperties (Code)
Utility class to access system properties.





Method Summary
public static  voidexpandProperties()
     Expand System properties.

The purpose of the property expansion is to make Java properties clearer and easier to maintain.

public static  voidexpandProperties(Properties props)
    
public static  booleanfinalizeProperties()
     Prevent future calls to SystemProperties.overrideProperties -- this method is called early on by the Node.
public static  booleangetBoolean(String name)
    
public static  booleangetBoolean(String name, boolean deflt)
    
public static  doublegetDouble(String name, double deflt)
    
public static  doublegetDouble(String name, double deflt, boolean catchFormatError)
    
public static  doublegetDouble(String name, double deflt, double parseDeflt)
    
public static  floatgetFloat(String name, float deflt)
    
public static  floatgetFloat(String name, float deflt, boolean catchFormatError)
    
public static  floatgetFloat(String name, float deflt, float parseDeflt)
    
public static  intgetInt(String name, int deflt)
    
public static  intgetInt(String name, int deflt, boolean catchFormatError)
    
public static  intgetInt(String name, int deflt, int parseDeflt)
    
public static  longgetLong(String name, long deflt)
    
public static  longgetLong(String name, long deflt, boolean catchFormatError)
    
public static  longgetLong(String name, long deflt, long parseDeflt)
    
public static  PropertiesgetProperties()
    
public static  StringgetProperty(String name, String deflt)
     System property getter methods.
public static  StringgetProperty(String name)
    
public static  EnumerationgetPropertyNames()
    
public static  PropertiesgetStandardSystemProperties()
     Returns standard Java properies without the need for write privileges.
public static  PropertiesgetSystemPropertiesWithPrefix(String prefix)
     Return a Map of system properties.

This method return a Map of all properties that start with the specified prefix. Unlike the System.getProperties() method, this method does not require "write property" privileges.
Parameters:
  prefix - Used to return property names that start with this specified prefix.

public static synchronized  Stringgetenv(String name)
     Get an environment variable.
public static  voidoverrideProperties(Properties props)
     Replace the System properties with alternate properties.

This method allow us to:

  1. Define properties in secure environments where System properties access is restricted, e.g.
public static  StringresolveEnv(String orig_value, boolean windows)
     Resolve a string like the shell would resolve it, which includes SystemProperties.resolveVariables and Linux "\" removal.
public static  StringresolveVariables(String value, boolean windows, Map env_override, boolean default_to_getenv)
     Resolve environment variables.
public static  ObjectsetProperty(String name, String value)
     Set a system property.



Method Detail
expandProperties
public static void expandProperties()(Code)
Expand System properties.

The purpose of the property expansion is to make Java properties clearer and easier to maintain. Use the "${}" tag to introduce substitutable parameters, so they can be expanded to values indicated with tag names during property retrieval at runtime. Properties may be nested as shown in the example below:

 a       = "foo"
 a.subA  = "bob"
 c       = "subA"
 b = "${a} ${a.${c}}/smith"  => b = "foo bob/smith" after
 property expansion.
 



expandProperties
public static void expandProperties(Properties props)(Code)

See Also:   SystemProperties.expandProperties()
See Also:   



finalizeProperties
public static boolean finalizeProperties()(Code)
Prevent future calls to SystemProperties.overrideProperties -- this method is called early on by the Node.



getBoolean
public static boolean getBoolean(String name)(Code)



getBoolean
public static boolean getBoolean(String name, boolean deflt)(Code)



getDouble
public static double getDouble(String name, double deflt)(Code)



getDouble
public static double getDouble(String name, double deflt, boolean catchFormatError)(Code)



getDouble
public static double getDouble(String name, double deflt, double parseDeflt)(Code)



getFloat
public static float getFloat(String name, float deflt)(Code)



getFloat
public static float getFloat(String name, float deflt, boolean catchFormatError)(Code)



getFloat
public static float getFloat(String name, float deflt, float parseDeflt)(Code)



getInt
public static int getInt(String name, int deflt)(Code)



getInt
public static int getInt(String name, int deflt, boolean catchFormatError)(Code)



getInt
public static int getInt(String name, int deflt, int parseDeflt)(Code)



getLong
public static long getLong(String name, long deflt)(Code)



getLong
public static long getLong(String name, long deflt, boolean catchFormatError)(Code)



getLong
public static long getLong(String name, long deflt, long parseDeflt)(Code)



getProperties
public static Properties getProperties()(Code)
a limited System properties wrapper.
See Also:   SystemProperties.overrideProperties



getProperty
public static String getProperty(String name, String deflt)(Code)
System property getter methods.


See Also:   SystemProperties.overrideProperties
See Also:    notes on why these methods should be used instead
See Also:   of "System.getProperty(..)" / "Boolean.getBoolean(..)" / etc.




getProperty
public static String getProperty(String name)(Code)



getPropertyNames
public static Enumeration getPropertyNames()(Code)

See Also:   SystemProperties.getSystemPropertiesWithPrefix



getStandardSystemProperties
public static Properties getStandardSystemProperties()(Code)
Returns standard Java properies without the need for write privileges.

This method retrieve system properties without requiring write access privileges (which could be a potential security vulnerability).




getSystemPropertiesWithPrefix
public static Properties getSystemPropertiesWithPrefix(String prefix)(Code)
Return a Map of system properties.

This method return a Map of all properties that start with the specified prefix. Unlike the System.getProperties() method, this method does not require "write property" privileges.
Parameters:
  prefix - Used to return property names that start with this specified prefix. A Map of system properties.




getenv
public static synchronized String getenv(String name)(Code)
Get an environment variable.

This is easy in JDK 1.5, but in JDK 1.4 we need this workaround.




overrideProperties
public static void overrideProperties(Properties props)(Code)
Replace the System properties with alternate properties.

This method allow us to:

  1. Define properties in secure environments where System properties access is restricted, e.g. Applets.
  2. Define properties when multiple Nodes will run in the same JVM. A possible solution in that environment is to use Classloader-scoped properties, as in
     org.apache.commons.discovery.tools.ManagedProperties
     

See Also:   SystemProperties.finalizeProperties



resolveEnv
public static String resolveEnv(String orig_value, boolean windows)(Code)
Resolve a string like the shell would resolve it, which includes SystemProperties.resolveVariables and Linux "\" removal.

This is a decent approximation that handles the common cases, but it doesn't handle all the oddities..




resolveVariables
public static String resolveVariables(String value, boolean windows, Map env_override, boolean default_to_getenv)(Code)
Resolve environment variables.

For example, on Linux, this will resolve:
  a/$USER/b
to (say):
  a/root/b

Parameters:
  env_override - optional SystemProperties.getenv override map, which canbe null
Parameters:
  default_to_getenv - if a variable is not found in the "env_override"and this parameter is set to true, then look in SystemProperties.getenv




setProperty
public static Object setProperty(String name, String value)(Code)
Set a system property.
See Also:   SystemProperties.overrideProperties



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.