1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package net.sf.asterisk.fastagi;
18
19 import java.io.IOException;
20
21 /***
22 * Listens for incoming AGI connections, reads the inital data and builds an
23 * AGIRequest using an AGIRequestBuilder.<br>
24 * The AGIRequest is then handed over to the appropriate AGIScript for
25 * processing.
26 *
27 * @author srt
28 * @version $Id: AGIServer.java,v 1.3 2005/03/08 16:48:34 srt Exp $
29 */
30 public interface AGIServer
31 {
32 /***
33 * Starts this AGIServer.<br>
34 * After calling startup() this AGIServer is ready to receive requests from
35 * Asterisk servers and process them.
36 *
37 * @throws IOException if the server socket cannot be bound.
38 * @throws IllegalStateException if this AGIServer is already running.
39 */
40 void startup() throws IOException, IllegalStateException;
41
42 /***
43 * Shuts this AGIServer down.<br>
44 * The server socket is closed and all resources are freed.
45 *
46 * @throws IOException if the connection cannot be shut down.
47 * @throws IllegalStateException if this AGIServer is already shut down or
48 * has not yet been started.
49 */
50 void shutdown() throws IOException, IllegalStateException;
51 }