com.gridsystems.storage
Class FailSafeManager

java.lang.Object
  extended by com.gridsystems.storage.FailSafeManager

public final class FailSafeManager
extends java.lang.Object

This class manages the safe load and stores.

Version:
1.0

Method Summary
static void delete(FailSafe fs)
          Deletes all files (including backups) for the specified FailSafe instance.
static FailSafe load(java.lang.Class c)
          Manages all load information of the class.
static FailSafe load(java.lang.Class c, java.util.Map map)
          Manages all load information of the class.
static FailSafe load(java.lang.Class c, java.lang.Object obj)
          Manages all load information of the class.
static void load(FailSafe data)
          Manages all load information of the class.
static void store(FailSafe data)
          Manages the store information of the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

store

public static void store(FailSafe data)
                  throws java.lang.Exception
Manages the store information of the class.

Parameters:
data - The FailSafe instance to manage
Throws:
java.lang.Exception - if the files cannot be stored correctly.

load

public static void load(FailSafe data)
                 throws java.lang.Exception
Manages all load information of the class.

Parameters:
data - The FailSafe instance to manage
Throws:
java.lang.Exception - if the files cannot be loaded correctly.

load

public static FailSafe load(java.lang.Class c)
                     throws java.lang.Exception
Manages all load information of the class.

As this method does not use initialization data, it is preferred to use it only with classes implementing the Singleton pattern.

Parameters:
c - The class to load
Returns:
An initialized instance of the class
Throws:
java.lang.Exception - In case of execution error

load

public static FailSafe load(java.lang.Class c,
                            java.util.Map map)
                     throws java.lang.Exception
Manages all load information of the class.

The map parameter will be used as the argument for the constructor. If no appropriate constructor is found, it will fall back to the "no-argument" version.

Parameters:
c - The class to load
map - The map to pass to the constructor
Returns:
An initialized instance of the class
Throws:
java.lang.Exception - In case of execution error

load

public static FailSafe load(java.lang.Class c,
                            java.lang.Object obj)
                     throws java.lang.Exception
Manages all load information of the class.

The object parameter will be used as the argument for the constructor. The object must be exactly of the same class than the expected constructor parameter. If no appropriate constructor is found, it will fall back to the "no-argument" version.

Parameters:
c - The class to load
obj - The object to pass to the constructor
Returns:
An initialized instance of the class
Throws:
java.lang.Exception - In case of execution error

delete

public static void delete(FailSafe fs)
                   throws java.lang.Exception
Deletes all files (including backups) for the specified FailSafe instance.

Parameters:
fs - The instance whose files to delete
Throws:
java.lang.Exception - In case of execution error


Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.