Class 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 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