public class PersistenceNucleusContextImpl extends AbstractNucleusContext implements Serializable, PersistenceNucleusContext
apiAdapter, classLoaderResolverClassName, classLoaderResolverMap, config, metaDataManager, pluginManager, STARTUP_PROPERTIES, typeManager| Constructor and Description |
|---|
PersistenceNucleusContextImpl(String apiName,
Map startupProps)
Constructor for the context.
|
PersistenceNucleusContextImpl(String apiName,
Map startupProps,
PluginManager pluginMgr)
Constructor for the context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExecutionContextListener(ExecutionContext.LifecycleListener listener)
Register a new Listener for ExecutionContext events.
|
void |
addInternalFetchGroup(FetchGroup grp)
Method to add a dynamic FetchGroup for use by this OMF.
|
void |
applyDefaultProperties(Configuration conf)
Method called when initialising the Configuration to load up defaults for the properties appropriate for this NucleusContext.
|
void |
close()
Clear out resources for the supported services.
|
FetchGroup |
createInternalFetchGroup(Class cls,
String name)
Method to create a new internal fetch group for the class+name.
|
AutoStartMechanism |
getAutoStartMechanism() |
BeanValidationHandler |
getBeanValidationHandler(ExecutionContext ec)
Method to return a handler for bean validation (JSR303).
|
CDIHandler |
getCDIHandler()
Accessor for the handler for CDI (JSR346) if in an environment that provides one.
|
String |
getCurrentUser(ExecutionContext ec)
Accessor for the current user for the supplied ExecutionContext.
|
ExecutionContext |
getExecutionContext(Object owner,
Map<String,Object> options)
Method to return an ExecutionContext for use in persistence.
|
ExecutionContext.LifecycleListener[] |
getExecutionContextListeners()
Object the array of registered ExecutionContext listeners.
|
ExecutionContextPool |
getExecutionContextPool() |
FetchGroupManager |
getFetchGroupManager()
Convenience accessor for the FetchGroupManager.
|
Set<FetchGroup> |
getFetchGroupsWithName(String name)
Accessor for the fetch groups for the specified name.
|
IdentityManager |
getIdentityManager()
Accessor for a manager for identities.
|
ImplementationCreator |
getImplementationCreator() |
FetchGroup |
getInternalFetchGroup(Class cls,
String name,
boolean createIfNotPresent)
Accessor for an internal fetch group for the specified class.
|
ManagementManager |
getJMXManager()
Accessor for the JMX manager (if required).
|
JTASyncRegistry |
getJtaSyncRegistry()
Accessor for the JTA Synchronization registry, when using JTA.
|
TransactionManager |
getJtaTransactionManager()
Accessor for the JTA transaction manager, when using JTA.
|
Level2Cache |
getLevel2Cache() |
String |
getMultiTenancyId(ExecutionContext ec,
AbstractClassMetaData cmd)
Accessor for the tenant id for the supplied class and ExecutionContext.
|
ObjectProviderFactory |
getObjectProviderFactory() |
ResourcedTransactionManager |
getResourcedTransactionManager() |
FactoryStatistics |
getStatistics() |
StoreManager |
getStoreManager() |
boolean |
hasLevel2Cache() |
void |
initialise()
Method to initialise the context for use.
|
protected void |
initialiseAutoStart(ClassLoaderResolver clr)
Method to initialise the auto-start mechanism, loading up the classes
from its store into memory so that we start from what is required to be loaded.
|
protected void |
initialiseNamedQueries(ClassLoaderResolver clr)
Method to compile all registered named queries (when the user has initialised using a persistence-unit).
|
protected void |
initialiseSchema(String generateModeStr,
boolean generateScripts)
Method to handle generation (create, drop, drop+create) of a schema at initialisation.
|
boolean |
isClassCacheable(AbstractClassMetaData cmd)
Convenience method to return if objects of this type are cached for this NucleusContext.
|
boolean |
isClassMultiTenant(AbstractClassMetaData cmd)
Accessor for whether the supplied class is multi-tenant (i.e with a tenancy id column).
|
boolean |
isClassWithIdentityCacheable(Object id)
Convenience method to return if the supplied id is of an object that is cacheable in the L2 cache.
|
boolean |
isFederated()
Return whether we are managing a federated context (i.e a primary StoreManager, with some secondary StoreManager(s)).
|
boolean |
isJcaMode()
Accessor for the JCA mode.
|
protected void |
logConfigurationDetails()
Convenience method so that extending implementations can log their own configuration.
|
void |
removeExecutionContextListener(ExecutionContext.LifecycleListener listener)
Unregister a Listener from ExecutionContext events.
|
void |
removeInternalFetchGroup(FetchGroup grp)
Method to remove a dynamic FetchGroup from use by this OMF.
|
void |
setJcaMode(boolean jca)
Mutator for whether we are in JCA mode.
|
boolean |
statisticsEnabled()
Accessor for whether statistics gathering is enabled.
|
boolean |
supportsORMMetaData() |
getApiAdapter, getApiName, getClassLoaderResolver, getConfiguration, getMetaDataManager, getPluginManager, getTypeManager, logConfigurationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetApiAdapter, getApiName, getClassLoaderResolver, getConfiguration, getMetaDataManager, getPluginManager, getTypeManagerpublic PersistenceNucleusContextImpl(String apiName, Map startupProps)
apiName - Name of the API that we need a context for (JDO, JPA, etc)startupProps - Any properties that could define behaviour of this context (plugin registry, class loading etc)public PersistenceNucleusContextImpl(String apiName, Map startupProps, PluginManager pluginMgr)
apiName - Name of the API that we need a context for (JDO, JPA, etc)startupProps - Any properties that could define behaviour of this context (plugin registry, class loading etc)pluginMgr - Plugin Manager (or null if wanting it to be created)public void applyDefaultProperties(Configuration conf)
NucleusContextapplyDefaultProperties in interface NucleusContextapplyDefaultProperties in class AbstractNucleusContextconf - The configurationpublic void initialise()
NucleusContextinitialise in interface NucleusContextinitialise in class AbstractNucleusContextpublic void close()
NucleusContextclose in interface NucleusContextclose in class AbstractNucleusContextprotected void initialiseAutoStart(ClassLoaderResolver clr) throws DatastoreInitialisationException
clr - The ClassLoaderResolverDatastoreInitialisationException - if an error occursprotected void logConfigurationDetails()
AbstractNucleusContextlogConfigurationDetails in class AbstractNucleusContextpublic boolean isFederated()
PersistenceNucleusContextisFederated in interface PersistenceNucleusContextpublic AutoStartMechanism getAutoStartMechanism()
getAutoStartMechanism in interface PersistenceNucleusContextprotected void initialiseNamedQueries(ClassLoaderResolver clr)
clr - ClassLoader resolverprotected void initialiseSchema(String generateModeStr, boolean generateScripts)
generateModeStr - Generate "mode"generateScripts - Whether to generatepublic ExecutionContextPool getExecutionContextPool()
getExecutionContextPool in interface PersistenceNucleusContextpublic ObjectProviderFactory getObjectProviderFactory()
getObjectProviderFactory in interface PersistenceNucleusContextpublic ExecutionContext getExecutionContext(Object owner, Map<String,Object> options)
PersistenceNucleusContextgetExecutionContext in interface PersistenceNucleusContextowner - The owner object for the context. PersistenceManager/EntityManager typically.options - Any options affecting startuppublic IdentityManager getIdentityManager()
PersistenceNucleusContextgetIdentityManager in interface PersistenceNucleusContextpublic boolean statisticsEnabled()
PersistenceNucleusContextstatisticsEnabled in interface PersistenceNucleusContextpublic ManagementManager getJMXManager()
PersistenceNucleusContextgetJMXManager in interface PersistenceNucleusContextpublic FactoryStatistics getStatistics()
getStatistics in interface PersistenceNucleusContextpublic ImplementationCreator getImplementationCreator()
getImplementationCreator in interface PersistenceNucleusContextpublic ResourcedTransactionManager getResourcedTransactionManager()
getResourcedTransactionManager in interface PersistenceNucleusContextpublic TransactionManager getJtaTransactionManager()
PersistenceNucleusContextgetJtaTransactionManager in interface PersistenceNucleusContextpublic JTASyncRegistry getJtaSyncRegistry()
PersistenceNucleusContextgetJtaSyncRegistry in interface PersistenceNucleusContextpublic StoreManager getStoreManager()
getStoreManager in interface StoreNucleusContextpublic boolean supportsORMMetaData()
supportsORMMetaData in interface NucleusContextsupportsORMMetaData in class AbstractNucleusContextpublic BeanValidationHandler getBeanValidationHandler(ExecutionContext ec)
PersistenceNucleusContextgetBeanValidationHandler in interface PersistenceNucleusContextec - The ExecutionContext that the handler is for.public CDIHandler getCDIHandler()
PersistenceNucleusContextgetCDIHandler in interface PersistenceNucleusContextpublic boolean hasLevel2Cache()
hasLevel2Cache in interface PersistenceNucleusContextpublic Level2Cache getLevel2Cache()
getLevel2Cache in interface PersistenceNucleusContextpublic ExecutionContext.LifecycleListener[] getExecutionContextListeners()
PersistenceNucleusContextgetExecutionContextListeners in interface PersistenceNucleusContextExecutionContext.LifecycleListenerpublic void addExecutionContextListener(ExecutionContext.LifecycleListener listener)
PersistenceNucleusContextaddExecutionContextListener in interface PersistenceNucleusContextlistener - the listener to registerpublic void removeExecutionContextListener(ExecutionContext.LifecycleListener listener)
PersistenceNucleusContextremoveExecutionContextListener in interface PersistenceNucleusContextlistener - the listener to unregisterpublic void setJcaMode(boolean jca)
PersistenceNucleusContextsetJcaMode in interface PersistenceNucleusContextjca - true if using JCA connectorpublic boolean isJcaMode()
PersistenceNucleusContextisJcaMode in interface PersistenceNucleusContextpublic FetchGroupManager getFetchGroupManager()
PersistenceNucleusContextgetFetchGroupManager in interface PersistenceNucleusContextpublic void addInternalFetchGroup(FetchGroup grp)
PersistenceNucleusContextaddInternalFetchGroup in interface PersistenceNucleusContextgrp - The grouppublic void removeInternalFetchGroup(FetchGroup grp)
PersistenceNucleusContextremoveInternalFetchGroup in interface PersistenceNucleusContextgrp - The grouppublic FetchGroup createInternalFetchGroup(Class cls, String name)
PersistenceNucleusContextcreateInternalFetchGroup in interface PersistenceNucleusContextcls - Class that it applies toname - Name of grouppublic FetchGroup getInternalFetchGroup(Class cls, String name, boolean createIfNotPresent)
PersistenceNucleusContextgetInternalFetchGroup in interface PersistenceNucleusContextcls - The classname - Name of the groupcreateIfNotPresent - Whether to create the fetch group if not presentpublic Set<FetchGroup> getFetchGroupsWithName(String name)
PersistenceNucleusContextgetFetchGroupsWithName in interface PersistenceNucleusContextname - Name of the grouppublic boolean isClassWithIdentityCacheable(Object id)
PersistenceNucleusContextisClassWithIdentityCacheable in interface PersistenceNucleusContextid - The identitypublic boolean isClassCacheable(AbstractClassMetaData cmd)
PersistenceNucleusContextisClassCacheable in interface PersistenceNucleusContextcmd - MetaData for the classpublic boolean isClassMultiTenant(AbstractClassMetaData cmd)
PersistenceNucleusContextisClassMultiTenant in interface PersistenceNucleusContextcmd - The classpublic String getMultiTenancyId(ExecutionContext ec, AbstractClassMetaData cmd)
PersistenceNucleusContextgetMultiTenancyId in interface PersistenceNucleusContextec - ExecutionContextcmd - The classpublic String getCurrentUser(ExecutionContext ec)
PersistenceNucleusContextgetCurrentUser in interface PersistenceNucleusContextec - ExecutionContextCopyright © 2019. All rights reserved.