Package org.pentaho.platform.api.engine
Interface IApplicationContext
public interface IApplicationContext
Defines a set of methods to retrieve information about the application environment.
There is one context per server application (web application), so the class can be used as a place to share global application data.
- Version:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntryPointHandler
(IPentahoSystemEntryPoint entryPoint) Adds an entry point handler.void
addExitPointHandler
(IPentahoSystemExitPoint exitPoint) Adds an exit point handler.createTempFile
(IPentahoSession session, String prefix, String extension, boolean trackFile) Creates a temporary file in the system/tmp solutions foldercreateTempFile
(IPentahoSession session, String prefix, String extension, File parentDir, boolean trackFile) Creates a temporary file in the specified parent folder and optionally tracks it for deletion on session terminationgetApplicationPath
(String path) Returns the path to the web application or standalone application.Deprecated.Returns a URL to the server application, up to and including the context.getFileOutputPath
(String path) Used for content output (temporary and otherwise), returns a fully qualified path suitable for creating a File object from.Returns a fully qualified URL to the server application, up to and including the context.Retrieves the descriptive name of the platform application.getProperty
(String key) If there were any other properties set (for example, initParams in the servlet context), this will let you have access to all of those properties that are set.getProperty
(String key, String defaultValue) If there were any other properties set (for example, initParams in the servlet context), this will let you have access to all of those properties that are set.getSolutionPath
(String path) Retrieves the fully qualified path to the location of the Hitachi Vantara solution, appending the path given in the parameter.void
Invokes all entry point handlers.void
Invokes all exit point handlers.void
removeEntryPointHandler
(IPentahoSystemEntryPoint entryPoint) Removes an entry point handler.void
removeExitPointHandler
(IPentahoSystemExitPoint exitPoint) Removes an exit point handler.void
setBaseUrl
(String url) Deprecated.void
setContext
(Object context) void
void
setSolutionRootPath
(String path)
-
Method Details
-
getSolutionPath
Retrieves the fully qualified path to the location of the Hitachi Vantara solution, appending the path given in the parameter. The path is formatted appropriately for the platform that the application is running on.- Parameters:
path
- a path to a location that exists relative to the solution tree- Returns:
- fully qualified path to the requested location in the solution tree
-
getSolutionRootPath
String getSolutionRootPath() -
getFileOutputPath
Used for content output (temporary and otherwise), returns a fully qualified path suitable for creating a File object from.- Parameters:
path
- Relative path within the solution to the file location. Solution path will be pre-pended- Returns:
- Fully qualified path
-
getPentahoServerName
String getPentahoServerName()Retrieves the descriptive name of the platform application.The Pentaho server name should specified in the system settings configuration file, using the
name
element- Returns:
- the descriptive server name as specified in the system settings, or "Pentaho Business Intelligence Platform" by default.
-
getBaseUrl
Deprecated.Returns a URL to the server application, up to and including the context.The URL that is returned is derived from the server context, and thus will include the protocol, host name, port, and application context root.
- Returns:
- the URL to the server application context root. Use getFullyQualifiedServerURL instead
-
getFullyQualifiedServerURL
String getFullyQualifiedServerURL()Returns a fully qualified URL to the server application, up to and including the context.This method should only be used if delivering an offline content or in a scenario where fully qualified url is required.
- Returns:
- the URL to the server application context root.
-
getApplicationPath
Returns the path to the web application or standalone application. This is only used in a few places, like loading the portlet localization messages.- Parameters:
path
- a path to a location that exists relative to the application root directory- Returns:
- the path to the server application root
-
getProperty
If there were any other properties set (for example, initParams in the servlet context), this will let you have access to all of those properties that are set.- Parameters:
key
- property Name- Returns:
- string property value
-
getProperty
If there were any other properties set (for example, initParams in the servlet context), this will let you have access to all of those properties that are set.- Parameters:
key
- property NamedefaultValue
- default value if the property is not specified.- Returns:
- string property value
-
addEntryPointHandler
Adds an entry point handler. The entry point handler is called when actions start on a particular thread.- Parameters:
entryPoint
-
-
removeEntryPointHandler
Removes an entry point handler.- Parameters:
entryPoint
-
-
addExitPointHandler
Adds an exit point handler. The exit point handler is called when actions stop on a particular thread- Parameters:
entryPoint
-
-
removeExitPointHandler
Removes an exit point handler.- Parameters:
exitPoint
-
-
invokeEntryPoints
void invokeEntryPoints()Invokes all entry point handlers. -
invokeExitPoints
void invokeExitPoints()Invokes all exit point handlers. -
setFullyQualifiedServerURL
-
setBaseUrl
Deprecated.- Parameters:
url
- Use setFullyQualifiedServerURL instead
-
setSolutionRootPath
-
getContext
Object getContext() -
setContext
-
createTempFile
File createTempFile(IPentahoSession session, String prefix, String extension, File parentDir, boolean trackFile) throws IOException Creates a temporary file in the specified parent folder and optionally tracks it for deletion on session termination- Parameters:
session
- - IPentahoSessionprefix
- - file prefixextension
- - file extensionparentDir
- - parent folder to create the temp file intrackFile
- - true = add it to the session deleter- Returns:
- Throws:
IOException
-
createTempFile
File createTempFile(IPentahoSession session, String prefix, String extension, boolean trackFile) throws IOException Creates a temporary file in the system/tmp solutions folder- Parameters:
session
- - IPentahoSessionprefix
- - file prefixextension
- - file extensiontrackFile
- - true = add it to the session deleter- Returns:
- Throws:
IOException
-