public class KvManagerFactory extends Object
SystemCapability.Data#DATA_DISTRIBUTEDDATAMGR| 限定符和类型 | 方法 | 说明 |
|---|---|---|
KvManager |
createKvManager(KvManagerConfig config) |
Creates a
KvManager instance based on the configuration information. |
static KvManagerFactory |
getInstance() |
Obtains a
KvManagerFactory instance. |
void |
registerKvStoreServiceDeathRecipient(KvStoreServiceDeathRecipient deathObserver) |
Register KvStore Service Death Recipient
|
void |
unRegisterKvStoreServiceDeathRecipient(KvStoreServiceDeathRecipient deathObserver) |
UnRegister KvStore Service Death Recipient
|
public static final KvManagerFactory getInstance()
KvManagerFactory instance.
A KvManagerFactory instance can be used to create and obtain a KvManager object.
KvManagerFactory instance.public KvManager createKvManager(KvManagerConfig config) throws KvStoreException
KvManager instance based on the configuration information.
You must pass KvManagerConfig to provide configuration information
for creating the KvManager instance.
config - Indicates the KvStore configuration information,
including the user information and package name.KvManager instance.KvStoreException - Throws this exception if input is invalid.public void registerKvStoreServiceDeathRecipient(KvStoreServiceDeathRecipient deathObserver) throws KvStoreException
deathObserver - it will be notified when service diedKvStoreException - Throws this exception if any of the following errors occurs:
SERVER_UNAVAILABLE, DB_ERROR, PERMISSION_DENIED, and IPC_ERROR.public void unRegisterKvStoreServiceDeathRecipient(KvStoreServiceDeathRecipient deathObserver) throws KvStoreException
deathObserver - it will be notified when service diedKvStoreException - Throws this exception if any of the following errors occurs:
SERVER_UNAVAILABLE, DB_ERROR, PERMISSION_DENIED, and IPC_ERROR.