Interface AppGlobalContext

  • All Known Implementing Classes:
    AppGlobalContextImpl

    public interface AppGlobalContext

    This interface represents the global information of an application. An application could save this at its global level to let each request access them. Currently, this interface is only used by ASP(x) application.

    This interface is not thread-safe. The correct usage would be to set this object up in one thread. After it has been set up, all threads should only read information from this object.

    This class is not responsible anymore for loading init parameters from "web.xml" or "microstrategy.xml" Now, this is done by the ApplicationParameters. To get the value of an init parameter, get the instance of this class from the com.microstrategy.utils.config.ConfigurationFilesCache and use the getParameter method, for example:

       ApplicationParameters appParams = (ApplicationParameters) ConfigurationFilesCache.getConfiguration("/WEB-INF/microstrategy.xml", ApplicationParameters.class);
    
       String value = appParams.getParameter("parameter", "servlet");
     

    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.String getApplicationPath()
      Returns the application's path.
      java.lang.String getBasePath()
      Returns current application's base path.
      java.lang.String getInitParameter​(java.lang.String paramName)
      Deprecated.
      The AppGlobalContext is not responsible to load init parameters.Use ContainerServices instead.
      java.util.Enumeration getInitParameterNames()
      Deprecated.
      The AppGlobalContext is not responsible to load init parameters.
      java.lang.String getRequestServerName()
      Returns the request server name.
      java.lang.String getServletName()
      Deprecated.
      The AppGlobalContext should not hold the servlet name
      void loadInitParameters​(java.lang.String relPath, java.lang.String servletName)
      Deprecated.
      The AppGlobalContext is not responsible to load init parameters.
      void setApplicationPath​(java.lang.String applPath)
      Sets the application's base URL used to build link and form URLs.
      void setBasePath​(java.lang.String basePath)
      Sets the base path for loading different application resources.
      void setRequestServerName​(java.lang.String serverName)
      Sets the request server name
    • Method Detail

      • setBasePath

        void setBasePath​(java.lang.String basePath)
        Sets the base path for loading different application resources.
        Parameters:
        basePath - a path to a root directory of application resources. All resource pathes are resolved relative to this path.
      • getBasePath

        java.lang.String getBasePath()
                              throws java.lang.IllegalStateException
        Returns current application's base path.
        Returns:
        The curretn application's base path.
        Throws:
        java.lang.IllegalStateException - thrown when the application's base path has not been set.
      • setApplicationPath

        void setApplicationPath​(java.lang.String applPath)
        Sets the application's base URL used to build link and form URLs.
        Parameters:
        applPath - application path
      • getApplicationPath

        java.lang.String getApplicationPath()
                                     throws java.lang.IllegalStateException
        Returns the application's path.
        Returns:
        The current application's path.
        Throws:
        java.lang.IllegalStateException - thrown when the application path has not been set.
      • setRequestServerName

        void setRequestServerName​(java.lang.String serverName)
        Sets the request server name
        Parameters:
        serverName - The server who serves the request.
      • getRequestServerName

        java.lang.String getRequestServerName()
                                       throws java.lang.IllegalStateException
        Returns the request server name.
        Returns:
        The request server name.
        Throws:
        java.lang.IllegalStateException - thrown when the server name has not been set.
      • loadInitParameters

        void loadInitParameters​(java.lang.String relPath,
                                java.lang.String servletName)
        Deprecated.
        The AppGlobalContext is not responsible to load init parameters. We don't need this method anymore. The implementation of ContainerServices is responsible for loading init parameters.
        Loads servlet's initialization parameters from the web.xml
        Parameters:
        relPath - relative path to the xml file containig parameters (include the xml name)
        servletName - servlet name
      • getInitParameter

        java.lang.String getInitParameter​(java.lang.String paramName)
        Deprecated.
        The AppGlobalContext is not responsible to load init parameters.Use ContainerServices instead.
        Returns initialization parameter value
        Parameters:
        paramName - parameter name
        Returns:
        parameter value
        See Also:
        ContainerServices
      • getInitParameterNames

        java.util.Enumeration getInitParameterNames()
        Deprecated.
        The AppGlobalContext is not responsible to load init parameters.
        Returns enumeration of initialization parameter names
        Returns:
        enumeration of initialization parameter names
        See Also:
        AppGlobalContext
      • getServletName

        java.lang.String getServletName()
        Deprecated.
        The AppGlobalContext should not hold the servlet name
        Returns the name of the servlet used to initialized this AppGlobalContext.
        Since:
        MicroStrategy Web 9.0.0