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
          Enhancement context.
static int CONTEXT_PERSISTENCE
          Persistence context.
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.
 int getContext()
           
 java.lang.Class getDatastoreIdentityClass()
          Accessor for the class to use for datastore identity.
 IdentityTranslator getIdentityTranslator()
          Accessor for the current identity translator to use (if any).
 ImplementationCreator getImplementationCreator()
          Accessor for the implementation creator for this context.
 ManagementManager getJMXManager()
          Accessor for the JMX manager (if required).
 javax.transaction.TransactionManager getJtaTransactionManager()
          Accessor for the JTA transaction manager (if using JTA).
 MetaDataManager getMetaDataManager()
          Accessor for the Meta-Data Manager.
 ObjectManager.ObjectManagerListener[] getObjectManagerListeners()
          Object the array of registered ObjectManagerListener's
 PersistenceConfiguration getPersistenceConfiguration()
          Accessor for the persistence configuration.
 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
 boolean isJcaMode()
          Accessor for the JCA mode.
 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 setJcaMode(boolean jca)
          Mutator for whether we are in JCA mode.
 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
Persistence context.

See Also:
Constant Field Values

CONTEXT_ENHANCE

public static final int CONTEXT_ENHANCE
Enhancement context.

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 that this is used
Method Detail

getContext

public int getContext()

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

getIdentityTranslator

public IdentityTranslator getIdentityTranslator()
Accessor for the current identity translator to use (if any).

Returns:
Identity translator instance (or null if persistence property not set)

getJMXManager

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

Returns:
The JMX 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 configuration.

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

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

setJcaMode

public void setJcaMode(boolean jca)
Mutator for whether we are in JCA mode.

Parameters:
jca - true if using JCA connector

isJcaMode

public boolean isJcaMode()
Accessor for the JCA mode.

Returns:
true if using JCA connector.


Copyright © 2010. All Rights Reserved.