001: /*
002: * Copyright 1999,2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.apache.catalina.cluster;
018:
019: import org.apache.catalina.Cluster;
020: import org.apache.catalina.cluster.io.ListenCallback;
021: import org.apache.catalina.LifecycleException;
022: import org.apache.catalina.LifecycleListener;
023: import org.apache.catalina.Logger;
024: import org.apache.catalina.Valve;
025: import org.apache.commons.logging.Log;
026: import org.apache.catalina.Manager;
027:
028: /**
029: * A <b>CatalinaCluster</b> interface allows to plug in and out the
030: * different cluster implementations
031: *
032: * @author Filip Hanik
033: * @version $Revision: 1.6 $, $Date: 2004/06/04 20:22:27 $
034: */
035:
036: public interface CatalinaCluster extends Cluster, ListenCallback {
037: // ----------------------------------------------------- Instance Variables
038:
039: /**
040: * Descriptive information about this component implementation.
041: */
042: public String info = "CatalinaCluster/1.0";
043:
044: /**
045: * Start the cluster, the owning container will invoke this
046: * @throws Exception - if failure to start cluster
047: */
048: public void start() throws Exception;
049:
050: /**
051: * Stops the cluster, the owning container will invoke this
052: * @throws LifecycleException
053: */
054: public void stop() throws LifecycleException;
055:
056: /**
057: * Returns the associates logger with this cluster
058: * @return Log
059: */
060: public Log getLogger();
061:
062: /**
063: * Sends a message to all the members in the cluster
064: * @param msg SessionMessage
065: */
066: public void send(ClusterMessage msg);
067:
068: /**
069: * Sends a message to a specific member in the cluster
070: * @param msg SessionMessage
071: * @param dest Member
072: */
073: public void send(ClusterMessage msg, Member dest);
074:
075: /**
076: * returns all the members currently participating in the cluster
077: * @return Member[]
078: */
079: public Member[] getMembers();
080:
081: /**
082: * Return the member that represents this node.
083: * @return Member
084: */
085: public Member getLocalMember();
086:
087: public void setClusterSender(ClusterSender sender);
088:
089: public ClusterSender getClusterSender();
090:
091: public void setClusterReceiver(ClusterReceiver receiver);
092:
093: public ClusterReceiver getClusterReceiver();
094:
095: public void setMembershipService(MembershipService service);
096:
097: public MembershipService getMembershipService();
098:
099: public void addValve(Valve valve);
100:
101: public void addClusterListener(MessageListener listener);
102:
103: public void removeClusterListener(MessageListener listener);
104:
105: public void setClusterDeployer(ClusterDeployer deployer);
106:
107: public ClusterDeployer getClusterDeployer();
108:
109: public Manager getManager(String name);
110:
111: public void removeManager(String name);
112:
113: }
|