|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectobixserver.core.ObixEnv
public class ObixEnv
Environment singleton. It holds obix server environment, including properties and version.
Field Summary | |
---|---|
private static ObixEnv |
instance
Singleton instance. |
private static Logger |
logger
|
private static Properties |
properties
Application Properties, loaded from application specific .properties file. |
private static String |
propfile
|
private String |
version
Version of the package/application. |
Constructor Summary | |
---|---|
ObixEnv()
|
Method Summary | |
---|---|
static ObixEnv |
getInstance()
Returns a singleton instance of this class. |
Properties |
getProperties()
|
String |
getProperty(String name)
Returns property previously loaded from properties file. |
String |
getProperty(String name,
String defaultValue)
Returns property previously loaded from properties file. |
int |
getPropertyInt(String name)
Returns property and throws exception of property doesn't exist or is not int. |
String |
getPropertyString(String name)
Returns property or throws exception of property doesn't exist. |
String |
getVersion()
Returns the version of this package. |
protected static void |
init(String resource)
Initializes the application, loading properties from given resource. |
static void |
initServer()
Initializes the server using the current directory to search for resources. |
static void |
initServer(String resourceFile)
|
static void |
initServer(String resourceDir,
String resourceFile)
Initializes the server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Logger logger
private static String propfile
private static ObixEnv instance
private String version
private static Properties properties
Constructor Detail |
---|
public ObixEnv()
Method Detail |
---|
public String getVersion()
protected static void init(String resource)
resource
- resource to load properties from.public static ObixEnv getInstance()
public String getProperty(String name)
name
-
public String getProperty(String name, String defaultValue)
name
- defaultValue
-
public int getPropertyInt(String name)
name
-
public String getPropertyString(String name)
name
-
public static void initServer()
public static void initServer(String resourceDir, String resourceFile)
resourceDir
- directory to use to load resources from.resourceFile
- file to use to load resources from.public static void initServer(String resourceFile)
public Properties getProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |