01: /*
02: * Copyright 2003-2006 Rick Knowles <winstone-devel at lists sourceforge net>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: */
07: package winstone;
08:
09: import java.io.IOException;
10: import java.io.InputStream;
11: import java.io.OutputStream;
12: import java.net.Socket;
13:
14: /**
15: * Represents a cluster implementation, which is basically the communication
16: * mechanism between a group of winstone containers.
17: *
18: * @author <a href="mailto:rick_knowles@hotmail.com">Rick Knowles</a>
19: * @version $Id: Cluster.java,v 1.5 2006/02/28 07:32:47 rickknowles Exp $
20: */
21: public interface Cluster {
22: /**
23: * Destroy the maintenance thread if there is one. Prepare for shutdown
24: */
25: public void destroy();
26:
27: /**
28: * Check if the other nodes in this cluster have a session for this
29: * sessionId.
30: *
31: * @param sessionId The id of the session to check for
32: * @param webAppConfig The web app that owns the session we want
33: * @return A valid session instance
34: */
35: public WinstoneSession askClusterForSession(String sessionId,
36: WebAppConfiguration webAppConfig);
37:
38: /**
39: * Accept a control socket request related to the cluster functions and
40: * process the request.
41: *
42: * @param requestType A byte indicating the request type
43: * @param in Socket input stream
44: * @param outSocket output stream
45: * @param hostConfig The collection of all local webapps
46: * @throws IOException
47: */
48: public void clusterRequest(byte requestType, InputStream in,
49: OutputStream out, Socket socket, HostGroup hostGroup)
50: throws IOException;
51: }
|