01: // ClientFactory.java
02: // $Id: ClientFactory.java,v 1.4 2000/08/16 21:37:40 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1996.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigsaw.http;
07:
08: import java.io.IOException;
09:
10: import java.net.ServerSocket;
11: import java.net.Socket;
12:
13: public interface ClientFactory {
14:
15: /**
16: * Shutdown this client factory.
17: * @param force If <strong>true</strong>, force the shutdown, and stop
18: * all operations in progress.
19: */
20:
21: public void shutdown(boolean force);
22:
23: /**
24: * Handle the given, new connection.
25: * @param socket The newly accepted connection.
26: */
27:
28: public void handleConnection(Socket socket);
29:
30: /**
31: * Initialize that client factory.
32: * Initialize this new client factory, and create the <em>server
33: * socket</em> (ie the socket that will be used to accept new connections.
34: * @param server The httpd instance to be used as the context for
35: * this client factory.
36: */
37:
38: public void initialize(httpd server);
39:
40: /**
41: * Create the server socket for this client factory.
42: * This method is always called <em>after</em> the initialize method
43: * of the client factory is done.
44: * @return A server socket instance.
45: * @exception IOException If some IO error occurs while creating the
46: * server socket.
47: */
48:
49: public ServerSocket createServerSocket() throws IOException;
50:
51: }
|