01: /*
02: * Copyright 1999,2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: /**
20: * The common interface used by all cluster manager.
21: * This is so that we can have a more pluggable way
22: * of swapping session managers for different algorithms.
23: *
24: * @author Filip Hanik
25:
26: */
27:
28: import org.apache.catalina.Manager;
29:
30: public interface ClusterManager extends Manager {
31:
32: /**
33: * A message was received from another node, this
34: * is the callback method to implement if you are interested in
35: * receiving replication messages.
36: * @param msg - the message received.
37: */
38: public void messageDataReceived(SessionMessage msg);
39:
40: /**
41: * When the request has been completed, the replication valve
42: * will notify the manager, and the manager will decide whether
43: * any replication is needed or not.
44: * If there is a need for replication, the manager will
45: * create a session message and that will be replicated.
46: * The cluster determines where it gets sent.
47: * @param sessionId - the sessionId that just completed.
48: * @return a SessionMessage to be sent,
49: */
50: public SessionMessage requestCompleted(String sessionId);
51:
52: /**
53: * When the manager expires session not tied to a request.
54: * The cluster will periodically ask for a list of sessions
55: * that should expire and that should be sent across the wire.
56: * @return String[] The invalidated sessions
57: */
58: public String[] getInvalidatedSessions();
59:
60: /**
61: * Return the name of the manager, typically the context name such as /replicator
62: * @return String
63: */
64: public String getName();
65:
66: public void setName(String name);
67:
68: public void setExpireSessionsOnShutdown(
69: boolean expireSessionsOnShutdown);
70:
71: public void setUseDirtyFlag(boolean useDirtyFlag);
72:
73: public void setCluster(CatalinaCluster cluster);
74:
75: }
|