java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.activation.Activatable
org.jbossmx.cluster.watchdog.SwapMachines
- All Implemented Interfaces:
- java.rmi.Remote, java.io.Serializable, SwapMachinesRemoteInterface
- public class SwapMachines
- extends java.rmi.activation.Activatable
- implements SwapMachinesRemoteInterface
Class for swapping the roles of active and failover machines, swaps the locations of all the
agents.
| Fields inherited from class java.rmi.activation.Activatable |
|
|
Method Summary |
private void |
execScript(java.lang.String script)
Execute a script |
private boolean |
isMachineRunning(java.lang.String machineName)
Gets whether a machine is running |
static void |
main(java.lang.String[] args)
|
void |
moveAgent(java.lang.String agentRmi,
java.lang.String fromMachine,
java.lang.String toMachine)
Moves a JMX Agent from one machine to another. |
private void |
moveAgentImpl(java.lang.String rmiAgentBinding,
java.lang.String fromMachine,
java.lang.String toMachine)
Moves a JMX Agent from one machine to another. |
void |
moveAgents(java.util.Set agentRmiBindings,
java.lang.String fromMachine,
java.lang.String toMachine)
Moves a set of Agents from one machine to another. |
private void |
moveAgentsImpl(java.util.Set rmiBindings,
java.lang.String fromMachine,
java.lang.String toMachine)
Moves a set of Agents from one machine to another. |
private void |
moveOdin(java.lang.String machineName)
Execute a script to change the machine that 'odin' points to |
private void |
rebootMachine(java.lang.String machineName)
Execute a script to reboot a machine |
private static void |
Sleep(int millis)
Sleep for a while |
void |
swapMachines(java.lang.String rebootingMachine,
java.lang.String safeMachine,
boolean reboot,
boolean putAgentsBackWhereTheyCameFrom,
boolean switchOdin)
Swaps the active and failover machines. |
private void |
swapMachinesImpl(java.lang.String rebootingMachine,
java.lang.String safeMachine,
boolean reboot,
boolean putAgentsBackWhereTheyCameFrom,
boolean switchOdin)
Swaps the active and failover machines. |
SwapMachines
public SwapMachines(java.rmi.activation.ActivationID id,
java.rmi.MarshalledObject data)
throws java.rmi.RemoteException
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
swapMachines
public void swapMachines(java.lang.String rebootingMachine,
java.lang.String safeMachine,
boolean reboot,
boolean putAgentsBackWhereTheyCameFrom,
boolean switchOdin)
throws java.rmi.RemoteException
- Swaps the active and failover machines. Spawns the implementation in another thread.
- Specified by:
swapMachines in interface SwapMachinesRemoteInterface
moveAgents
public void moveAgents(java.util.Set agentRmiBindings,
java.lang.String fromMachine,
java.lang.String toMachine)
throws java.rmi.RemoteException
- Moves a set of Agents from one machine to another. Spawns the implementation in another
thread.
- Specified by:
moveAgents in interface SwapMachinesRemoteInterface
moveAgent
public void moveAgent(java.lang.String agentRmi,
java.lang.String fromMachine,
java.lang.String toMachine)
throws java.rmi.RemoteException
- Moves a JMX Agent from one machine to another. Spawns the implementation in another thread.
- Specified by:
moveAgent in interface SwapMachinesRemoteInterface
swapMachinesImpl
private void swapMachinesImpl(java.lang.String rebootingMachine,
java.lang.String safeMachine,
boolean reboot,
boolean putAgentsBackWhereTheyCameFrom,
boolean switchOdin)
- Swaps the active and failover machines.
moveAgentsImpl
private void moveAgentsImpl(java.util.Set rmiBindings,
java.lang.String fromMachine,
java.lang.String toMachine)
- Moves a set of Agents from one machine to another.
moveAgentImpl
private void moveAgentImpl(java.lang.String rmiAgentBinding,
java.lang.String fromMachine,
java.lang.String toMachine)
- Moves a JMX Agent from one machine to another.
moveOdin
private void moveOdin(java.lang.String machineName)
- Execute a script to change the machine that 'odin' points to
rebootMachine
private void rebootMachine(java.lang.String machineName)
- Execute a script to reboot a machine
execScript
private void execScript(java.lang.String script)
- Execute a script
isMachineRunning
private boolean isMachineRunning(java.lang.String machineName)
- Gets whether a machine is running
Sleep
private static void Sleep(int millis)
- Sleep for a while