com.sage.orion.sdata.servlet
Class SDataServletContext

java.lang.Object
  extended by com.sage.orion.sdata.servlet.SDataServletContext

public class SDataServletContext
extends java.lang.Object

A class to hold the information that we want to hold for the whole servlet.

A single instance of this class is hung off the ServletContext (we only have one context; we do not run distributed). It is hung with a name that is the name of the class. REVIEW - This does not look quite right. Why does this hold the map but somebody else maintain the contents of the map? Surely this class should maintain the map.


Nested Class Summary
static class SDataServletContext.Mode
          The mode that the servlet is running: Host, Deployed or Test
 
Constructor Summary
SDataServletContext(javax.servlet.ServletContext context, java.util.Map<java.lang.String,SDataProvider> providerMap)
          creates an instance of the SDataServletContext class, sitting under the given ServletContext and supporting the given list of SDataProviders.
 
Method Summary
 java.lang.String getApplicationConfigPath(java.lang.String application)
          Gets the path to the directory where the application's configuration information is stored
 java.lang.String getBasePath()
          Gets the base path for the application; the location under which all the configuration files sit.
 java.lang.String getConfigurationPath()
          Gets the path to the directory where configuration information is stored
 SDataServletContext.Mode getMode()
          Gets the current running SDataServletContext.Mode and stores it in the static class mode variable.
 java.util.Map<java.lang.String,SDataProvider> getProviderMap()
          returns an immutable copy of the map of SDataProviders.
 javax.servlet.ServletContext getServletContext()
          Gets the ServletContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SDataServletContext

public SDataServletContext(javax.servlet.ServletContext context,
                           java.util.Map<java.lang.String,SDataProvider> providerMap)
creates an instance of the SDataServletContext class, sitting under the given ServletContext and supporting the given list of SDataProviders.

Parameters:
context - the servlet context under which this context sits
providerMap - the map of application names to SDataProvider application provider instances.
Method Detail

getServletContext

public javax.servlet.ServletContext getServletContext()
Gets the ServletContext.

Returns:
the servletContext

getBasePath

public java.lang.String getBasePath()
Gets the base path for the application; the location under which all the configuration files sit.

Returns:
the base path for the application.

getConfigurationPath

public java.lang.String getConfigurationPath()
Gets the path to the directory where configuration information is stored

Returns:
the path to the directory where configuration information is stored

getApplicationConfigPath

public java.lang.String getApplicationConfigPath(java.lang.String application)
Gets the path to the directory where the application's configuration information is stored

Parameters:
application - the name of the application, which must be one of the applications in the context
Returns:
the path to the directory where the application's configuration information is stored

getProviderMap

public java.util.Map<java.lang.String,SDataProvider> getProviderMap()
returns an immutable copy of the map of SDataProviders.

Although the returned copy is immutable it remains current; changes to the original are reflected in the copy.

Returns:
a map of SDataProviders containing an immutable copy of the context's map.

getMode

public SDataServletContext.Mode getMode()
Gets the current running SDataServletContext.Mode and stores it in the static class mode variable.

Returns:
the current SDataServletContext.Mode


Copyright © 2011 Sage Software, Inc. All rights reserved.