|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.FederationManager
public class FederationManager
Federation Manager orchestrates the persistence/retrieval for multiple datastores. It is responsible for creating the individual StoreManager instances for the datastore(s) that are being federated. Currently only manages a single StoreManager NOTE : THIS IS NOT CURRENTLY USED
| Field Summary | |
|---|---|
protected static Localiser |
LOCALISER
Localisation of messages. |
| Constructor Summary | |
|---|---|
FederationManager(ClassLoaderResolver clr,
OMFContext omfContext)
|
|
| Method Summary | |
|---|---|
void |
addClass(java.lang.String className,
ClassLoaderResolver clr)
Method to add a class to the managed list for this datastore manager. |
void |
addClasses(java.lang.String[] classNames,
ClassLoaderResolver clr)
Add classes to the persistence model for the datastore. |
void |
close()
Release of resources. |
ApiAdapter |
getApiAdapter()
Accessor for the API adapter. |
Store |
getBackingStoreForField(ClassLoaderResolver clr,
AbstractMemberMetaData fmd,
java.lang.Class type)
Accessor for the backing store for the specified field. |
java.lang.String |
getClassNameForObjectID(java.lang.Object id,
ClassLoaderResolver clr,
ExecutionContext ec)
Returns the class corresponding to the given object identity. |
ManagedConnection |
getConnection(ExecutionContext ec)
Accessor for a connection for the specified ObjectManager. |
ManagedConnection |
getConnection(ExecutionContext ec,
java.util.Map options)
Accessor for a connection for the specified ObjectManager. |
java.lang.String |
getConnectionDriverName()
Convenience accessor for the driver name to use for the connection. |
java.lang.Object |
getConnectionFactory()
Convenience accessor for the factory for the connection (transactional). |
java.lang.Object |
getConnectionFactory2()
Convenience accessor for the factory for the connection (non-transactional). |
java.lang.String |
getConnectionFactory2Name()
Convenience accessor for the factory name for the connection (non-transactional). |
java.lang.String |
getConnectionFactoryName()
Convenience accessor for the factory name for the connection (transactional). |
ConnectionManager |
getConnectionManager()
Accessor for the connection manager for this store manager. |
java.lang.String |
getConnectionPassword()
Convenience accessor for the password to use for the connection. |
java.lang.String |
getConnectionURL()
Convenience accessor for the URL for the connection. |
java.lang.String |
getConnectionUserName()
Convenience accessor for the user name to use for the connection. |
java.util.Date |
getDatastoreDate()
Get the date/time of the datastore. |
Extent |
getExtent(ExecutionContext ec,
java.lang.Class c,
boolean subclasses)
Interface to getting an Extent for a class. |
NucleusConnection |
getNucleusConnection(ExecutionContext ec)
Method to return a connection for the ObjectManager. |
NucleusSequence |
getNucleusSequence(ExecutionContext ec,
SequenceMetaData seqmd)
Method to return a datastore sequence for this datastore matching the passed sequence MetaData. |
OMFContext |
getOMFContext()
Gets the context for this ObjectManagerFactory |
StorePersistenceHandler |
getPersistenceHandler()
Accessor for the store persistence handler. |
java.lang.String |
getQueryCacheKey()
Accessor for the key used for representing this store manager in the query cache. |
StoreManagerRuntime |
getRuntimeManager()
Accessor for the runtime management of this component (if specified as required to the PMF/EMF). |
StoreSchemaHandler |
getSchemaHandler()
Accessor for the store schema handler (if this datastore supports the concept of a schema). |
StoreManager |
getStoreManager()
|
java.lang.String |
getStoreManagerKey()
Accessor for the key for this store manager. |
java.lang.Object |
getStrategyValue(ExecutionContext ec,
AbstractClassMetaData cmd,
int absoluteFieldNumber)
Method to retrieve the value for a strategy for a particular field. |
java.util.HashSet |
getSubClassesForClass(java.lang.String className,
boolean includeDescendents,
ClassLoaderResolver clr)
Utility to return the names of the classes that are known subclasses of the provided class. |
java.util.Collection |
getSupportedOptions()
Accessor for the supported options in string form |
ValueGenerationManager |
getValueGenerationManager()
Accessor for the ValueGenerationManager for obtaining sequences. |
protected void |
initialiseStoreManager(ClassLoaderResolver clr)
Method to initialise the StoreManager used by this factory. |
boolean |
isStrategyDatastoreAttributed(IdentityStrategy identityStrategy,
boolean datastoreIdentityField)
Check if the strategy is attributed by the database when the PersistenceCapable object is inserted into the database |
java.lang.String |
manageClassForIdentity(java.lang.Object id,
ClassLoaderResolver clr)
Convenience method to ensure that the class defined by the passed OID/SingleFIeldIdentity is managed by the store. |
boolean |
managesClass(java.lang.String className)
Accessor for whether the specified class is managed currently |
void |
notifyObjectIsOutdated(ObjectProvider sm)
Notifies this store manager that the main memory (RAM, heap) copy of the PC object of the supplied StateManager may not be regarded as valid anymore. |
void |
performVersionCheck(ObjectProvider sm,
java.lang.Object versionDatastore,
VersionMetaData versionMetaData)
Perform an optimistic version check on the passed object, against the passed version in the datastore. |
void |
printInformation(java.lang.String category,
java.io.PrintStream ps)
Method to output particular information owned by this datastore. |
protected void |
processTransactionIsolation(StoreManager srm)
Method to check the supplied transaction isolation level is consistent for this StoreManagers capabilities. |
void |
removeAllClasses(ClassLoaderResolver clr)
Remove all classes from the persistence model for the datastore. |
boolean |
supportsQueryLanguage(java.lang.String language)
Accessor for whether this query language is supported. |
boolean |
supportsValueStrategy(java.lang.String language)
Accessor for whether this value strategy is supported. |
void |
transactionCommitted(ExecutionContext ec)
Method to inform the StoreManager that a transaction has committed for the specified execution context. |
void |
transactionRolledBack(ExecutionContext ec)
Method to inform the StoreManager that a transaction has rolled back for the specified execution context. |
void |
transactionStarted(ExecutionContext ec)
Method to inform the StoreManager that a transaction has started for the specified execution context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Localiser LOCALISER
| Constructor Detail |
|---|
public FederationManager(ClassLoaderResolver clr,
OMFContext omfContext)
| Method Detail |
|---|
public OMFContext getOMFContext()
getOMFContext in interface StoreManagerprotected void initialiseStoreManager(ClassLoaderResolver clr)
clr - ClassLoaderResolver to use for class loading issuesprotected void processTransactionIsolation(StoreManager srm)
srm - StoreManagerpublic StoreManager getStoreManager()
public void close()
StoreManager
close in interface StoreManager
public void addClass(java.lang.String className,
ClassLoaderResolver clr)
StoreManager
addClass in interface StoreManagerclassName - Name of the classclr - The ClassLoaderResolver
public void addClasses(java.lang.String[] classNames,
ClassLoaderResolver clr)
StoreManagerThis method is primarily useful for applications that wish to perform all of their datastore initialization up front, rather than wait for the runtime to do it on-demand.
addClasses in interface StoreManagerclassNames - The class(es) to be added.clr - The ClassLoaderResolverpublic ApiAdapter getApiAdapter()
StoreManager
getApiAdapter in interface StoreManager
public Store getBackingStoreForField(ClassLoaderResolver clr,
AbstractMemberMetaData fmd,
java.lang.Class type)
StoreManager
getBackingStoreForField in interface StoreManagerclr - ClassLoader resolverfmd - MetaData for the field/propertytype - Type
public java.lang.String getClassNameForObjectID(java.lang.Object id,
ClassLoaderResolver clr,
ExecutionContext ec)
StoreManager
getClassNameForObjectID in interface StoreManagerid - The identity of some object.clr - ClassLoader resolverec - execution context
public java.util.Date getDatastoreDate()
StoreManager
getDatastoreDate in interface StoreManager
public Extent getExtent(ExecutionContext ec,
java.lang.Class c,
boolean subclasses)
StoreManager
getExtent in interface StoreManagerec - execution contextc - The class requiring the Extentsubclasses - Whether to include subclasses of 'c'
public NucleusConnection getNucleusConnection(ExecutionContext ec)
StoreManager
getNucleusConnection in interface StoreManagerec - execution context
public NucleusSequence getNucleusSequence(ExecutionContext ec,
SequenceMetaData seqmd)
StoreManager
getNucleusSequence in interface StoreManagerec - execution contextseqmd - SequenceMetaData
public StoreSchemaHandler getSchemaHandler()
StoreManager
getSchemaHandler in interface StoreManagerpublic StorePersistenceHandler getPersistenceHandler()
StoreManager
getPersistenceHandler in interface StoreManagerpublic ValueGenerationManager getValueGenerationManager()
StoreManager
getValueGenerationManager in interface StoreManagerpublic StoreManagerRuntime getRuntimeManager()
StoreManager
getRuntimeManager in interface StoreManagerpublic java.lang.String getStoreManagerKey()
StoreManager
getStoreManagerKey in interface StoreManagerpublic java.lang.String getQueryCacheKey()
StoreManager
getQueryCacheKey in interface StoreManager
public java.lang.Object getStrategyValue(ExecutionContext ec,
AbstractClassMetaData cmd,
int absoluteFieldNumber)
StoreManager
getStrategyValue in interface StoreManagerec - execution contextcmd - AbstractClassMetaData for the classabsoluteFieldNumber - The field number
public java.util.HashSet getSubClassesForClass(java.lang.String className,
boolean includeDescendents,
ClassLoaderResolver clr)
StoreManager
getSubClassesForClass in interface StoreManagerclassName - Class for which we search for subclasses.includeDescendents - Whether to include subclasses of subclasses etcclr - The ClassLoaderResolver
public boolean isStrategyDatastoreAttributed(IdentityStrategy identityStrategy,
boolean datastoreIdentityField)
StoreManager
isStrategyDatastoreAttributed in interface StoreManageridentityStrategy - the identityStrategydatastoreIdentityField - Whether this is for the surrogate datastore identity field
public java.lang.String manageClassForIdentity(java.lang.Object id,
ClassLoaderResolver clr)
StoreManager
manageClassForIdentity in interface StoreManagerid - OIDclr - ClassLoader resolver
public boolean managesClass(java.lang.String className)
StoreManager
managesClass in interface StoreManagerclassName - The name of the class
public void notifyObjectIsOutdated(ObjectProvider sm)
StoreManager
notifyObjectIsOutdated in interface StoreManager
public void printInformation(java.lang.String category,
java.io.PrintStream ps)
throws java.lang.Exception
StoreManager
printInformation in interface StoreManagercategory - Category of informationps - PrintStream
java.lang.Exception - Thrown if an error occurs in the output process
public void performVersionCheck(ObjectProvider sm,
java.lang.Object versionDatastore,
VersionMetaData versionMetaData)
StoreManager
performVersionCheck in interface StoreManagersm - StateManager of the object to checkversionDatastore - Version of the object in the datastoreversionMetaData - VersionMetaData to use for checkingpublic void removeAllClasses(ClassLoaderResolver clr)
StoreManager
removeAllClasses in interface StoreManagerclr - The ClassLoaderResolverpublic boolean supportsQueryLanguage(java.lang.String language)
StoreManager
supportsQueryLanguage in interface StoreManagerlanguage - The language
public boolean supportsValueStrategy(java.lang.String language)
StoreManager
supportsValueStrategy in interface StoreManagerlanguage - The strategy
public java.util.Collection getSupportedOptions()
StoreManager
getSupportedOptions in interface StoreManagerpublic ConnectionManager getConnectionManager()
StoreManager
getConnectionManager in interface StoreManagerpublic ManagedConnection getConnection(ExecutionContext ec)
StoreManagerIf there is an active transaction, a connection from the transactional connection factory will be returned. If there is no active transaction, a connection from the nontransactional connection factory will be returned.
getConnection in interface StoreManagerec - execution context
public ManagedConnection getConnection(ExecutionContext ec,
java.util.Map options)
StoreManagerIf there is an active transaction, a connection from the transactional connection factory will be returned. If there is no active transaction, a connection from the nontransactional connection factory will be returned.
getConnection in interface StoreManagerec - execution contextoptions - connetion options
public java.lang.String getConnectionDriverName()
StoreManager
getConnectionDriverName in interface StoreManagerpublic java.lang.String getConnectionURL()
StoreManager
getConnectionURL in interface StoreManagerpublic java.lang.String getConnectionUserName()
StoreManager
getConnectionUserName in interface StoreManagerpublic java.lang.String getConnectionPassword()
StoreManager
getConnectionPassword in interface StoreManagerpublic java.lang.Object getConnectionFactory()
StoreManager
getConnectionFactory in interface StoreManagerpublic java.lang.Object getConnectionFactory2()
StoreManager
getConnectionFactory2 in interface StoreManagerpublic java.lang.String getConnectionFactory2Name()
StoreManager
getConnectionFactory2Name in interface StoreManagerpublic java.lang.String getConnectionFactoryName()
StoreManager
getConnectionFactoryName in interface StoreManagerpublic void transactionStarted(ExecutionContext ec)
StoreManager
transactionStarted in interface StoreManagerec - ExecutionContextpublic void transactionCommitted(ExecutionContext ec)
StoreManager
transactionCommitted in interface StoreManagerec - ExecutionContextpublic void transactionRolledBack(ExecutionContext ec)
StoreManager
transactionRolledBack in interface StoreManagerec - ExecutionContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||