01: /*
02: * Copyright (c) 2001 by Matt Welsh and The Regents of the University of
03: * California. All rights reserved.
04: *
05: * Permission to use, copy, modify, and distribute this software and its
06: * documentation for any purpose, without fee, and without written agreement is
07: * hereby granted, provided that the above copyright notice and the following
08: * two paragraphs appear in all copies of this software.
09: *
10: * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
11: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
12: * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
13: * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14: *
15: * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
16: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17: * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
18: * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
19: * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
20: *
21: * Author: Matt Welsh <mdw@cs.berkeley.edu>
22: *
23: */
24:
25: package seda.sandStorm.api;
26:
27: import seda.sandStorm.main.*;
28:
29: /**
30: * ManagerIF represents the system manger, which provides various
31: * runtime services to applications, such as access to other stages.
32: *
33: * @author Matt Welsh
34: */
35: public interface ManagerIF {
36:
37: /**
38: * Each stage may have multiple event queues associated with it.
39: * This is the name of the 'main' event queue for a given stage, and
40: * is the default sink returned by a call to StageIF.getSink().
41: *
42: * @see StageIF
43: */
44: public static final String MAINSINK = "main";
45:
46: /**
47: * Return a handle to the stage with the given name.
48: *
49: * @exception NoSuchStageException Thrown if the stage does not exist.
50: */
51: public StageIF getStage(String stagename)
52: throws NoSuchStageException;
53:
54: /**
55: * Create a stage with the given name, event handler, and initial
56: * arguments. This method can be used by applications to create
57: * new stages at runtime.
58: *
59: * <p>The default stage wrapper and thread manager are used;
60: * the sandStorm.api.SystemManagerIF interface provides a lower-level
61: * mechanism in case the application has a need to specify these
62: * explicitly.
63: *
64: * @param stagename The name under which the new stage should be registered.
65: * @param eventHandler The event handler object which should be associated
66: * with the new stage.
67: * @param initargs The initial arguments to the stage, to be passed to
68: * the new stage through a ConfigDataIF.
69: *
70: * @return A handle to the newly-created stage.
71: * @exception Exception If an exception occurred during stage
72: * creation or initialization.
73: *
74: * @see seda.sandStorm.api.internal.SystemManagerIF
75: * @see ConfigDataIF
76: */
77: public StageIF createStage(String stagename,
78: EventHandlerIF eventHandler, String initargs[])
79: throws Exception;
80:
81: /**
82: * Returns a handle to the system signal interface.
83: */
84: public SignalMgrIF getSignalMgr();
85:
86: /**
87: * Returns a handle to the system profiler.
88: */
89: public ProfilerIF getProfiler();
90:
91: /**
92: * Returns a copy of the SandstormConfig for this Manager. This contains all
93: * of the global options used by the runtime system. Note that modifying
94: * any options of this copy does not in fact change the runtime parameters
95: * of the system; this is used for informational purposes only.
96: */
97: public SandstormConfig getConfig();
98:
99: }
|