org.datanucleus
Class OMFContext

java.lang.Object
  extended by org.datanucleus.OMFContext

public class OMFContext
extends java.lang.Object

Represents the context of an ObjectManagerFactory, holding state information and components that it needs to perform its task.


Field Summary
static int CONTEXT_ENHANCE
           
static int CONTEXT_PERSISTENCE
           
protected static Localiser LOCALISER
          Localisation of messages.
 
Constructor Summary
OMFContext(PersistenceConfiguration persistenceConfig)
          Constructor for the context.
OMFContext(PersistenceConfiguration persistenceConfig, int context)
          Constructor for the context.
 
Method Summary
 void addObjectManagerListener(ObjectManager.ObjectManagerListener listener)
          Register a new Listener for ObjectManager's events
 void close()
          Clear out resources
 java.lang.String getApi()
          Accessor for the API name.
 ApiAdapter getApiAdapter()
          Accessor for the ApiAdapter
 ClassLoaderResolver getClassLoaderResolver(java.lang.ClassLoader primaryLoader)
          Accessor for a ClassLoaderResolver to use in resolving classes.
 ConnectionFactoryRegistry getConnectionFactoryRegistry()
           
 ConnectionManager getConnectionManager()
           
 int getContext()
           
 java.lang.Class getDatastoreIdentityClass()
          Accessor for the class to use for datastore identity.
 java.lang.String getDomainName()
          Domain name for this configuration/instance
 ImplementationCreator getImplementationCreator()
          Accessor for the implementation creator for this context.
 java.lang.String getInstanceName()
          Instance name for this instance
 javax.transaction.TransactionManager getJtaTransactionManager()
          Accessor for the JTA transaction manager (if using JTA).
 ManagementManager getManagement()
          Accessor for the management manager (if required).
 MetaDataManager getMetaDataManager()
          Accessor for the Meta-Data Manager.
 ObjectManager.ObjectManagerListener[] getObjectManagerListeners()
          Object the array of registered ObjectManagerListener's
 PersistenceConfiguration getPersistenceConfiguration()
          Accessor for the persistence onfiguration.
 PluginManager getPluginManager()
          Accessor for the Plugin Manager
 QueryManager getQueryManager()
          Accessor to the QueryManager
 StoreManager getStoreManager()
          Accessor for the StoreManager
 TransactionManager getTransactionManager()
          Accessor for the transaction manager.
 TypeManager getTypeManager()
          Accessor for the Type Manager
 void removeObjectManagerListener(ObjectManager.ObjectManagerListener listener)
          Unregister a Listener from ObjectManager's events
 void setApi(java.lang.String name)
          Configure the API to be used
 void setConnectionManager(ConnectionManager connmgr)
           
 void setStoreManager(StoreManager storeMgr)
          Mutator for the store manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER
Localisation of messages.


CONTEXT_PERSISTENCE

public static final int CONTEXT_PERSISTENCE
See Also:
Constant Field Values

CONTEXT_ENHANCE

public static final int CONTEXT_ENHANCE
See Also:
Constant Field Values
Constructor Detail

OMFContext

public OMFContext(PersistenceConfiguration persistenceConfig)
Constructor for the context.

Parameters:
persistenceConfig - The persistence configuration

OMFContext

public OMFContext(PersistenceConfiguration persistenceConfig,
                  int context)
Constructor for the context.

Parameters:
persistenceConfig - The persistence configuration
context - The context we are operating in
Method Detail

getContext

public int getContext()

getInstanceName

public java.lang.String getInstanceName()
Instance name for this instance

Returns:
Instance name

getDomainName

public java.lang.String getDomainName()
Domain name for this configuration/instance

Returns:
Domain name

close

public void close()
Clear out resources


getDatastoreIdentityClass

public java.lang.Class getDatastoreIdentityClass()
Accessor for the class to use for datastore identity.

Returns:
Class for datastore-identity

getManagement

public ManagementManager getManagement()
Accessor for the management manager (if required). If the user has set the persistence property "datanucleus.managedRuntime" to true then this will return a management manager.

Returns:
The management manager

getClassLoaderResolver

public ClassLoaderResolver getClassLoaderResolver(java.lang.ClassLoader primaryLoader)
Accessor for a ClassLoaderResolver to use in resolving classes.

Parameters:
primaryLoader - Loader to use as the primary loader.
Returns:
The ClassLoader resolver

getImplementationCreator

public ImplementationCreator getImplementationCreator()
Accessor for the implementation creator for this context.

Returns:
The implementation creator

getMetaDataManager

public MetaDataManager getMetaDataManager()
Accessor for the Meta-Data Manager.

Returns:
Returns the MetaDataManager.

getPersistenceConfiguration

public PersistenceConfiguration getPersistenceConfiguration()
Accessor for the persistence onfiguration.

Returns:
Returns the persistence configuration.

getPluginManager

public PluginManager getPluginManager()
Accessor for the Plugin Manager

Returns:
the PluginManager

getTypeManager

public TypeManager getTypeManager()
Accessor for the Type Manager

Returns:
the TypeManager

getTransactionManager

public TransactionManager getTransactionManager()
Accessor for the transaction manager.

Returns:
The transaction manager.

getJtaTransactionManager

public javax.transaction.TransactionManager getJtaTransactionManager()
Accessor for the JTA transaction manager (if using JTA).

Returns:
the JTA Transaction Manager

getStoreManager

public StoreManager getStoreManager()
Accessor for the StoreManager

Returns:
the StoreManager

setStoreManager

public void setStoreManager(StoreManager storeMgr)
Mutator for the store manager. Can only be set once.

Parameters:
storeMgr - The store manager

getApiAdapter

public ApiAdapter getApiAdapter()
Accessor for the ApiAdapter

Returns:
the ApiAdapter

getApi

public java.lang.String getApi()
Accessor for the API name.

Returns:
the api

setApi

public void setApi(java.lang.String name)
Configure the API to be used

Parameters:
name - the API name

getConnectionFactoryRegistry

public ConnectionFactoryRegistry getConnectionFactoryRegistry()

getConnectionManager

public ConnectionManager getConnectionManager()

setConnectionManager

public void setConnectionManager(ConnectionManager connmgr)

getObjectManagerListeners

public ObjectManager.ObjectManagerListener[] getObjectManagerListeners()
Object the array of registered ObjectManagerListener's

Returns:
array of ObjectManager.ObjectManagerListener

addObjectManagerListener

public void addObjectManagerListener(ObjectManager.ObjectManagerListener listener)
Register a new Listener for ObjectManager's events

Parameters:
listener - the listener to register

removeObjectManagerListener

public void removeObjectManagerListener(ObjectManager.ObjectManagerListener listener)
Unregister a Listener from ObjectManager's events

Parameters:
listener - the listener to unregister

getQueryManager

public QueryManager getQueryManager()
Accessor to the QueryManager

Returns:
the QueryManager


Copyright © 2009. All Rights Reserved.