com.sun.enterprise.universal.glassfish
Class GFSystem

java.lang.Object
  extended by com.sun.enterprise.universal.glassfish.GFSystem

public final class GFSystem
extends Object

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
GFSystem()
           
 
Method Summary
static Map<String,String> getProperties()
          Get the GFSystem Properties
static String getProperty(String key)
          Get a GF System Property
static void init()
           
static void setProperty(String key, String value)
          Set a GF System Property, null is acceptable for the name and/or value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GFSystem

public GFSystem()
Method Detail

init

public static final void init()

getProperties

public static final Map<String,String> getProperties()
Get the GFSystem Properties

Returns:
a snapshot copy of the dcurrent Properties

getProperty

public static final String getProperty(String key)
Get a GF System Property

Parameters:
key - the name of the property
Returns:
the value of the property

setProperty

public static final void setProperty(String key,
                                     String value)
Set a GF System Property, null is acceptable for the name and/or value.

Parameters:
key - the name of the property
value - the value of the property


Copyright © 2012 GlassFish Community. All Rights Reserved.