com.arjuna.ats.arjuna.recovery
Class RecoveryManager

java.lang.Object
  extended by com.arjuna.ats.arjuna.recovery.RecoveryManager

public class RecoveryManager
extends java.lang.Object

The RecoveryManager daemon.


Field Summary
static int DIRECT_MANAGEMENT
          In this mode the recovery manager does not run periodically and will only work if driven through messages or via the scan operation if it is embedded.
static int INDIRECT_MANAGEMENT
          In this mode the recovery manager runs periodically but may also be driven through messages or via the scan operation if it is embedded.
 
Method Summary
 void addModule(RecoveryModule module)
          Add a recovery module to the system.
static void delayRecoveryManagerThread()
          Delay the start of the recovery manager thread when creating an indirect recovery manager.
static java.net.Socket getClientSocket()
          Obtain a client connection to the recovery manager
 java.util.Vector getModules()
          Obtain a snapshot list of available recovery modules.
static java.net.InetAddress getRecoveryManagerHost()
           
static int getRecoveryManagerPort()
           
static void main(java.lang.String[] args)
          Run the RecoveryManager.
static RecoveryManager manager()
          Obtain a reference to the RecoveryManager singleton.
static RecoveryManager manager(int mode)
          Obtain a reference to the RecoveryManager singleton.
 int mode()
          Indicates what mode (INDIRECT_MANAGEMENT or DIRECT_MANAGEMENT) the recovery manager is configured for.
 void removeModule(RecoveryModule module, boolean waitOnScan)
          Remove a recovery module from the system.
 void resumeScan()
           
 void scan()
          Force a recovery scan now.
 void scan(RecoveryScan callback)
          Force a recovery scan now.
 void startRecoveryManagerThread()
          Start the recovery manager thread.
 void stop()
          Stop the periodic recovery manager waiting for any recovery scan in progress to complete
 void stop(boolean async)
          Stop the periodic recovery manager.
 void suspendScan(boolean async)
          Suspend the recovery manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDIRECT_MANAGEMENT

public static final int INDIRECT_MANAGEMENT
In this mode the recovery manager runs periodically but may also be driven through messages or via the scan operation if it is embedded.

See Also:
Constant Field Values

DIRECT_MANAGEMENT

public static final int DIRECT_MANAGEMENT
In this mode the recovery manager does not run periodically and will only work if driven through messages or via the scan operation if it is embedded.

See Also:
Constant Field Values
Method Detail

manager

public static final RecoveryManager manager()
                                     throws java.lang.IllegalArgumentException
Obtain a reference to the RecoveryManager singleton. If it hasn't been created yet then it will be. The manager will be created in the INDIRECT_MANAGEMENT mode.

Returns:
the manager.
Throws:
java.lang.IllegalArgumentException

manager

public static final RecoveryManager manager(int mode)
                                     throws java.lang.IllegalArgumentException
Obtain a reference to the RecoveryManager singleton. If it hasn't been created yet then it will be. The manager can be created in a management mode defined by the parameter.

Parameters:
mode - the management mode for the manager.
Returns:
the manager.
Throws:
java.lang.IllegalArgumentException

delayRecoveryManagerThread

public static void delayRecoveryManagerThread()
Delay the start of the recovery manager thread when creating an indirect recovery manager.


scan

public final void scan()
Force a recovery scan now. This is a blocking operation and will only return once the recovery scan has completed.


scan

public final void scan(RecoveryScan callback)
Force a recovery scan now. This is a non-blocking operation and will return immediately. Notification of completion of the scan is done through the RecoveryScan object.

Parameters:
callback - callback The callback mechanism used to inform users that the scan has completed. If this is null then no callback will happen and asynchronous scanning will occur.

stop

public final void stop()
Stop the periodic recovery manager waiting for any recovery scan in progress to complete


stop

public final void stop(boolean async)
Stop the periodic recovery manager.

Parameters:
async - false means wait for any recovery scan in progress to complete

suspendScan

public void suspendScan(boolean async)
Suspend the recovery manager. If the recovery manager is in the process of doing recovery scans then it will be suspended afterwards, in order to preserve data integrity.

Parameters:
async - false means wait for the recovery manager to finish any scans before returning.

resumeScan

public void resumeScan()

startRecoveryManagerThread

public void startRecoveryManagerThread()
Start the recovery manager thread.


addModule

public final void addModule(RecoveryModule module)
Add a recovery module to the system.

Parameters:
module - module The module to add.

removeModule

public final void removeModule(RecoveryModule module,
                               boolean waitOnScan)
Remove a recovery module from the system.

Parameters:
module - The module to remove.
waitOnScan - true if the remove operation should wait for any in-progress scan to complete

getModules

public final java.util.Vector getModules()
Obtain a snapshot list of available recovery modules.

Returns:
a snapshot list of the currently installed recovery modules

mode

public final int mode()
Indicates what mode (INDIRECT_MANAGEMENT or DIRECT_MANAGEMENT) the recovery manager is configured for.

Returns:
the management mode.

getRecoveryManagerHost

public static java.net.InetAddress getRecoveryManagerHost()
                                                   throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException

getRecoveryManagerPort

public static int getRecoveryManagerPort()

getClientSocket

public static java.net.Socket getClientSocket()
                                       throws java.io.IOException
Obtain a client connection to the recovery manager

Returns:
a bound client socket connection to the recovery manager
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
Run the RecoveryManager. See Administration manual for details.