|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.cluster.StandardCluster
A Cluster implementation. Responsible for setting up a cluster and provides callers with a valid multicast receiver/sender.
Field Summary |
Fields inherited from interface org.apache.catalina.Lifecycle |
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, START_EVENT, STOP_EVENT |
Constructor Summary | |
StandardCluster()
|
Method Summary | |
void |
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component. |
LifecycleListener[] |
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. |
int |
getCheckInterval()
Get the time in seconds this Cluster sleeps |
java.lang.String |
getClusterName()
Return the name of the cluster that this Server is currently configured to operate within. |
ClusterReceiver |
getClusterReceiver(java.lang.String senderId)
Returns a ClusterReceiver which is the interface
to use when receiving information in the Cluster. senderId is
used as a indentifier, only information send through the
ClusterSender with the same senderId can be received. |
ClusterSender |
getClusterSender(java.lang.String senderId)
Returns a ClusterSender which is the interface
to use when sending information in the Cluster. senderId is
used as a identifier so that information sent through this
instance can only be used with the respectice
ClusterReceiver |
Container |
getContainer()
Get the Container associated with our Cluster |
int |
getDebug()
Get the debug level for this component |
java.lang.String |
getInfo()
Return descriptive information about this Cluster implementation and the corresponding version number, in the format <description>/<version> . |
ClusterMemberInfo |
getLocalClusterMember()
Return cluster information about the local host |
java.net.InetAddress |
getMulticastAddress()
Get the Groupaddress associated with our Cluster |
int |
getMulticastPort()
Get the Port associated with our Cluster |
protected java.lang.String |
getName()
Return a String containing the name of this
Cluster implementation, used for logging |
ClusterMemberInfo[] |
getRemoteClusterMembers()
Returns a collection containing ClusterMemberInfo
on the remote members of this Cluster. |
protected void |
log(java.lang.String message)
Log a message on the Logger associated with our Container (if any). |
void |
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component. |
void |
run()
The background thread. |
void |
setCheckInterval(int checkInterval)
Set the time in seconds for this component to Sleep before it checks for new received data in the Cluster |
void |
setClusterName(java.lang.String clusterName)
Set the name of the cluster to join, if no cluster with this name is present create one. |
void |
setContainer(Container container)
Set the Container associated with our Cluster |
void |
setDebug(int debug)
Set the debug level for this component |
void |
setMulticastAddress(java.lang.String multicastAddress)
Set the Groupaddress associated with our Cluster |
void |
setMulticastPort(int multicastPort)
Set the Port associated with our Cluster |
void |
start()
Prepare for the beginning of active use of the public methods of this component. |
void |
stop()
Gracefully terminate the active use of the public methods of this component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StandardCluster()
Method Detail |
public java.lang.String getInfo()
<description>/<version>
.
getInfo
in interface Cluster
protected java.lang.String getName()
String
containing the name of this
Cluster implementation, used for logging
public void setDebug(int debug)
setDebug
in interface Cluster
debug
- The debug levelpublic int getDebug()
getDebug
in interface Cluster
public void setClusterName(java.lang.String clusterName)
setClusterName
in interface Cluster
clusterName
- The clustername to joinpublic java.lang.String getClusterName()
getClusterName
in interface Cluster
public void setContainer(Container container)
setContainer
in interface Cluster
container
- The Container to usepublic Container getContainer()
getContainer
in interface Cluster
public void setMulticastPort(int multicastPort)
public int getMulticastPort()
public void setMulticastAddress(java.lang.String multicastAddress)
public java.net.InetAddress getMulticastAddress()
public void setCheckInterval(int checkInterval)
setCheckInterval
in interface Cluster
checkInterval
- The time to sleeppublic int getCheckInterval()
getCheckInterval
in interface Cluster
public ClusterMemberInfo[] getRemoteClusterMembers()
ClusterMemberInfo
on the remote members of this Cluster. This method does
not include the local host, to retrieve
ClusterMemberInfo
on the local host
use getLocalClusterInfo()
instead.
getRemoteClusterMembers
in interface Cluster
public ClusterMemberInfo getLocalClusterMember()
getLocalClusterMember
in interface Cluster
public ClusterSender getClusterSender(java.lang.String senderId)
ClusterSender
which is the interface
to use when sending information in the Cluster. senderId is
used as a identifier so that information sent through this
instance can only be used with the respectice
ClusterReceiver
getClusterSender
in interface Cluster
public ClusterReceiver getClusterReceiver(java.lang.String senderId)
ClusterReceiver
which is the interface
to use when receiving information in the Cluster. senderId is
used as a indentifier, only information send through the
ClusterSender
with the same senderId can be received.
getClusterReceiver
in interface Cluster
protected void log(java.lang.String message)
message
- Message to be loggedpublic void addLifecycleListener(LifecycleListener listener)
addLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic LifecycleListener[] findLifecycleListeners()
findLifecycleListeners
in interface Lifecycle
public void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener
in interface Lifecycle
listener
- The listener to removepublic void start() throws LifecycleException
configure()
,
and before any of the public methods of the component are utilized.
start
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedpublic void stop() throws LifecycleException
stop
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that needs to be reportedpublic void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |