KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > core > system > IApplicationContext


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12  *
13  * @created Jun 21, 2005
14  * @author James Dixon
15  *
16  */

17
18 package org.pentaho.core.system;
19
20 /**
21  * Defines a set of methods to retrieve information about the application
22  * environment.
23  * <p>
24  * There is one context per server application (web application), so the class
25  * can be used as a place to share global application data.
26  *
27  * @version 1.0
28  */

29 public interface IApplicationContext {
30
31     /**
32      * Retrieves the fully qualified path to the location of the Pentaho
33      * solution, appending the path given in the parameter. The path is
34      * formatted appropriately for the platform that the application is running
35      * on.
36      *
37      * @param path
38      * a path to a location that exists relative to the solution tree
39      * @return fully qualified path to the requested location in the solution
40      * tree
41      */

42     public String JavaDoc getSolutionPath(String JavaDoc path);
43
44     /**
45      * Used for content output (temporary and otherwise), returns a fully qualified
46      * path suitable for creating a <tt>File</tt> object from.
47      * @param path Relative path within the solution to the file location. Solution path
48      * will be pre-pended
49      * @return Fully qualified path
50      */

51     public String JavaDoc getFileOutputPath(String JavaDoc path);
52
53     /**
54      * Retrieves the descriptive name of the platform application.
55      * <p>
56      * The Pentaho server name should specified in the system settings
57      * configuration file, using the <code>name</code> element
58      *
59      * @return the descriptive server name as specified in the system settings,
60      * or "Pentaho Business Intelligence Platform" by default.
61      */

62     public String JavaDoc getPentahoServerName();
63
64     /**
65      * Returns a URL to the server application, up to and including the context.
66      * <p>
67      * The URL that is returned is derived from the server context, and thus
68      * will include the protocol, host name, port, and application context root.
69      *
70      * @return the URL to the server application context root.
71      */

72     public String JavaDoc getBaseUrl();
73
74     /**
75      * Returns the path to the web application or standalone application. This
76      * is only used in a few places, like loading the portlet localization
77      * messages.
78      *
79      * @param path
80      * a path to a location that exists relative to the application
81      * root directory
82      * @return the path to the server application root
83      */

84     public String JavaDoc getApplicationPath(String JavaDoc path);
85
86     /**
87      * If there were any other properties set (for example, initParams in the
88      * servlet context), this will let you have access to all of those
89      * properties that are set.
90      *
91      * @param key
92      * property Name
93      * @return string property value
94      */

95     public String JavaDoc getProperty(String JavaDoc key);
96
97     /**
98      * If there were any other properties set (for example, initParams in the
99      * servlet context), this will let you have access to all of those
100      * properties that are set.
101      *
102      * @param key
103      * property Name
104      * @param defaultValue
105      * default value if the property is not specified.
106      * @return string property value
107      */

108     public String JavaDoc getProperty(String JavaDoc key, String JavaDoc defaultValue);
109
110     /**
111      * Adds an entry point handler. The entry point handler is called when
112      * actions start on a particular thread.
113      * @param entryPoint
114      */

115     public void addEntryPointHandler(IPentahoSystemEntryPoint entryPoint);
116     
117     /**
118      * Removes an entry point handler.
119      * @param entryPoint
120      */

121     public void removeEntryPointHandler(IPentahoSystemEntryPoint entryPoint);
122     
123     /**
124      * Adds an exit point handler. The exit point handler is called when actions
125      * stop on a particular thread
126      * @param entryPoint
127      */

128     public void addExitPointHandler(IPentahoSystemExitPoint exitPoint);
129     
130     /**
131      * Removes an exit point handler.
132      * @param exitPoint
133      */

134     public void removeExitPointHandler(IPentahoSystemExitPoint exitPoint);
135     
136     /**
137      * Invokes all entry point handlers.
138      */

139     public void invokeEntryPoints();
140     
141     /**
142      * Invokes all exit point handlers.
143      */

144     public void invokeExitPoints();
145     
146 }
147
Popular Tags