toolbox.app
Class AppEnv

Package class diagram package AppEnv
java.lang.Object
  extended by toolbox.app.AppEnv

public class AppEnv
extends java.lang.Object

Generic application environment class.

This class specifies that an application is devided into two sections:

  • Data Access Objects.
  • Services
  • Services are POJO's that define interfaces for business services. DAO's persist the data generated by Services and retrieve the data that is used by the Services.

    This class provides access to service configuration and also provides access to the DAO's for interacting with the database.


    Method Summary
     void destroy()
              Destroy this environment.
     DaoManager getDaoManager()
              Returns the DaoManager for this environment.
    static AppEnv getInstance(java.util.Properties p)
              Initialise the AppEnv from the XML configuration specified by the given properties instance.
     java.lang.String getName()
              Return the name of this environment.
     XMLProperties getServiceConfig(java.lang.String serviceName)
              Return the named service configuration.
     XMLProperties getXMLProperties()
              Returns the XML configuration for this environment.
    protected  void setName(java.lang.String name)
              Set the name of this environment.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Method Detail

    getInstance

    public static AppEnv getInstance(java.util.Properties p)
                              throws ConfException,
                                     DaoException
    Initialise the AppEnv from the XML configuration specified by the given properties instance.

    Returns:
    AppEnv instance.
    Throws:
    ConfException
    DaoException

    getName

    public java.lang.String getName()
    Return the name of this environment.

    Returns:
    String containing the name of this environment.

    setName

    protected void setName(java.lang.String name)
    Set the name of this environment.

    Parameters:
    name - String containing the name of this environment.

    getServiceConfig

    public XMLProperties getServiceConfig(java.lang.String serviceName)
    Return the named service configuration.

    Parameters:
    serviceName - Service name.
    Returns:
    XMLProperties for service.

    getDaoManager

    public DaoManager getDaoManager()
    Returns the DaoManager for this environment.

    Returns:
    DaoManager

    getXMLProperties

    public XMLProperties getXMLProperties()
    Returns the XML configuration for this environment.

    Returns:
    XMLProperties.

    destroy

    public void destroy()
                 throws AppException
    Destroy this environment.

    Throws:
    AppException.
    AppException