KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > cluster > CatalinaCluster


1 /*
2  * Copyright 1999,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.catalina.cluster;
18
19 import org.apache.catalina.Cluster;
20 import org.apache.catalina.cluster.io.ListenCallback;
21 import org.apache.catalina.LifecycleException;
22 import org.apache.catalina.Valve;
23 import org.apache.commons.logging.Log;
24 import org.apache.catalina.Manager;
25
26 /**
27  * A <b>CatalinaCluster</b> interface allows to plug in and out the
28  * different cluster implementations
29  *
30  * @author Filip Hanik
31  * @version $Revision: 1.9 $, $Date: 2004/11/11 14:47:26 $
32  */

33
34 public interface CatalinaCluster
35     extends Cluster,ListenCallback {
36     // ----------------------------------------------------- Instance Variables
37

38     /**
39      * Descriptive information about this component implementation.
40      */

41     public String JavaDoc info = "CatalinaCluster/1.0";
42     
43     /**
44      * Start the cluster, the owning container will invoke this
45      * @throws Exception - if failure to start cluster
46      */

47     public void start() throws Exception JavaDoc;
48     
49     /**
50      * Stops the cluster, the owning container will invoke this
51      * @throws LifecycleException
52      */

53     public void stop() throws LifecycleException;
54     
55     /**
56      * Returns the associates logger with this cluster
57      * @return Log
58      */

59     public Log getLogger();
60     
61     /**
62      * Sends a message to all the members in the cluster
63      * @param msg SessionMessage
64      */

65     public void send(ClusterMessage msg);
66     
67     /**
68      * Sends a message to a specific member in the cluster
69      * @param msg SessionMessage
70      * @param dest Member
71      */

72     public void send(ClusterMessage msg, Member dest);
73     
74     /**
75      * returns all the members currently participating in the cluster
76      * @return Member[]
77      */

78     public Member[] getMembers();
79     
80     /**
81      * Return the member that represents this node.
82      * @return Member
83      */

84     public Member getLocalMember();
85     
86     public void setClusterSender(ClusterSender sender);
87     
88     public ClusterSender getClusterSender();
89     
90     public void setClusterReceiver(ClusterReceiver receiver);
91     
92     public ClusterReceiver getClusterReceiver();
93     
94     public void setMembershipService(MembershipService service);
95     
96     public MembershipService getMembershipService();
97     
98     public void addValve(Valve valve);
99     
100     public void addClusterListener(MessageListener listener);
101     
102     public void removeClusterListener(MessageListener listener);
103     
104     public void setClusterDeployer(ClusterDeployer deployer);
105     
106     public ClusterDeployer getClusterDeployer();
107     
108     public Manager getManager(String JavaDoc name);
109     public void removeManager(String JavaDoc name);
110     public void addManager(String JavaDoc name, ClusterManager manager);
111     public Valve getValve();
112
113     
114 }
115
Popular Tags