class ManagerConfig
extends java.lang.Object
This class receives the command line arguments and will be instantiated. Set property information of Manager with the configuration file specified by the command line argument or the environment variable etc. The priorities of each configuration are as follows:
| Modifier and Type | Field and Description | 
|---|---|
static java.lang.String | 
CONFIG_FILE_ENV
 The environment variable to distinguish the default configuration
 file path 
 | 
protected Properties | 
m_argprop
 configuration properties from arguments 
 | 
protected java.lang.String | 
m_configFile
 Manager's configuration file path 
 | 
protected boolean | 
m_isMaster
 Manager master flag
 
 true:master,false:slave 
 | 
| Constructor and Description | 
|---|
ManagerConfig()
 Constructor 
 | 
ManagerConfig(java.lang.String[] args)
 Constructor 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
configure(Properties properties)
 Specify the configuration information to the Property 
 | 
protected boolean | 
fileExist(java.lang.String filePath)
 Check the file existence 
 | 
protected boolean | 
findConfigFile()
 Find the configuration file 
 | 
void | 
init(java.lang.String[] args)
 Initialization 
 | 
protected void | 
parseArgs(java.lang.String[] args)
 Parse the command arguments 
 | 
protected void | 
setSystemInformation(Properties properties)
 Set system information 
 | 
public static final java.lang.String CONFIG_FILE_ENV
protected java.lang.String m_configFile
protected boolean m_isMaster
protected Properties m_argprop
public ManagerConfig()
public ManagerConfig(java.lang.String[] args)
              throws java.lang.Exception
Initialize configuration information by given arguments.
args - 
   The command line argumentsjava.lang.Exceptionpublic void init(java.lang.String[] args)
          throws java.lang.Exception
Initialize with command line options. The following command options are available.
args - 
   The command line argumentsjava.lang.Exceptionpublic void configure(Properties properties) throws java.io.FileNotFoundException, java.io.IOException
Configure to the properties specified by Manager's configuration
properties - 
   The target properties to configurejava.io.IOExceptionjava.io.FileNotFoundExceptionprotected void parseArgs(java.lang.String[] args)
                  throws java.lang.IllegalArgumentException
args - 
   The command line argumentsjava.lang.IllegalArgumentExceptionprotected boolean findConfigFile()
Find the configuration file and configure it. Confirm the file existence when the configuration file has already configured. The configuration file is retrieved in the following order.
protected void setSystemInformation(Properties properties)
Get the following system info. and set them to Manager's properties.
properties - 
   Properties to set system informationprotected boolean fileExist(java.lang.String filePath)
Confirm whether the specified file exists
filePath - 
   The target confirmation file