public class AppEngineDataStoreFactory extends AbstractDataStoreFactory
Thread-safe Google App Engine implementation of a data store factory that directly uses the App Engine Data Store API.
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 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.
Static Methods
getDefaultInstance()
public static AppEngineDataStoreFactory getDefaultInstance()
Returns a global thread-safe instance based on the default constructor #AppEngineDataStoreFactory().
Returns | |
---|---|
Type | Description |
AppEngineDataStoreFactory |
Constructors
AppEngineDataStoreFactory()
public AppEngineDataStoreFactory()
AppEngineDataStoreFactory(AppEngineDataStoreFactory.Builder builder)
public AppEngineDataStoreFactory(AppEngineDataStoreFactory.Builder builder)
Parameter | |
---|---|
Name | Description |
builder | AppEngineDataStoreFactory.Builder builder |
Methods
<V>createDataStore(String id)
protected DataStore<V> <V>createDataStore(String id)
Returns a new instance of a type-specific data store based on the given unique ID.
The DataStore#getId() must match the id
parameter from this method.
Parameter | |
---|---|
Name | Description |
id | String |
Returns | |
---|---|
Type | Description |
DataStore<V> |
Exceptions | |
---|---|
Type | Description |
IOException |
getDisableMemcache()
public boolean getDisableMemcache()
Returns whether to disable the memcache (which is enabled by default).
Returns | |
---|---|
Type | Description |
boolean |