public abstract class AbstractStoreManager extends PropertyStore implements StoreManager
A store manager's knowledge of its contents is typically not complete. It knows about the classes that it has encountered in its lifetime. The ExecutionContext can make the StoreManager aware of a class, and can check if the StoreManager knows about a particular class.
Modifier and Type | Field and Description |
---|---|
protected ConnectionManager |
connectionMgr
ConnectionManager
|
protected FlushProcess |
flushProcess
The flush process appropriate for this datastore.
|
protected NamingFactory |
namingFactory
Naming factory.
|
protected PersistenceNucleusContext |
nucleusContext
Nucleus Context.
|
protected StorePersistenceHandler |
persistenceHandler
Persistence handler.
|
protected QueryManager |
queryMgr
Query Manager.
|
protected StoreSchemaHandler |
schemaHandler
Schema handler.
|
protected StoreDataManager |
storeDataMgr
Manager for the data definition in the datastore.
|
protected String |
storeManagerKey
Key for this StoreManager e.g "rdbms", "neo4j"
|
protected ValueGenerationManager |
valueGenerationMgr
Manager for value generation.
|
frequentProperties, properties
OPTION_APPLICATION_COMPOSITE_ID, OPTION_APPLICATION_ID, OPTION_DATASTORE_ID, OPTION_DATASTORE_TIME_STORES_MILLISECS, OPTION_DATASTORE_TIME_STORES_NANOSECS, OPTION_DATASTORE_TIMEOUT, OPTION_NONDURABLE_ID, OPTION_ORM, OPTION_ORM_EMBEDDED_ARRAY, OPTION_ORM_EMBEDDED_ARRAY_NESTED, OPTION_ORM_EMBEDDED_COLLECTION, OPTION_ORM_EMBEDDED_COLLECTION_NESTED, OPTION_ORM_EMBEDDED_MAP, OPTION_ORM_EMBEDDED_MAP_NESTED, OPTION_ORM_EMBEDDED_PC, OPTION_ORM_EMBEDDED_PC_NESTED, OPTION_ORM_FOREIGN_KEYS, OPTION_ORM_INHERITANCE_COMPLETE_TABLE, OPTION_ORM_INHERITANCE_JOINED_TABLE, OPTION_ORM_INHERITANCE_SINGLE_TABLE, OPTION_ORM_SECONDARY_TABLE, OPTION_ORM_SERIALISED_ARRAY_ELEMENT, OPTION_ORM_SERIALISED_COLLECTION_ELEMENT, OPTION_ORM_SERIALISED_MAP_KEY, OPTION_ORM_SERIALISED_MAP_VALUE, OPTION_ORM_SERIALISED_PC, OPTION_QUERY_CANCEL, OPTION_QUERY_JDOQL_BITWISE_OPS, OPTION_QUERY_JDOQL_BULK_DELETE, OPTION_QUERY_JDOQL_BULK_INSERT, OPTION_QUERY_JDOQL_BULK_UPDATE, OPTION_QUERY_JPQL_BULK_DELETE, OPTION_QUERY_JPQL_BULK_INSERT, OPTION_QUERY_JPQL_BULK_UPDATE, OPTION_TRANSACTION_ACID, OPTION_TXN_ISOLATION_READ_COMMITTED, OPTION_TXN_ISOLATION_READ_UNCOMMITTED, OPTION_TXN_ISOLATION_REPEATABLE_READ, OPTION_TXN_ISOLATION_SERIALIZABLE, RELATION_IDENTITY_STORAGE_PERSISTABLE_IDENTITY
Modifier | Constructor and Description |
---|---|
protected |
AbstractStoreManager(String key,
ClassLoaderResolver clr,
PersistenceNucleusContext nucleusContext,
Map<String,Object> props)
Constructor for a new StoreManager.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
deregisterAllStoreData()
Method to deregister all existing store data so that we are managing nothing.
|
ApiAdapter |
getApiAdapter()
Accessor for the API adapter.
|
Boolean |
getBooleanObjectProperty(String name)
Accessor for the specified property as a Boolean.
|
boolean |
getBooleanProperty(String name)
Accessor for the specified property as a boolean.
|
boolean |
getBooleanProperty(String name,
boolean resultIfNotSet)
Accessor for the specified property as a boolean.
|
String |
getClassNameForObjectID(Object id,
ClassLoaderResolver clr,
ExecutionContext ec)
Returns the class corresponding to the given object identity.
|
ConnectionManager |
getConnectionManager()
Accessor for the connection manager for this store manager.
|
String |
getConnectionPassword()
Convenience accessor for the password to use for the connection.
|
String |
getDefaultObjectProviderClassName() |
<T> Extent<T> |
getExtent(ExecutionContext ec,
Class<T> c,
boolean subclasses)
Interface to getting an Extent for a class.
|
FlushProcess |
getFlushProcess() |
int |
getIntProperty(String name)
Accessor for the specified property as an int.
|
MetaDataManager |
getMetaDataManager() |
NamingFactory |
getNamingFactory() |
protected Object |
getNextValueForValueGenerator(ValueGenerator generator,
ExecutionContext ec)
Accessor for the next value from the specified ValueGenerator.
|
NucleusConnection |
getNucleusConnection(ExecutionContext ec)
Method to return a connection to the user for the ExecutionContext.
|
PersistenceNucleusContext |
getNucleusContext()
Accessor for the context in which this StoreManager is running.
|
StorePersistenceHandler |
getPersistenceHandler() |
protected Properties |
getPropertiesForValueGenerator(AbstractClassMetaData cmd,
int absoluteFieldNumber,
ClassLoaderResolver clr,
SequenceMetaData seqmd,
TableGeneratorMetaData tablegenmd)
Method to return the properties to pass to the generator for the specified field.
|
Object |
getProperty(String name)
Method to get the value of a property from the store.
|
QueryManager |
getQueryManager() |
StoreSchemaHandler |
getSchemaHandler() |
StoreData |
getStoreDataForClass(String className) |
String |
getStoreManagerKey()
Accessor for the key for this store manager.
|
String |
getStringProperty(String name)
Accessor for the specified property as a String.
|
Collection<String> |
getSubClassesForClass(String className,
boolean includeDescendents,
ClassLoaderResolver clr)
Utility to return the names of the classes that are known subclasses of the provided
class.
|
Collection<String> |
getSupportedOptions()
Accessor for the supported options in string form.
|
Collection<String> |
getSupportedQueryLanguages()
Accessor for the supported query languages.
|
ValueGenerationManager |
getValueGenerationManager()
Accessor for the ValueGenerationManager for generating field values.
|
String |
getValueGenerationStrategyForNative(AbstractClassMetaData cmd,
int absFieldNumber)
Method defining which value-strategy to use when the user specifies "native".
|
Object |
getValueGenerationStrategyValue(ExecutionContext ec,
AbstractClassMetaData cmd,
int absoluteFieldNumber)
Method to retrieve the value for a value generation strategy for a particular field.
|
protected ValueGenerator |
getValueGeneratorForMember(ClassLoaderResolver clr,
AbstractClassMetaData cmd,
int absoluteFieldNumber) |
boolean |
hasProperty(String name)
Accessor for whether a particular property is defined (but may be null).
|
boolean |
isJdbcStore()
Returns whether the datastore is a "JDBC datastore".
|
boolean |
isValueGenerationStrategyDatastoreAttributed(AbstractClassMetaData cmd,
int absFieldNumber)
Convenience method to return whether the strategy used by the specified class/member is generated
by the datastore (during a persist).
|
protected void |
logConfiguration()
Convenience method to log the configuration of this store manager.
|
void |
manageClasses(ClassLoaderResolver clr,
String... classNames)
Manage the specified classes.
|
String |
manageClassForIdentity(Object id,
ClassLoaderResolver clr)
Convenience method to ensure that the class defined by the passed DatastoreId/SingleFieldId is managed by the store.
|
boolean |
managesClass(String className)
Accessor for whether the specified class is managed currently
|
protected StoreData |
newStoreData(ClassMetaData cmd,
ClassLoaderResolver clr)
Instantiate a StoreData instance using the provided ClassMetaData and ClassLoaderResolver.
|
void |
printInformation(String category,
PrintStream ps)
Method to output the information about the StoreManager.
|
protected void |
registerConnectionMgr()
Register the default ConnectionManager implementation.
|
protected void |
registerStoreData(StoreData data)
Method to register some data with the store.
|
boolean |
supportsQueryLanguage(String language)
Accessor for whether this query language is supported.
|
boolean |
supportsValueGenerationStrategy(String strategy)
Accessor for whether this value strategy is supported.
|
void |
unmanageAllClasses(ClassLoaderResolver clr)
Remove all classes from the persistence model for the datastore.
|
void |
unmanageClass(ClassLoaderResolver clr,
String className,
boolean removeFromDatastore)
Method to remove knowledge of the specified class from this StoreManager.
|
boolean |
useBackedSCOWrapperForMember(AbstractMemberMetaData mmd,
ExecutionContext ec)
Method to return whether the specified member should use a backed SCO wrapper.
|
getFrequentProperties, hasPropertyNotNull, setPropertyInternal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConnectionDriverName, getConnectionFactory, getConnectionFactory2, getConnectionFactory2Name, getConnectionFactoryName, getConnectionURL, getConnectionUserName, getDatastoreDate, getNativeQueryLanguage, getNucleusSequence, getQueryCacheKey, newQuery, newQuery, newQuery, transactionCommitted, transactionRolledBack, transactionStarted, usesBackedSCOWrappers
protected final String storeManagerKey
protected PersistenceNucleusContext nucleusContext
protected ValueGenerationManager valueGenerationMgr
protected StoreDataManager storeDataMgr
protected StorePersistenceHandler persistenceHandler
protected FlushProcess flushProcess
protected QueryManager queryMgr
protected StoreSchemaHandler schemaHandler
protected NamingFactory namingFactory
protected ConnectionManager connectionMgr
protected AbstractStoreManager(String key, ClassLoaderResolver clr, PersistenceNucleusContext nucleusContext, Map<String,Object> props)
key
- Key for this StoreManagerclr
- the ClassLoaderResolvernucleusContext
- The corresponding nucleus context.props
- Any properties controlling this datastoreprotected void registerConnectionMgr()
public void close()
close
in interface StoreManager
public ConnectionManager getConnectionManager()
StoreManager
getConnectionManager
in interface StoreManager
public String getConnectionPassword()
getConnectionPassword
in interface StoreManager
public boolean isJdbcStore()
StoreManager
isJdbcStore
in interface StoreManager
public StorePersistenceHandler getPersistenceHandler()
getPersistenceHandler
in interface StoreManager
public FlushProcess getFlushProcess()
getFlushProcess
in interface StoreManager
public QueryManager getQueryManager()
getQueryManager
in interface StoreManager
public StoreSchemaHandler getSchemaHandler()
getSchemaHandler
in interface StoreManager
public NamingFactory getNamingFactory()
getNamingFactory
in interface StoreManager
public NucleusConnection getNucleusConnection(ExecutionContext ec)
StoreManager
getNucleusConnection
in interface StoreManager
ec
- execution contextpublic ValueGenerationManager getValueGenerationManager()
StoreManager
getValueGenerationManager
in interface StoreManager
public ApiAdapter getApiAdapter()
StoreManager
getApiAdapter
in interface StoreManager
public String getStoreManagerKey()
StoreManager
getStoreManagerKey
in interface StoreManager
public PersistenceNucleusContext getNucleusContext()
StoreManager
getNucleusContext
in interface StoreManager
public MetaDataManager getMetaDataManager()
getMetaDataManager
in interface StoreManager
public StoreData getStoreDataForClass(String className)
getStoreDataForClass
in interface StoreManager
protected void registerStoreData(StoreData data)
data
- The StoreData to addprotected void deregisterAllStoreData()
protected void logConfiguration()
public void printInformation(String category, PrintStream ps) throws Exception
printInformation
in interface StoreManager
category
- Category of informationps
- PrintStreamException
- Thrown if an error occurs in the output processpublic boolean managesClass(String className)
StoreManager
managesClass
in interface StoreManager
className
- The name of the classpublic void manageClasses(ClassLoaderResolver clr, String... classNames)
StoreManager
manageClasses
in interface StoreManager
clr
- The ClassLoaderResolverclassNames
- The class(es) to be managedprotected StoreData newStoreData(ClassMetaData cmd, ClassLoaderResolver clr)
cmd
- MetaData for the classclr
- ClassLoader resolverpublic void unmanageAllClasses(ClassLoaderResolver clr)
StoreManager
unmanageAllClasses
in interface StoreManager
clr
- The ClassLoaderResolverpublic void unmanageClass(ClassLoaderResolver clr, String className, boolean removeFromDatastore)
StoreManager
unmanageClass
in interface StoreManager
clr
- ClassLoader resolverclassName
- Name of the classremoveFromDatastore
- Whether to also remove it from the datastore (otherwise just from the StoreManager)public String manageClassForIdentity(Object id, ClassLoaderResolver clr)
StoreManager
manageClassForIdentity
in interface StoreManager
id
- identityclr
- ClassLoader resolverpublic <T> Extent<T> getExtent(ExecutionContext ec, Class<T> c, boolean subclasses)
StoreManager
getExtent
in interface StoreManager
T
- Type of the extentec
- execution contextc
- The class requiring the Extentsubclasses
- Whether to include subclasses of 'c'public Collection<String> getSupportedQueryLanguages()
StoreManager
getSupportedQueryLanguages
in interface StoreManager
public boolean supportsQueryLanguage(String language)
StoreManager
supportsQueryLanguage
in interface StoreManager
language
- The languagepublic String getClassNameForObjectID(Object id, ClassLoaderResolver clr, ExecutionContext ec)
StoreManager
getClassNameForObjectID
in interface StoreManager
id
- The identity of some object.clr
- ClassLoader resolverec
- execution contextpublic boolean supportsValueGenerationStrategy(String strategy)
supportsValueGenerationStrategy
in interface StoreManager
strategy
- The strategypublic boolean isValueGenerationStrategyDatastoreAttributed(AbstractClassMetaData cmd, int absFieldNumber)
isValueGenerationStrategyDatastoreAttributed
in interface StoreManager
cmd
- Metadata for the classabsFieldNumber
- Absolute field number for the field (or -1 if datastore id)public Object getValueGenerationStrategyValue(ExecutionContext ec, AbstractClassMetaData cmd, int absoluteFieldNumber)
StoreManager
getValueGenerationStrategyValue
in interface StoreManager
ec
- execution contextcmd
- AbstractClassMetaData for the classabsoluteFieldNumber
- The field numberprotected ValueGenerator getValueGeneratorForMember(ClassLoaderResolver clr, AbstractClassMetaData cmd, int absoluteFieldNumber)
public String getValueGenerationStrategyForNative(AbstractClassMetaData cmd, int absFieldNumber)
getValueGenerationStrategyForNative
in interface StoreManager
cmd
- Class requiring the strategyabsFieldNumber
- Field of the classprotected Object getNextValueForValueGenerator(ValueGenerator generator, ExecutionContext ec)
generator
- The generatorec
- execution contextprotected Properties getPropertiesForValueGenerator(AbstractClassMetaData cmd, int absoluteFieldNumber, ClassLoaderResolver clr, SequenceMetaData seqmd, TableGeneratorMetaData tablegenmd)
cmd
- MetaData for the classabsoluteFieldNumber
- Number of the field (-1 = datastore identity)clr
- ClassLoader resolverseqmd
- Any sequence metadatatablegenmd
- Any table generator metadatapublic Collection<String> getSubClassesForClass(String className, boolean includeDescendents, ClassLoaderResolver clr)
StoreManager
getSubClassesForClass
in interface StoreManager
className
- Class for which we search for subclasses.includeDescendents
- Whether to include subclasses of subclasses etcclr
- The ClassLoaderResolverpublic Collection<String> getSupportedOptions()
getSupportedOptions
in interface StoreManager
public boolean hasProperty(String name)
PropertyStore
hasProperty
in interface StoreManager
hasProperty
in class PropertyStore
name
- Property namepublic Object getProperty(String name)
PropertyStore
getProperty
in interface StoreManager
getProperty
in class PropertyStore
name
- Name of the propertypublic int getIntProperty(String name)
PropertyStore
getIntProperty
in interface StoreManager
getIntProperty
in class PropertyStore
name
- Name of the propertypublic String getStringProperty(String name)
PropertyStore
getStringProperty
in interface StoreManager
getStringProperty
in class PropertyStore
name
- Name of the propertypublic boolean getBooleanProperty(String name)
PropertyStore
getBooleanProperty
in interface StoreManager
getBooleanProperty
in class PropertyStore
name
- Name of the propertypublic boolean getBooleanProperty(String name, boolean resultIfNotSet)
PropertyStore
getBooleanProperty
in interface StoreManager
getBooleanProperty
in class PropertyStore
name
- Name of the propertyresultIfNotSet
- The value to return if no value for the specified property is found.public Boolean getBooleanObjectProperty(String name)
PropertyStore
getBooleanObjectProperty
in interface StoreManager
getBooleanObjectProperty
in class PropertyStore
name
- Name of the propertypublic boolean useBackedSCOWrapperForMember(AbstractMemberMetaData mmd, ExecutionContext ec)
StoreManager
useBackedSCOWrapperForMember
in interface StoreManager
mmd
- Metadata for the memberec
- ExecutionContextpublic String getDefaultObjectProviderClassName()
getDefaultObjectProviderClassName
in interface StoreManager
Copyright © 2019. All rights reserved.