KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
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
31 public interface ClusterManager extends Manager {
32
33    /**
34     * A message was received from another node, this
35     * is the callback method to implement if you are interested in
36     * receiving replication messages.
37     * @param msg - the message received.
38     */

39    public void messageDataReceived(ClusterMessage msg);
40
41    /**
42     * When the request has been completed, the replication valve
43     * will notify the manager, and the manager will decide whether
44     * any replication is needed or not.
45     * If there is a need for replication, the manager will
46     * create a session message and that will be replicated.
47     * The cluster determines where it gets sent.
48     * @param sessionId - the sessionId that just completed.
49     * @return a SessionMessage to be sent,
50     */

51    public ClusterMessage requestCompleted(String JavaDoc sessionId);
52
53    /**
54     * When the manager expires session not tied to a request.
55     * The cluster will periodically ask for a list of sessions
56     * that should expire and that should be sent across the wire.
57     * @return String[] The invalidated sessions
58     */

59    public String JavaDoc[] getInvalidatedSessions();
60    
61    /**
62     * Return the name of the manager, typically the context name such as /replicator
63     * @return String
64     */

65    public String JavaDoc getName();
66    
67    public void setName(String JavaDoc name);
68    
69    public void setExpireSessionsOnShutdown(boolean expireSessionsOnShutdown);
70    
71    public void setUseDirtyFlag(boolean useDirtyFlag);
72    
73    public void setCluster(CatalinaCluster cluster);
74    
75    public boolean getNotifyListenersOnReplication();
76    
77    public void setNotifyListenersOnReplication(boolean notifyListenersOnReplication);
78
79 }
80
Popular Tags