Class GFSystem
java.lang.Object
com.sun.enterprise.universal.glassfish.GFSystem
A replacement for System Properties
An InheritableThreadLocal is used to store the "impl". This means that the
initial thread that uses this class -- and all its sub-threads will get the
same System Properties.
Make sure that you don't create it from the main Thread -- otherwise all instances
will get the same props.
E.g.
main thread creates instance1-thread and instance2-thread
The 2 created threads should each call init() -- but the main thread should not.
In the usual case where there is just one instance in the JVM -- this class is also
perfectly usable. Just call any method when you need something.
- Author:
- bnevins
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the GFSystem Propertiesstatic final StringgetProperty(String key) Get a GF System Propertystatic final voidinit()static final voidsetProperty(String key, String value) Set a GF System Property, null is acceptable for the name and/or value.
-
Constructor Details
-
GFSystem
public GFSystem()
-
-
Method Details
-
init
public static final void init() -
getProperties
Get the GFSystem Properties- Returns:
- a snapshot copy of the dcurrent Properties
-
getProperty
Get a GF System Property- Parameters:
key- the name of the property- Returns:
- the value of the property
-
setProperty
Set a GF System Property, null is acceptable for the name and/or value.- Parameters:
key- the name of the propertyvalue- the value of the property
-