|
|||||||||
| Home >> All >> org >> objectstyle >> cayenne >> [ conf overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.objectstyle.cayenne.conf
Class DefaultConfiguration

java.lang.Objectorg.objectstyle.cayenne.conf.Configuration
org.objectstyle.cayenne.conf.DefaultConfiguration
- Direct Known Subclasses:
- BasicServletConfiguration, FileConfiguration
- public class DefaultConfiguration
- extends Configuration
Subclass of Configuration that uses the System CLASSPATH to locate resources.
If Cayenne classes are loaded using a different ClassLoader from
the application classes, this configuration needs to be bootstrapped
by calling Configuration.bootstrapSharedConfiguration(Class) 55 .
| Nested Class Summary |
| Nested classes inherited from class org.objectstyle.cayenne.conf.Configuration |
|
| Field Summary | |
private org.objectstyle.cayenne.util.ResourceLocator |
locator
the default ResourceLocator used for CLASSPATH loading |
private static org.apache.log4j.Logger |
logObj
|
| Fields inherited from class org.objectstyle.cayenne.conf.Configuration |
configurationShutdownHook, dataDomains, dataDomainsRef, DEFAULT_CONFIGURATION_CLASS, DEFAULT_DOMAIN_FILE, DEFAULT_LOGGING_PROPS_FILE, domainConfigurationName, ignoringLoadFailures, loadStatus, overrideFactory, resourceLoader, sharedConfiguration |
| Constructor Summary | |
DefaultConfiguration()
Default constructor. |
|
DefaultConfiguration(java.lang.String domainConfigurationName)
Constructor with a named domain configuration resource. |
|
| Method Summary | |
void |
addClassPath(java.lang.String customPath)
Adds a custom path for class path lookups. |
boolean |
canInitialize()
Default implementation of Configuration.canInitialize() 55 . |
void |
didInitialize()
Default implementation of Configuration.didInitialize() 55 . |
protected java.io.InputStream |
getDomainConfiguration()
Returns the domain configuration as a stream or null if it
cannot be found. |
protected java.io.InputStream |
getMapConfiguration(java.lang.String location)
Returns the org.objectstyle.cayenne.map.DataMap configuration from a specified location or null if it cannot be found. |
protected org.objectstyle.cayenne.util.ResourceLocator |
getResourceLocator()
Returns the default ResourceLocator configured for CLASSPATH lookups. |
void |
initialize()
Initializes all Cayenne resources. |
protected void |
setResourceLocator(org.objectstyle.cayenne.util.ResourceLocator locator)
Sets the specified org.objectstyle.cayenne.util.ResourceLocator. |
java.lang.String |
toString()
Convert this Object to a human-readable String. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
logObj
private static org.apache.log4j.Logger logObj
locator
private org.objectstyle.cayenne.util.ResourceLocator locator
- the default ResourceLocator used for CLASSPATH loading
| Constructor Detail |
DefaultConfiguration
public DefaultConfiguration()
- Default constructor.
Simply calls
DefaultConfiguration(String)55 withConfiguration.DEFAULT_DOMAIN_FILE55 as argument.
DefaultConfiguration
public DefaultConfiguration(java.lang.String domainConfigurationName)
- Constructor with a named domain configuration resource.
Simply calls
Configuration.Configuration(String)55 .
| Method Detail |
addClassPath
public void addClassPath(java.lang.String customPath)
- Adds a custom path for class path lookups.
Format should be "my/package/name" without leading "/".
This allows for easy customization of custom search paths after
Constructor invocation:
conf = new DefaultConfiguration(); conf.addClassPath("my/package/name"); Configuration.initializeSharedConfiguration(conf);
canInitialize
public boolean canInitialize()
- Default implementation of
Configuration.canInitialize()55 . Creates a ResourceLocator suitable for loading from the CLASSPATH, unless it has already been set in a subclass. Always returnstrue.- Specified by:
canInitializein classConfiguration
initialize
public void initialize()
throws java.lang.Exception
- Initializes all Cayenne resources. Loads all configured domains and their
data maps, initializes all domain Nodes and their DataSources.
- Specified by:
initializein classConfiguration
didInitialize
public void didInitialize()
- Default implementation of
Configuration.didInitialize()55 . Currently does nothing except logging.- Specified by:
didInitializein classConfiguration
getResourceLocator
protected org.objectstyle.cayenne.util.ResourceLocator getResourceLocator()
- Returns the default ResourceLocator configured for CLASSPATH lookups.
- Specified by:
getResourceLocatorin classConfiguration
setResourceLocator
protected void setResourceLocator(org.objectstyle.cayenne.util.ResourceLocator locator)
- Sets the specified org.objectstyle.cayenne.util.ResourceLocator.
Currently called from
initialize()55 .
getDomainConfiguration
protected java.io.InputStream getDomainConfiguration()
- Returns the domain configuration as a stream or
nullif it cannot be found. Uses the configured org.objectstyle.cayenne.util.ResourceLocator to find the file.- Specified by:
getDomainConfigurationin classConfiguration
getMapConfiguration
protected java.io.InputStream getMapConfiguration(java.lang.String location)
- Returns the org.objectstyle.cayenne.map.DataMap configuration
from a specified location or
nullif it cannot be found. Uses the configured org.objectstyle.cayenne.util.ResourceLocator to find the file.- Specified by:
getMapConfigurationin classConfiguration
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object - Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null, string concatenation will instead use"null".The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode()).
|
|||||||||
| Home >> All >> org >> objectstyle >> cayenne >> [ conf overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC