1 /*
2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * You may obtain a copy of the License at
5 *
6 * http://www.apache.org/licenses/LICENSE-2.0
7 *
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */
14
15 package net.sourceforge.basher;
16
17 import java.util.List;
18
19 /** Class for managing contexts registered within the system. A context is defined by the <code>BasherContext</code>
20 * class and represents the runtime properties of a performance or testing run.
21 *
22 * @author Johan Lindquist
23 * @version $Revision$
24 */
25 public interface ContextManager
26 {
27 public String DEFAULT_BASHER_CONTEXT_NAME = "default";
28
29 /** Retrieves the currently active context.
30 *
31 * @return The active context
32 */
33 public BasherContext getActiveBasherContext();
34
35 /** Sets the specified context to be the active, used context.
36 *
37 * @param basherContext The context to activate.
38 */
39 public void setActiveBasherContext(final BasherContext basherContext);
40
41 /** Retrieves the by name specified context.
42 *
43 * @param contextName The name of the context to retrieve.
44 * @return The specified context or null if not present.
45 */
46 public BasherContext getBasherContext(final String contextName);
47
48 /** Retrieves the list of all registered contexts.
49 *
50 * @return The list of contexts available.
51 */
52 public List<BasherContext> getBasherContexts();
53
54 /** Adds the specified context to the system.
55 *
56 * @param basherContext The context to add.
57 */
58 public void addBasherContext(final BasherContext basherContext);
59 }