T
- The type of objects to store in the mappublic class ApplicationPersistentMap<T> extends AbstractPersistentMap<T>
PersistentMap
whose contents are
shared only by separate executions of a single program. In the
constructor, you provide a unique "application identifier" as a string, and
the persistent values stored in this map will only be accessible to other
ApplicationPersistentMap
instances that were created with the
same application identifier.
In other respects, an ApplicationPersistentMap
works just like a
SharedPersistentMap
. Read the documentation for that class, and for
the PersistentMap
interface, to learn how to use this class.
Modifier and Type | Field and Description |
---|---|
static String |
APP_STORE |
loader, typeAware
Constructor and Description |
---|
ApplicationPersistentMap(String applicationIdentifier,
Class<T> genericClass)
Create a new map that associates keys with values of the specified class.
|
ApplicationPersistentMap(String applicationIdentifier,
Class<T> genericClass,
ClassLoader loader)
NOT FOR STUDENT USE.
|
Modifier and Type | Method and Description |
---|---|
static String |
findIdentifier(String contextMap) |
protected String |
getCacheId(String uniqueId)
Get the cache ID for this map.
|
clear, containsKey, containsValue, entrySet, get, getPersistentObject, isEmpty, keySet, put, putAll, remove, removePersistentObject, setPersistentObject, size, values
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public static final String APP_STORE
public ApplicationPersistentMap(String applicationIdentifier, Class<T> genericClass)
Typical usage: if you want an application persistent map that stores
objects of class Widget
, then:
ApplicationPersistentMap<Widget> map = new ApplicationPersistentMap<Widget>( Widget.class );
applicationIdentifier
- A non-null, non-empty string used to uniquely identify the
application using this map. All instances created with the
same application identifier will "share" the same set of
key/value mappings.genericClass
- The Class
object that represents the generic type
T
, the type of values stored in this map.public ApplicationPersistentMap(String applicationIdentifier, Class<T> genericClass, ClassLoader loader)
genericClass
- Class typeloader
- custom class loader to use to load classesprotected String getCacheId(String uniqueId)
AbstractPersistentMap
getCacheId
in class AbstractPersistentMap<T>