Class StorageManager
java.lang.Object
org.javarosa.core.services.storage.StorageManager
public class StorageManager extends Object
Manages StorageProviders for JavaRosa, which maintain persistent
data on a device.
Largely derived from Cell Life's RMSManager
- Author:
- Clayton Sims
-
Constructor Summary
Constructors Constructor Description StorageManager() -
Method Summary
Modifier and Type Method Description static IStorageUtility<? extends Externalizable>getStorage(String key)static voidhalt()static String[]listRegisteredUtilities()static voidregisterStorage(String key, Class type)static voidregisterStorage(String storageKey, String storageName, Class type)static voidregisterStorage(String key, IStorageUtility<? extends Externalizable> storage)It is strongly, strongly advised that you do not register storage in this way.static voidregisterWrappedStorage(String key, String storeName, WrappingStorageUtility.SerializationWrapper wrapper)static voidrepairAll()static voidsetStorageFactory(IStorageFactory fact)Attempts to set the storage factory for the current environment.static voidsetStorageFactory(IStorageFactory fact, boolean mustWork)Attempts to set the storage factory for the current environment and fails and dies if there is already a storage factory set if specified.
-
Constructor Details
-
StorageManager
public StorageManager()
-
-
Method Details
-
setStorageFactory
Attempts to set the storage factory for the current environment. Will fail silently if a storage factory has already been set. Should be used by default environment.- Parameters:
fact- An available storage factory.
-
setStorageFactory
Attempts to set the storage factory for the current environment and fails and dies if there is already a storage factory set if specified. Should be used by actual applications who need to use a specific storage factory and shouldn't tolerate being pre-empted.- Parameters:
fact- An available storage factory.mustWork- true if it is intolerable for another storage factory to have been set. False otherwise
-
registerStorage
-
registerStorage
-
registerStorage
It is strongly, strongly advised that you do not register storage in this way.- Parameters:
key-storage-
-
registerWrappedStorage
public static void registerWrappedStorage(String key, String storeName, WrappingStorageUtility.SerializationWrapper wrapper) -
getStorage
-
repairAll
public static void repairAll() -
listRegisteredUtilities
-
halt
public static void halt()
-