Package org.apache.catalina.ha
Interface CatalinaCluster
-
- All Known Implementing Classes:
SimpleTcpCluster
public interface CatalinaCluster extends Cluster
A CatalinaCluster interface allows to plug in and out the different cluster implementations
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddClusterListener(ClusterListener listener)Add cluster message listener and register cluster to this listener.voidaddValve(Valve valve)Add cluster valve.ChannelgetChannel()Returns the channel associated with the cluster.ClusterDeployergetClusterDeployer()Returns the current Deployer.MembergetLocalMember()Returns the member that represents this node.ManagergetManager(java.lang.String name)Get Managerjava.lang.StringgetManagerName(java.lang.String name, Manager manager)Get a new cluster name for a manager.java.util.Map<java.lang.String,ClusterManager>getManagers()Returns the map of managers.Member[]getMembers()Returns all the members currently participating in the cluster.Valve[]getValves()Returns the current cluster valves.booleanhasMembers()Checks if the cluster has members.voidremoveClusterListener(ClusterListener listener)Remove message listener and deregister Cluster from listener.voidsend(ClusterMessage msg)Sends a message to all the members in the clustervoidsend(ClusterMessage msg, Member dest)Sends a message to a specific member in the cluster.voidsend(ClusterMessage msg, Member dest, int sendOptions)Sends a message with the specified sendOptions to a specific member in the cluster.voidsetChannel(Channel channel)Set the channel associated with the cluster.voidsetClusterDeployer(ClusterDeployer deployer)Set a new Deployer, must be set before the cluster started.-
Methods inherited from interface org.apache.catalina.Cluster
backgroundProcess, createManager, getClusterName, registerManager, removeManager, setClusterName
-
Methods inherited from interface org.apache.catalina.Contained
getContainer, setContainer
-
-
-
-
Method Detail
-
send
void send(ClusterMessage msg)
Sends a message to all the members in the cluster- Parameters:
msg- ClusterMessage
-
send
void send(ClusterMessage msg, Member dest)
Sends a message to a specific member in the cluster.- Parameters:
msg- ClusterMessagedest- Member
-
send
void send(ClusterMessage msg, Member dest, int sendOptions)
Sends a message with the specified sendOptions to a specific member in the cluster.- Parameters:
msg- ClusterMessagedest- MembersendOptions- sendOptions
-
hasMembers
boolean hasMembers()
Checks if the cluster has members.- Returns:
trueif the cluster has members.
-
getMembers
Member[] getMembers()
Returns all the members currently participating in the cluster.- Returns:
- an array containing all the members currently participating in the cluster.
-
getLocalMember
Member getLocalMember()
Returns the member that represents this node.- Returns:
- the member that represents this node.
-
addValve
void addValve(Valve valve)
Add cluster valve. Cluster Valves are only add to container when cluster is started.- Parameters:
valve- The new cluster Valve.
-
addClusterListener
void addClusterListener(ClusterListener listener)
Add cluster message listener and register cluster to this listener.- Parameters:
listener- The new listener
-
removeClusterListener
void removeClusterListener(ClusterListener listener)
Remove message listener and deregister Cluster from listener.- Parameters:
listener- The listener to remove
-
setClusterDeployer
void setClusterDeployer(ClusterDeployer deployer)
Set a new Deployer, must be set before the cluster started.- Parameters:
deployer- The associated deployer
-
getClusterDeployer
ClusterDeployer getClusterDeployer()
Returns the current Deployer.- Returns:
- the current Deployer
-
getManagers
java.util.Map<java.lang.String,ClusterManager> getManagers()
Returns the map of managers.- Returns:
- The map of managers
-
getManager
Manager getManager(java.lang.String name)
Get Manager- Parameters:
name- The manager name- Returns:
- The manager
-
getManagerName
java.lang.String getManagerName(java.lang.String name, Manager manager)Get a new cluster name for a manager.- Parameters:
name- Override name (optional)manager- The manager- Returns:
- the manager name in the cluster
-
getValves
Valve[] getValves()
Returns the current cluster valves.- Returns:
- the current cluster valves
-
setChannel
void setChannel(Channel channel)
Set the channel associated with the cluster.- Parameters:
channel- the channel
-
getChannel
Channel getChannel()
Returns the channel associated with the cluster.- Returns:
- the channel associated with the cluster
-
-