|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.jonas.lib.management.domain.cluster.BaseCluster
public abstract class BaseCluster
Implements basics for cluster management. To be extended by the different cluster types. It implements cluster state transition diagram based on the members's state. A member is represented by a ClusterMember class instance.
ClusterMember| Nested Class Summary | |
|---|---|
class |
BaseCluster.DeployThread
|
| Field Summary | |
|---|---|
protected ClusterFactory |
cf
ClusterFactory that created this Cluster |
protected DomainMonitor |
dm
ref to the domainMonitor |
protected String |
domainName
|
protected JmxService |
jmx
ref to the Jmx Service |
protected static org.objectweb.util.monolog.api.Logger |
logger
domain management logger |
protected Map |
members
The list of ClusterMember objects that compose this Cluster Key = name of the Member. |
protected String |
name
The name of this Cluster. |
protected ObjectName |
objectName
MBean OBJECT_NAME |
protected int |
state
The cluster state |
static int |
STATE_DOWN
All the members are in STOPPED state |
static int |
STATE_FAILED
All the members are in FAILED state |
static int |
STATE_INIT
This is the initial state, all members are in INITIAL state |
static int |
STATE_PARTIALLY_DOWN
At least one members is in STOPPED state, there is no failed member, there is no running memeber |
static int |
STATE_PARTIALLY_FAILED
At least one members is in FAILED state |
static int |
STATE_PARTIALLY_UP
At least one members is in RUNNING state, there is no failed member |
static int |
STATE_UNKNOWN
No member in FAILED state, no member in RUNNING state, no memeber in STOPPED state The members' state may be UNREACHABLE or UNKNOWN |
static int |
STATE_UP
All the members are in RUNNING state |
| Constructor Summary | |
|---|---|
BaseCluster(ClusterFactory cf)
Constructor |
|
| Method Summary | |
|---|---|
boolean |
addMember(ClusterMember m)
Add a Member to the Cluster |
void |
addServer(String name,
String[] urls,
String clusterd)
Deprecated. addServer(String, String[], String, String, String) |
void |
addServer(String svname,
String[] urls,
String cdn,
String username,
String password)
MBean operation Add a server in the cluster (jonasAdmin) - this is only called for LogicalCluster |
abstract ClusterMember |
createClusterMember(String svname,
ServerProxy proxy)
Create a new ClusterMember. |
void |
deployModule(String file)
MBean operation Deploy a module on all nodes. |
String[] |
getMembers()
|
String |
getName()
|
int |
getNbMembers()
|
String |
getObjectName()
|
ServerProxy |
getRunningServerProxy()
Get a server by its name. |
ServerProxy |
getServerProxy(String name)
Get a server by its name. |
Collection<ServerProxy> |
getServerProxyList()
|
String |
getState()
Get the Cluster State |
abstract String |
getType()
|
boolean |
isMember(String serverName)
Check if a server is member of a cluster. |
void |
removeServer(String svname)
MBean operation Remove a server from the cluster (jonasAdmin) |
ObjectName |
setName(String name)
Set the MBean name, that may be unknown when constructor is called. |
void |
startit()
MBean operation Start all cluster nodes. |
void |
stopit()
MBean operation Stop all cluster nodes. |
void |
undeployModule(String file)
MBean operation Undeploy a module on all nodes. |
void |
uploadDeployModule(String file,
boolean repl)
MBean operation Upload adn deploy a module on all nodes. |
void |
uploadFile(String file,
boolean repl)
MBean operation Upload a file on all nodes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String name
protected ObjectName objectName
protected Map members
protected ClusterFactory cf
protected int state
public static final int STATE_INIT
public static final int STATE_UP
public static final int STATE_DOWN
public static final int STATE_FAILED
public static final int STATE_PARTIALLY_FAILED
public static final int STATE_PARTIALLY_UP
public static final int STATE_PARTIALLY_DOWN
public static final int STATE_UNKNOWN
protected static org.objectweb.util.monolog.api.Logger logger
protected JmxService jmx
protected DomainMonitor dm
protected String domainName
| Constructor Detail |
|---|
public BaseCluster(ClusterFactory cf)
cf - Cluster Factory| Method Detail |
|---|
public abstract ClusterMember createClusterMember(String svname,
ServerProxy proxy)
svname - proxy -
public ObjectName setName(String name)
throws JMException
name - its name.
JMException - could not create MBean instancepublic String getObjectName()
public abstract String getType()
public boolean addMember(ClusterMember m)
m - Member to add
public ServerProxy getServerProxy(String name)
name - fo the server
public ServerProxy getRunningServerProxy()
name - fo the server
public Collection<ServerProxy> getServerProxyList()
public String getState()
getState in interface BaseClusterMBeanpublic String getName()
getName in interface BaseClusterMBeanpublic int getNbMembers()
getNbMembers in interface BaseClusterMBeanpublic String[] getMembers()
getMembers in interface BaseClusterMBean
@Deprecated
public void addServer(String name,
String[] urls,
String clusterd)
throws JMException
addServer(String, String[], String, String, String)
addServer(String, String[], String, String, String)(name, urls, clusterd, null, null)
addServer in interface BaseClusterMBeanname - logical name of the serverurls - array of urls for connectionclusterd - possible clusterdaemon managing the server
JMException - problem when trying to a server to a cluster
public void addServer(String svname,
String[] urls,
String cdn,
String username,
String password)
throws JMException
addServer in interface BaseClusterMBeansvname - logical name of the serverurls - array of urls for connectioncdn - clusterDaemon used to manage te serverusername - user name to use when connecting if any. Null otherwise.password - password to use when connecting if any. Null otherwise.
JMException - problem when trying to a server to a clusterpublic void removeServer(String svname)
removeServer in interface BaseClusterMBeansvname - logical name of the serverpublic boolean isMember(String serverName)
serverName - name of the server the caller would like to
know if it is a cluster member
public void startit()
throws JMException
startit in interface BaseClusterMBeanJMException
public void stopit()
throws JMException
stopit in interface BaseClusterMBeanJMExceptionpublic void deployModule(String file)
deployModule in interface BaseClusterMBeanfile - file to upload. One among .war,.jar,.ear,.rarpublic void undeployModule(String file)
undeployModule in interface BaseClusterMBeanfile - file to upload. One among .war,.jar,.ear,.rar
public void uploadFile(String file,
boolean repl)
uploadFile in interface BaseClusterMBeanfile - file to upload. One among .war,.jar,.ear,.rarrepl - true if the uploaded file can replace a file with the same name in the jars directory
public void uploadDeployModule(String file,
boolean repl)
uploadDeployModule in interface BaseClusterMBeanfile - file to upload. One among .war,.jar,.ear,.rarrepl - true if the uploaded file can replace a file with the same name in the jars directory
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||