|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.xorm.util.AppConfig
Generic JDO application configuration. This object encapsulates the basic functionality required to instantiate a set of properties and a JDO persistence manager factory.
AppConfigFactory| Field Summary | |
static String |
DEFAULT_CONNECTION_NAME
|
protected Logger |
logger
|
protected Hashtable |
pmFactoriesByName
|
protected Properties |
props
|
| Constructor Summary | |
AppConfig()
Constructor |
|
AppConfig(Properties props)
Constructor from Properties |
|
| Method Summary | |
static AppConfig |
getAppConfig(String jndiConfigResource,
String configFileSystemProperty,
String defaultConfigFile)
Convenience method for getting a new AppConfig instance. |
static AppConfig |
getAppConfig(String jndiConfigResource,
String configFileSystemProperty,
String defaultConfigFile,
Class appConfigClass)
Convenience method for getting a new AppConfig instance. |
PersistenceManager |
getPersistenceManager()
Convenience method to get a persistence manager |
PersistenceManager |
getPersistenceManager(String name)
Convenience method to get a persistence manager |
PersistenceManagerFactory |
getPersistenceManagerFactory()
Get the default persistence manager factory |
PersistenceManagerFactory |
getPersistenceManagerFactory(String name)
Get the associated persistence manager factory |
Properties |
getProperties()
Get the underlying properties that this object wraps |
String |
getProperty(String propName)
Get a property value |
String |
getProperty(String propName,
String defaultValue)
Get a property value with a default |
protected void |
loadProperties(Properties newProps)
Load and absorb a set of properties |
protected void |
loadProperties(String propertyFileOrResource)
Load properties from a file or resource |
void |
setPropertiesFile(String propertiesFile)
This is called by the JRE or servlet engine resource manager. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String DEFAULT_CONNECTION_NAME
protected Logger logger
protected Properties props
protected Hashtable pmFactoriesByName
| Constructor Detail |
public AppConfig()
public AppConfig(Properties props)
props - the Properties to clone and use| Method Detail |
protected void loadProperties(String propertyFileOrResource)
propertyFileOrResource - the file or resource path to the given
properties file; the file system is checked first, falling back on
the classpathprotected void loadProperties(Properties newProps)
newProps - the properties to absorbpublic String getProperty(String propName)
propName - the name of the value to get
public String getProperty(String propName,
String defaultValue)
propName - the name of the value to getdefaultValue - the value to return if the given property
was not explicitly set
public Properties getProperties()
public PersistenceManagerFactory getPersistenceManagerFactory()
PersistenceManagerFactorypublic PersistenceManagerFactory getPersistenceManagerFactory(String name)
name - the name of the connection, used as a property prefix
PersistenceManagerFactorypublic PersistenceManager getPersistenceManager()
PersistenceManagerpublic PersistenceManager getPersistenceManager(String name)
name - the name of the connection, used as a property prefix
PersistenceManagerpublic void setPropertiesFile(String propertiesFile)
public static AppConfig getAppConfig(String jndiConfigResource,
String configFileSystemProperty,
String defaultConfigFile)
public static AppConfig getAppConfig(String jndiConfigResource,
String configFileSystemProperty,
String defaultConfigFile,
Class appConfigClass)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||