001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.catalina;
019:
020: /**
021: * A <b>Cluster</b> works as a Cluster client/server for the local host
022: * Different Cluster implementations can be used to support different
023: * ways to communicate within the Cluster. A Cluster implementation is
024: * responsible for setting up a way to communicate within the Cluster
025: * and also supply "ClientApplications" with <code>ClusterSender</code>
026: * used when sending information in the Cluster and
027: * <code>ClusterInfo</code> used for receiving information in the Cluster.
028: *
029: * @author Bip Thelin
030: * @author Remy Maucherat
031: * @author Filip Hanik
032: * @version $Revision: 500684 $, $Date: 2007-01-28 00:27:18 +0100 (dim., 28 janv. 2007) $
033: */
034:
035: public interface Cluster {
036:
037: // ------------------------------------------------------------- Properties
038:
039: /**
040: * Return descriptive information about this Cluster implementation and
041: * the corresponding version number, in the format
042: * <code><description>/<version></code>.
043: */
044: public String getInfo();
045:
046: /**
047: * Return the name of the cluster that this Server is currently
048: * configured to operate within.
049: *
050: * @return The name of the cluster associated with this server
051: */
052: public String getClusterName();
053:
054: /**
055: * Set the name of the cluster to join, if no cluster with
056: * this name is present create one.
057: *
058: * @param clusterName The clustername to join
059: */
060: public void setClusterName(String clusterName);
061:
062: /**
063: * Set the Container associated with our Cluster
064: *
065: * @param container The Container to use
066: */
067: public void setContainer(Container container);
068:
069: /**
070: * Get the Container associated with our Cluster
071: *
072: * @return The Container associated with our Cluster
073: */
074: public Container getContainer();
075:
076: /**
077: * Set the protocol parameters.
078: *
079: * @param protocol The protocol used by the cluster
080: * @deprecated
081: */
082: public void setProtocol(String protocol);
083:
084: /**
085: * Get the protocol used by the cluster.
086: *
087: * @return The protocol
088: * @deprecated
089: */
090: public String getProtocol();
091:
092: // --------------------------------------------------------- Public Methods
093:
094: /**
095: * Create a new manager which will use this cluster to replicate its
096: * sessions.
097: *
098: * @param name Name (key) of the application with which the manager is
099: * associated
100: */
101: public Manager createManager(String name);
102:
103: /**
104: * Register a manager with the cluster. If the cluster is not responsible
105: * for creating a manager, then the container will at least notify the
106: * cluster that this mananger is participating in the cluster.
107: * @param manager Manager
108: */
109: public void registerManager(Manager manager);
110:
111: /**
112: * Removes a manager from the cluster
113: * @param manager Manager
114: */
115: public void removeManager(Manager manager);
116:
117: // --------------------------------------------------------- Cluster Wide Deployments
118:
119: /**
120: * Execute a periodic task, such as reloading, etc. This method will be
121: * invoked inside the classloading context of this container. Unexpected
122: * throwables will be caught and logged.
123: */
124: public void backgroundProcess();
125: }
|