KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > winstone > Cluster


1 /*
2  * Copyright 2003-2006 Rick Knowles <winstone-devel at lists sourceforge net>
3  * Distributed under the terms of either:
4  * - the common development and distribution license (CDDL), v1.0; or
5  * - the GNU Lesser General Public License, v2.1 or later
6  */

7 package winstone;
8
9 import java.io.IOException JavaDoc;
10 import java.io.InputStream JavaDoc;
11 import java.io.OutputStream JavaDoc;
12 import java.net.Socket JavaDoc;
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 JavaDoc 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 JavaDoc in,
49             OutputStream JavaDoc out, Socket JavaDoc socket, HostGroup hostGroup)
50             throws IOException JavaDoc;
51 }
52
Popular Tags