|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.monoserv.patterns.Singleton
com.monoserv.MonoConfiguration
public class MonoConfiguration
A configuration object that works as a Singleton object and returns data stored in a configuration file. The configuration file is essentially a properties file. The default filename configuration file is "monoserv.config".
Constructor Summary | |
---|---|
protected |
MonoConfiguration()
Hide the constructor - not needed with Singletons |
Method Summary | |
---|---|
static java.lang.String |
getField(java.lang.String key)
Checks the internal hashtable that has the configuration data and returns the value of the associated field if it exists. |
java.lang.Object |
getInstance()
Convienence function for getInstance("monoserv.config") |
static java.lang.Object |
getInstance(java.lang.String filename)
Instantiates the global object if it has not already been created. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected MonoConfiguration()
Method Detail |
---|
public java.lang.Object getInstance()
getInstance
in class Singleton
getInstance(String)
public static java.lang.Object getInstance(java.lang.String filename) throws java.lang.RuntimeException
filename
- The file and path of the configuration file.
java.lang.RuntimeException
- If an error occurspublic static java.lang.String getField(java.lang.String key) throws java.lang.RuntimeException
key
- The name of the field that you want the value of
java.lang.RuntimeException
- If a field is not found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |