source: trunk/autoquest-httpmonitor/src/main/java/de/ugoe/cs/autoquest/httpmonitor/HttpMonitorComponent.java @ 1381

Last change on this file since 1381 was 1381, checked in by pharms, 10 years ago
  • removed find bugs warning
File size: 2.3 KB
Line 
1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
15package de.ugoe.cs.autoquest.httpmonitor;
16
17import java.io.Serializable;
18
19/**
20 * <p>
21 * convenience interface for all components making up the HTTP monitor. All components implement
22 * this interface to ensure homogeneity throughout them. A component must first be initialized
23 * ({@link #init()}), then started ({@link #start()}), and finally stopped ({@link #stop()}).
24 * </p>
25 *
26 * @author Patrick Harms
27 */
28public interface HttpMonitorComponent extends Serializable {
29
30    /**
31     * initializes a component, i.e. it does everything needed to prepare starting the component
32     *
33     * @throws IllegalStateException thrown if the method was already called before but
34     *                               {@link #stop()} wasn't called yet
35     * @throws HttpMonitorException  thrown if the initialization fails, e.g. because needed infos
36     *                               are missing
37     */
38    void init() throws IllegalStateException, HttpMonitorException;
39
40    /**
41     * starts a component
42     *
43     * @throws IllegalStateException thrown if {@link #init()} wasn't called yet of if the component
44     *                               is already started through a preceding call to this method
45     * @throws HttpMonitorException  thrown if the startup fails, e.g. because needed infos
46     *                               are missing
47     */
48    void start() throws IllegalStateException, HttpMonitorException;
49
50    /**
51     * stops a component and cleans up any derivate. In the following, {@link #init()} must be
52     * callable again. If the component is not initialized or started, nothing must happen. If the
53     * component is initialized but not started, the initialization is revoked.
54     */
55    void stop();
56}
Note: See TracBrowser for help on using the repository browser.