public class AppEngineDataStoreFactory extends AbstractDataStoreFactory
For convenience, a default global instance is provided in getDefaultInstance()
.
By default, it uses the Memcache API as an in-memory data cache. To disable it, call AppEngineDataStoreFactory.Builder.setDisableMemcache(boolean)
. The Memcache is only read to check if a key already has a
value inside DataStore.get(String)
. The values in the Memcache are updated in the DataStore.get(String)
, DataStore.set(String, Serializable)
, DataStore.delete(String)
, DataStore.values()
, and DataStore.clear()
methods.
Modifier and Type | Class and Description |
---|---|
static class |
AppEngineDataStoreFactory.Builder
App Engine data store factory builder.
|
Constructor and Description |
---|
AppEngineDataStoreFactory() |
AppEngineDataStoreFactory(AppEngineDataStoreFactory.Builder builder) |
Modifier and Type | Method and Description |
---|---|
protected <V extends Serializable> |
createDataStore(String id)
Returns a new instance of a type-specific data store based on the given unique ID.
|
static AppEngineDataStoreFactory |
getDefaultInstance()
Returns a global thread-safe instance based on the default constructor
AppEngineDataStoreFactory() . |
boolean |
getDisableMemcache()
Returns whether to disable the memcache (which is enabled by default).
|
getDataStore
public AppEngineDataStoreFactory()
public AppEngineDataStoreFactory(AppEngineDataStoreFactory.Builder builder)
builder
- builderprotected <V extends Serializable> DataStore<V> createDataStore(String id) throws IOException
AbstractDataStoreFactory
The DataStore.getId()
must match the id
parameter from this method.
createDataStore
in class AbstractDataStoreFactory
V
- serializable type of the mapped valueid
- unique ID to refer to typed data storeIOException
public boolean getDisableMemcache()
public static AppEngineDataStoreFactory getDefaultInstance()
AppEngineDataStoreFactory()
.Copyright © 2011–2023 Google. All rights reserved.