Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.jcorporate.expresso.kernel
Class DataContext  view DataContext download DataContext.java

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

public class DataContext
extends ContainerComponentBase
implements ComponentLifecycle

This class is the code equivilant of the original <context> tag in the older expresso-config files. It is basically a container used to map components to their underlying data sources.

Each data context will have at most one Persistence engine. It could be JDBC, or in the future, EJB, or even CSV files for persistence.

Each data context can use other data contexts for security. This is set via the securityContext property.

Since:
Expresso 5.1

Field Summary
private  java.lang.String contextDescription
           
private  java.util.Map customProperties
           
private  java.lang.Boolean hasSetupTables
           
(package private) static org.apache.log4j.Logger log
           
private  boolean mailDebug
           
private  java.lang.String securityContext
           
private  java.util.Map setupValues
           
 
Fields inherited from class com.jcorporate.expresso.kernel.ContainerComponentBase
 
Fields inherited from class com.jcorporate.expresso.kernel.ComponentBase
 
Constructor Summary
DataContext()
          The default constructor.
 
Method Summary
 void configure(Configuration newConfig)
          This is the implementation of the ExpressoComponent configure() component event lifecycle.
 void destroy()
          Destroy event of the ComponentLifecycle interface.
 java.lang.String getContextDescription()
          Retrieves the context description
 java.util.Map getCustomProperties()
          Custom Properties Map that was identical to that of the customProperties in the old Expresso 5 config file.
 java.lang.String getCustomProperty(java.lang.String key)
          Retrieves the custom property by key.
 java.lang.Boolean getHasSetupTables()
          Returns a Boolean object value equivilant to the tranditional javabean naming convention.
 java.lang.String getSecurityContext()
          Retrieve the name of the security context to use for objects in this data context.
 java.lang.String getSetupValue(java.lang.String key)
          Retrieve a 'setup value'.
 java.util.Map getSetupValues()
          Retrieves a map of all setup values for this data context.
 void initialize()
          Implementation of the ExpressoComponent initialize() component lifecycle event.
 boolean isMailDebug()
           
 boolean isSetupTables()
          Returns a boolean value equivilant to the tranditional javabean naming convention.
 void reconfigure(Configuration newConfig)
          Reconfiguration implementation of the Expresso event lifecycles.
 void setContextDescription(java.lang.String contextDescription)
          Sets the context description.
 void setHasSetupTables(java.lang.Boolean hasSetupTables)
          Sets the 'Has Setup Tables' parameter.
 void setMailDebug(boolean mailDebug)
           
 void setMailDebug(java.lang.Boolean mailDebug)
          Sets whether emailings performed from the system should be debugged or not.
 void setSecurityContext(java.lang.String newValue)
          Sets the security context for this data context.
 void setSetupValue(java.lang.String key, java.lang.String object)
          Sets the particular setup value to the specified string.
 
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
 

Field Detail

log

static org.apache.log4j.Logger log

setupValues

private java.util.Map setupValues

customProperties

private java.util.Map customProperties

securityContext

private java.lang.String securityContext

hasSetupTables

private java.lang.Boolean hasSetupTables

contextDescription

private java.lang.String contextDescription

mailDebug

private boolean mailDebug
Constructor Detail

DataContext

public DataContext()
The default constructor. Should do nothing.

Method Detail

getSetupValue

public java.lang.String getSetupValue(java.lang.String key)
Retrieve a 'setup value'. This is a String property identical to the old Setup table, but any setup values here are context-wide... as opposed to Setup values for the root container have runtime scope.


setSetupValue

public void setSetupValue(java.lang.String key,
                          java.lang.String object)
Sets the particular setup value to the specified string.


getSetupValues

public java.util.Map getSetupValues()
Retrieves a map of all setup values for this data context. The setup values map is read only and will not allow any modifications.


setSecurityContext

public void setSecurityContext(java.lang.String newValue)
Sets the security context for this data context. The security context is the context used for any of the traditional 'setup tables'


getSecurityContext

public java.lang.String getSecurityContext()
Retrieve the name of the security context to use for objects in this data context.


initialize

public void initialize()
Implementation of the ExpressoComponent initialize() component lifecycle event.

Specified by:
initialize in interface ComponentLifecycle

configure

public void configure(Configuration newConfig)
               throws com.jcorporate.expresso.kernel.exception.ConfigurationException
This is the implementation of the ExpressoComponent configure() component event lifecycle.

Specified by:
configure in interface ComponentLifecycle

reconfigure

public void reconfigure(Configuration newConfig)
                 throws com.jcorporate.expresso.kernel.exception.ConfigurationException
Reconfiguration implementation of the Expresso event lifecycles.

Specified by:
reconfigure in interface ComponentLifecycle

destroy

public void destroy()
Destroy event of the ComponentLifecycle interface. The underlying container implementation does the acutal destroying of all subcomponents before this component is itself destroyed.

Specified by:
destroy in interface ComponentLifecycle

setHasSetupTables

public void setHasSetupTables(java.lang.Boolean hasSetupTables)
Sets the 'Has Setup Tables' parameter. This may disappear in the future since it merely designates that the ExpressoSchema should be included in this particular data context.


isSetupTables

public boolean isSetupTables()
Returns a boolean value equivilant to the tranditional javabean naming convention.


getHasSetupTables

public java.lang.Boolean getHasSetupTables()
Returns a Boolean object value equivilant to the tranditional javabean naming convention.


setContextDescription

public void setContextDescription(java.lang.String contextDescription)
Sets the context description.


getContextDescription

public java.lang.String getContextDescription()
Retrieves the context description


getCustomProperties

public java.util.Map getCustomProperties()
Custom Properties Map that was identical to that of the customProperties in the old Expresso 5 config file. It is recommended that you no longer use this.


getCustomProperty

public java.lang.String getCustomProperty(java.lang.String key)
Retrieves the custom property by key.


setMailDebug

public void setMailDebug(java.lang.Boolean mailDebug)
Sets whether emailings performed from the system should be debugged or not.


setMailDebug

public void setMailDebug(boolean mailDebug)

isMailDebug

public boolean isMailDebug()