Package com.microstrategy.web.platform
Interface ContainerServicesContext
-
- All Known Subinterfaces:
ContainerServices,DisconnectedContainerServices
- All Known Implementing Classes:
AbstractConfigurableContainerServices,DisconnectedContainerServicesImpl,HttpServletContainerServices,ServletContainerServices
public interface ContainerServicesContextThis interfaces exposes, in a generic fashion, the services of any web application container. Whether the container is a servlet engine (Java) or a non-Java server (such as IIS), the methods exposed by this interface allow the caller to be unaware of the actual provider and the mechanics behind those calls. This inteface encapsulates operations that are available in the application context.- Since:
- MicroStrategy Web 9.0.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ApplicationParametersgetApplicationParameters()Returns the an ApplicationParameters instance that includes all the parameters defined in the microstrategy.xml or web.xml filejava.lang.StringgetContextPath()Returns the context path.java.lang.StringgetControllerParameter(java.lang.String paramName, java.lang.String controllerName)Returns initialization parameter value for the given controller.java.lang.StringgetInitParameter(java.lang.String paramName)Returns initialization parameter value for the controller associated with this ContainerServices.java.util.Enumeration<java.lang.String>getInitParameterNames()Returns enumeration of initialization parameter namesjava.lang.StringgetRealPath(java.lang.String relPath)This is a low level API call to the outside world - it returns the real path to a server-side resource.java.net.URLgetResource(java.lang.String relPath)Returns theURLassociated with the given resource path.java.io.InputStreamgetResourceAsStream(java.lang.String relPath)This method returns the contents of a file resource relative to the web application as an input stream.java.util.Set<java.lang.String>getResourcePaths(java.lang.String relPath)Returns a directory path strings of all the paths to resources within the application whose longest sub-path matches the supplied path.voidinitGlobalObjects()Initializes global instances, like FileLoader and Plugins, using this ContainerServices instance.
-
-
-
Method Detail
-
getRealPath
java.lang.String getRealPath(java.lang.String relPath)
This is a low level API call to the outside world - it returns the real path to a server-side resource. Exactly what is returned depends upon the underlying implementation. Note that this may be null if the path is inside an archived file. This call doesn't feature resource caching or MicroStrategy Web application's custom prefix (i.e. ABSOLUTE and RELATIVE) handling. UsingFileLoader.getRealPath(String)may be more appropriate.- Parameters:
relPath- AStringthat indicates the relative path of the file.- Returns:
- A
Stringthat indicates the full path of the file. - See Also:
FileLoader.getRealPath(String)
-
getResourceAsStream
java.io.InputStream getResourceAsStream(java.lang.String relPath)
This method returns the contents of a file resource relative to the web application as an input stream.This is ONLY required to support the Java environment, and in particular, only those Java environments where the WAR file is not expanded. This should return NULL in an ASP environment.
- Parameters:
relPath- AStringthat indicates the relative path of the file.- Returns:
- A
InputStreamthat contains the contents of the specified file.
-
getInitParameterNames
java.util.Enumeration<java.lang.String> getInitParameterNames()
Returns enumeration of initialization parameter names- Returns:
- enumeration of initialization parameter names
-
getInitParameter
java.lang.String getInitParameter(java.lang.String paramName)
Returns initialization parameter value for the controller associated with this ContainerServices. If no controller has been associated, it returns a global value. This value is typically read from the microstrategy.xml or web.xml file. This value is read from thegetApplicationParameters()- Parameters:
paramName- parameter name- Returns:
- parameter value
-
getApplicationParameters
ApplicationParameters getApplicationParameters()
Returns the an ApplicationParameters instance that includes all the parameters defined in the microstrategy.xml or web.xml file
-
getControllerParameter
java.lang.String getControllerParameter(java.lang.String paramName, java.lang.String controllerName)Returns initialization parameter value for the given controller. This value is typically read from the microstrategy.xml or web.xml file- Parameters:
paramName- parameter namecontrollerName- Name that identifies the controller (e.g. mstrWeb, mstrWebAdmin).nullfor global paramters.- Returns:
- parameter value
-
initGlobalObjects
void initGlobalObjects()
Initializes global instances, like FileLoader and Plugins, using this ContainerServices instance.
-
getResource
java.net.URL getResource(java.lang.String relPath)
Returns theURLassociated with the given resource path. If the resource does not exist, null is returned (i.e. it cannot return a path to a newFile). Note that manyURLimplementations are read-only.- Parameters:
relPath- relative path.- Returns:
- URL associated with given path.
-
getResourcePaths
java.util.Set<java.lang.String> getResourcePaths(java.lang.String relPath)
Returns a directory path strings of all the paths to resources within the application whose longest sub-path matches the supplied path.- Parameters:
relPath- sub-path to match- Returns:
- Set
of directory paths
-
getContextPath
java.lang.String getContextPath()
Returns the context path. In the out of the box Web application deployment, this is usually "/MicroStrategy". Note that subclasses can override this implementation to return different context paths.- Returns:
- the context path.
-
-