Expresso 5-6

com.jcorporate.expresso.core.dataobjects
Class PersistenceManager

java.lang.Object
  extended bycom.jcorporate.expresso.kernel.ComponentBase
      extended bycom.jcorporate.expresso.kernel.ContainerComponentBase
          extended bycom.jcorporate.expresso.core.dataobjects.PersistenceManager
All Implemented Interfaces:
ComponentLifecycle, Containable, Describable, ExpressoComponent, Serializable

public class PersistenceManager
extends ContainerComponentBase
implements ComponentLifecycle

This is the persistence manager class. It currently contains a type mapper and a configuration engine. Other components such as Transaction Manager, etc are to be added at later dates.

Since:
Expresso 5.1
Author:
Michael Rimov
See Also:
Serialized Form

Constructor Summary
PersistenceManager()
          Default constructor
 
Method Summary
 void configure(Configuration newConfig)
          Lifecycle event for configuration.
 void destroy()
          Event Handler for the destruction of this component.
 String getConfigName()
          Retrieve the db configuration name
 String getDataContext()
          Read only property that tells what data context we're a part of.
 String getDataURL()
          Get the database connection url
 DBConfig getDBConfig()
          Get the DBConfig Class
 String getPassword()
          Retrieve the password for this data connection
 TypeMapper getTypeMapper()
          Retrieve the TypeMapper associated with this persistence connection.
 String getUserName()
          Retrieve the user name for this db connection
 void initialize()
          Init lifecycle event
 void reconfigure(Configuration newConfig)
          Lifecycle event for reconfiguration.
 void setConfigName(String configName)
          Set the db configuration name
 void setDataURL(String dataURL)
          Set the database connection URL
 void setPassword(String password)
          Set the password for this data connection
 void setUserName(String userName)
          Set the user name for the db connection
 
Methods inherited from class com.jcorporate.expresso.kernel.ContainerComponentBase
getContainerImplementation, locateComponent, setContainerImplementation
 
Methods inherited from class com.jcorporate.expresso.kernel.ComponentBase
getMetaData, getMetadataLocation, getParent, setMetaData, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jcorporate.expresso.kernel.ExpressoComponent
getMetaData, getParent, setParent
 

Constructor Detail

PersistenceManager

public PersistenceManager()
Default constructor

Method Detail

initialize

public void initialize()
Init lifecycle event

Specified by:
initialize in interface ComponentLifecycle

configure

public void configure(Configuration newConfig)
               throws ConfigurationException
Lifecycle event for configuration. Set all the properties upon normal usage.

Specified by:
configure in interface ComponentLifecycle
Parameters:
newConfig - Configuration read-only 'bean'
Throws:
ConfigurationException - upon receiving invalid configuration values

reconfigure

public void reconfigure(Configuration newConfig)
                 throws ConfigurationException
Lifecycle event for reconfiguration. Nulls out all variables and calls configure with the enw values.

Specified by:
reconfigure in interface ComponentLifecycle
Parameters:
newConfig - Configuration read-only 'bean'
Throws:
ConfigurationException - upon receiving invalid configuration values

destroy

public void destroy()
Event Handler for the destruction of this component.

Specified by:
destroy in interface ComponentLifecycle

getTypeMapper

public TypeMapper getTypeMapper()
Retrieve the TypeMapper associated with this persistence connection.

Returns:
an instance of the TypeMapper for this data context

getDBConfig

public DBConfig getDBConfig()
Get the DBConfig Class

Returns:
the DBConfig for this context.

getDataContext

public String getDataContext()
Read only property that tells what data context we're a part of. Easier method than

Returns:
the data context that this persistence engine is dwelling in.

setConfigName

public void setConfigName(String configName)
Set the db configuration name

Parameters:
configName - the name of the database configuration to use.

getConfigName

public String getConfigName()
Retrieve the db configuration name

Returns:
java.lang.String

setDataURL

public void setDataURL(String dataURL)
Set the database connection URL

Parameters:
dataURL - a new URL formatted datbase URL

getDataURL

public String getDataURL()
Get the database connection url

Returns:
java.lang.String (URL Formatting)

setUserName

public void setUserName(String userName)
Set the user name for the db connection

Parameters:
userName - An alphanumeric user name

getUserName

public String getUserName()
Retrieve the user name for this db connection

Returns:
java.lang.String

setPassword

public void setPassword(String password)
Set the password for this data connection

Parameters:
password - The password for the JDBC connection.

getPassword

public String getPassword()
Retrieve the password for this data connection

Returns:
java.lang.String

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.