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

Quick Search    Search Deep

nectar
Class ServicesUtil  view ServicesUtil download ServicesUtil.java

java.lang.Object
  extended bynectar.ServicesUtil

public final class ServicesUtil
extends java.lang.Object

A collection of static methods to quickly retrieve the fundamental Services.


Field Summary
private static nectar.services.AuthenticationService authenticationService
           
private static java.lang.String configurationFile
           
private static nectar.configuration.ConfigurationService configurationService
           
private static javax.servlet.ServletContext context
           
private static nectar.data.DataAdapterService dataAdapter
           
private static javax.sql.DataSource dataSource
           
private static java.lang.String extensionDir
           
private static org.apache.struts.config.ModuleConfig moduleConfig
           
private static nectar.services.RecordService recordService
           
private static nectar.template.TemplateService templateService
           
 
Constructor Summary
ServicesUtil()
           
 
Method Summary
static void destroy()
          Initialize all the Nectar Services.
static nectar.services.AuthenticationService getAuthenticationService()
          Returns the AutenticationService
static java.lang.String getConfigurationFile()
          Returns the full nectar_config.xml Configuration filepath for Nectar.
static nectar.configuration.ConfigurationService getConfigurationService()
          Returns the ConfigurationService
static java.sql.Connection getConnection()
          Get an SQL Statement Object from the DataSource.
static nectar.data.DataAdapterService getDataAdapter()
          Returns the DataAdapterService
static javax.sql.DataSource getDataSource()
          Returns the DataSource configured for Nectar.
static java.lang.String getExtensionDir()
           
static org.apache.struts.config.ModuleConfig getModuleConfig()
           
static nectar.services.RecordService getRecordService()
          Returns the RecordService
static Service getService(java.lang.String name)
          Returns a given Service by it's name
static javax.servlet.ServletContext getServletContext()
          Returns the ServletContext for the Nectar Servlet.
static nectar.template.TemplateService getTemplateService()
          Returns the TemplateService
static void init()
          Initialize the ConfigurationService, which in turn will initialize all the Services.
static void resetConfiguration()
          Reset all the Services.
static void setConfigurationFile(java.lang.String file)
          Sets the nectar_config.xml Configuration filepath for Nectar.
static void setDataSource(javax.sql.DataSource ds)
          Set the DataSource for Nectar.
static void setExtensionDir(java.lang.String path)
           
static void setModuleConfig(org.apache.struts.config.ModuleConfig c)
           
static void setServletContext(javax.servlet.ServletContext c)
          Sets the ServletContext for the Nectar Servlet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configurationFile

private static java.lang.String configurationFile

configurationService

private static nectar.configuration.ConfigurationService configurationService

recordService

private static nectar.services.RecordService recordService

authenticationService

private static nectar.services.AuthenticationService authenticationService

templateService

private static nectar.template.TemplateService templateService

dataSource

private static javax.sql.DataSource dataSource

dataAdapter

private static nectar.data.DataAdapterService dataAdapter

context

private static javax.servlet.ServletContext context

moduleConfig

private static org.apache.struts.config.ModuleConfig moduleConfig

extensionDir

private static java.lang.String extensionDir
Constructor Detail

ServicesUtil

public ServicesUtil()
Method Detail

setConfigurationFile

public static void setConfigurationFile(java.lang.String file)
Sets the nectar_config.xml Configuration filepath for Nectar. This method is called by NectarPlugin, and shouldn't be used elsewhere.


getConfigurationFile

public static java.lang.String getConfigurationFile()
Returns the full nectar_config.xml Configuration filepath for Nectar.


setExtensionDir

public static void setExtensionDir(java.lang.String path)

getExtensionDir

public static java.lang.String getExtensionDir()

init

public static void init()
                 throws nectar.configuration.ConfigurationException,
                        ServiceException
Initialize the ConfigurationService, which in turn will initialize all the Services. This method is called by the NectarPlugin class, and shouldn't be used elsewhere.


destroy

public static void destroy()
Initialize all the Nectar Services. This method is called by the NectarPlugin class, and shouldn't be used elsewise.


getService

public static Service getService(java.lang.String name)
                          throws nectar.configuration.ConfigurationException
Returns a given Service by it's name


getConfigurationService

public static nectar.configuration.ConfigurationService getConfigurationService()
Returns the ConfigurationService


getRecordService

public static nectar.services.RecordService getRecordService()
Returns the RecordService


getAuthenticationService

public static nectar.services.AuthenticationService getAuthenticationService()
Returns the AutenticationService


getTemplateService

public static nectar.template.TemplateService getTemplateService()
Returns the TemplateService


getDataAdapter

public static nectar.data.DataAdapterService getDataAdapter()
Returns the DataAdapterService


getDataSource

public static javax.sql.DataSource getDataSource()
Returns the DataSource configured for Nectar.


setDataSource

public static void setDataSource(javax.sql.DataSource ds)
Set the DataSource for Nectar. This function is called by NectarPlugin and shouldn't be used elsewhere.


getServletContext

public static javax.servlet.ServletContext getServletContext()
Returns the ServletContext for the Nectar Servlet. This should really only be used for the configuration and initialization stage, when no actions are being executed.


setServletContext

public static void setServletContext(javax.servlet.ServletContext c)
Sets the ServletContext for the Nectar Servlet. This is called by the Servlet framework through NectarPlugin, and shouldn't be used elsewise.


getModuleConfig

public static org.apache.struts.config.ModuleConfig getModuleConfig()

setModuleConfig

public static void setModuleConfig(org.apache.struts.config.ModuleConfig c)

getConnection

public static java.sql.Connection getConnection()
                                         throws nectar.data.DataException
Get an SQL Statement Object from the DataSource. This is a shortcut for SQLDataAdapters and creates a new Statement from one of the pooled connections in the DataSource.


resetConfiguration

public static void resetConfiguration()
                               throws nectar.configuration.ConfigurationException,
                                      ServiceException
Reset all the Services. Once a new Configuration file is written, this method can shutdown and reload all the services on the new configuration file.