Package org.tn5250j

Class GlobalConfigure


  • public class GlobalConfigure
    extends ConfigureFactory
    Utility class for referencing global settings and functions of which at most one instance can exist per VM.

    Use GlobalConfigure.instance() to access this instance.

    • Constructor Summary

      Constructors 
      Constructor Description
      GlobalConfigure()
      The constructor is made protected to allow overriding.
    • Method Summary

      Modifier and Type Method Description
      java.lang.ClassLoader getClassLoader()
      Not sure yet so be careful using this.
      java.util.Properties getProperties()  
      java.util.Properties getProperties​(java.lang.String regKey)
      Returns the properties associated with a given registry key.
      java.util.Properties getProperties​(java.lang.String regKey, java.lang.String fileName)  
      java.util.Properties getProperties​(java.lang.String regKey, java.lang.String fileName, boolean createFile, java.lang.String header)  
      java.util.Properties getProperties​(java.lang.String regKey, java.lang.String fileName, boolean createFile, java.lang.String header, boolean reloadIfLoaded)  
      java.lang.String getProperty​(java.lang.String key)
      Returns the setting from the given key of the global properties.
      java.lang.String getProperty​(java.lang.String key, java.lang.String def)
      Returns the setting from the given key of the global properties or the default passed if the property does not exist.
      static GlobalConfigure instance()  
      void reloadSettings()
      Reload the environment settings.
      void saveSettings()
      Save the settings for the global configuration
      void saveSettings​(java.lang.String regKey)
      Save the setting in the registry using the key passed in with no header output.
      void saveSettings​(java.lang.String regKey, java.lang.String header)
      Save the settings in the registry using the key passed with a header in the output.
      void saveSettings​(java.lang.String regKey, java.lang.String fileName, java.lang.String header)
      Save the settings in the registry using the key passed with a header in the output.
      void setProperties​(java.lang.String regKey, java.lang.String fileName, java.lang.String header)
      Set the properties for the given registry key.
      void setProperties​(java.lang.String regKey, java.lang.String fileName, java.lang.String header, boolean createFile)
      Set the properties for the given registry key.
      void setProperties​(java.lang.String regKey, java.util.Properties regProps)
      Place the Properties in the registry under a given registry name
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ses

        public static final java.io.File ses
    • Constructor Detail

      • GlobalConfigure

        public GlobalConfigure()
        The constructor is made protected to allow overriding.
    • Method Detail

      • instance

        public static GlobalConfigure instance()
        Returns:
        The unique instance of this class.
      • saveSettings

        public void saveSettings()
        Save the settings for the global configuration
        Specified by:
        saveSettings in class ConfigureFactory
      • saveSettings

        public void saveSettings​(java.lang.String regKey)
        Save the setting in the registry using the key passed in with no header output.
        Specified by:
        saveSettings in class ConfigureFactory
        Parameters:
        regKey - registry key
      • saveSettings

        public void saveSettings​(java.lang.String regKey,
                                 java.lang.String header)
        Save the settings in the registry using the key passed with a header in the output.
        Specified by:
        saveSettings in class ConfigureFactory
        Parameters:
        regKey - registry key
        header - header
      • saveSettings

        public void saveSettings​(java.lang.String regKey,
                                 java.lang.String fileName,
                                 java.lang.String header)
        Save the settings in the registry using the key passed with a header in the output.
        Specified by:
        saveSettings in class ConfigureFactory
        Parameters:
        regKey - registry key
        header - header
      • setProperties

        public void setProperties​(java.lang.String regKey,
                                  java.util.Properties regProps)
        Place the Properties in the registry under a given registry name
        Specified by:
        setProperties in class ConfigureFactory
        Parameters:
        regKey - registry key
        regProps - properties
      • setProperties

        public void setProperties​(java.lang.String regKey,
                                  java.lang.String fileName,
                                  java.lang.String header)
        Set the properties for the given registry key.
        Specified by:
        setProperties in class ConfigureFactory
        Parameters:
        regKey - registry key
        fileName - a file name
        header - header
      • setProperties

        public void setProperties​(java.lang.String regKey,
                                  java.lang.String fileName,
                                  java.lang.String header,
                                  boolean createFile)
        Set the properties for the given registry key.
        Specified by:
        setProperties in class ConfigureFactory
        Parameters:
        regKey - registry key
        fileName - a file name
        header - header
        createFile - flag if settings should be saved
      • getProperties

        public java.util.Properties getProperties​(java.lang.String regKey)
        Returns the properties associated with a given registry key.
        Specified by:
        getProperties in class ConfigureFactory
        Parameters:
        regKey - registry key
        Returns:
        properties
      • getProperties

        public java.util.Properties getProperties()
      • getProperties

        public java.util.Properties getProperties​(java.lang.String regKey,
                                                  java.lang.String fileName)
        Specified by:
        getProperties in class ConfigureFactory
      • getProperties

        public java.util.Properties getProperties​(java.lang.String regKey,
                                                  java.lang.String fileName,
                                                  boolean createFile,
                                                  java.lang.String header)
        Specified by:
        getProperties in class ConfigureFactory
      • getProperties

        public java.util.Properties getProperties​(java.lang.String regKey,
                                                  java.lang.String fileName,
                                                  boolean createFile,
                                                  java.lang.String header,
                                                  boolean reloadIfLoaded)
        Specified by:
        getProperties in class ConfigureFactory
      • getProperty

        public java.lang.String getProperty​(java.lang.String key,
                                            java.lang.String def)
        Returns the setting from the given key of the global properties or the default passed if the property does not exist.
        Specified by:
        getProperty in class ConfigureFactory
        Parameters:
        key - key
        def - definition
        Returns:
        a string
      • getProperty

        public java.lang.String getProperty​(java.lang.String key)
        Returns the setting from the given key of the global properties.
        Specified by:
        getProperty in class ConfigureFactory
        Parameters:
        key - key
        Returns:
        a string
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Not sure yet so be careful using this.
        Returns:
        a class loader