org.objectweb.speedo
Class AbstractSpeedo

java.lang.Object
  extended by org.objectweb.speedo.AbstractSpeedo
All Implemented Interfaces:
SpeedoProperties, POManagerFactoryItf
Direct Known Subclasses:
EJBSpeedo, JDOSpeedo

public abstract class AbstractSpeedo
extends java.lang.Object
implements POManagerFactoryItf, SpeedoProperties

This class is a client helper which permits to create a new speedo instance. Due to the personality constraint the POManagerFactoryItf implementation must have a public empty contructor. But the use of the fractal components (www.objectweb.org/fractal) needs to use a fractal implementation (Julia) to initialize the speedo component. This class is an implementation of the POManagerFactoryItf interface which delegates all calls on a delegate, the real component. This class is responsible of the Speedo configuration from a set of property specified by a Map (String optionName, Object value). Configuring Speedo means to assign parameter to some components or maybe change the architecture of Speedo (change some component). This class must be subclassed for each personality of Speedo.

Author:
S.Chassande-Barrioz

Field Summary
static java.lang.String COMPOSITE_TPM_PATH
           
static java.lang.String CONNECTION_POOL_PATH
           
protected  POManagerFactoryItf delegate
          The persistence manager factory delegate
static java.lang.String DEPENDENCY_GRAPH_PATH
           
static java.lang.String HTML_JMX_AGENT_PATH
           
protected  boolean isPropertiesInitialized
           
static java.lang.String JMX_AGENT_PATH
           
protected  boolean jmxOn
           
static java.lang.String JORM_FACTORY_PATH
           
protected  org.objectweb.util.monolog.api.Logger logger
           
static java.lang.String MEMORY_CACHE_PATH
           
static java.lang.String MIM_PATH
           
static java.lang.String MONOLOG_FACTORY_PATH
           
static java.lang.String PM_POOL_PATH
           
static java.lang.String PMF_PATH
           
static java.lang.String PMI_PATH
           
static java.lang.String PRIMITIVE_MAPPER_PATH
           
static java.lang.String QUERY_CACHE_PATH
           
static java.lang.String QUERY_MANAGER
           
protected  Component speedo
           
static java.lang.String TPM_PATH
           
 
Fields inherited from interface org.objectweb.speedo.api.SpeedoProperties
CACHE_AUTO_CLEAN_SIZE, CACHE_AUTO_CLEAN_THRESHOLD, CACHE_CLASS_POLICY, CACHE_CLASS_POLICY_ALL, CACHE_CLASS_POLICY_CACHED, CACHE_CLASS_POLICY_FIXED, CACHE_CLASS_POLICY_NOCACHE, CACHE_REPLCAEMENT, CACHE_REPLCAEMENT_FIFO, CACHE_REPLCAEMENT_LRU, CACHE_REPLCAEMENT_MRU, CACHE_SIZE, CASCADE_DELETE, COMPILED_QUERY_CACHE_AUTO_CLEAN_SIZE, COMPILED_QUERY_CACHE_AUTO_CLEAN_THRESHOLD, COMPILED_QUERY_CACHE_POLICY, COMPILED_QUERY_CACHE_SIZE, CONNECTION, CONNECTION_CHECK, CONNECTION_DRIVER_NAME, CONNECTION_FACTORY, CONNECTION_FACTORY_NAME, CONNECTION_PASSWORD, CONNECTION_POOL_INACTIVETTL, CONNECTION_POOL_MAX, CONNECTION_POOL_MIN, CONNECTION_POOL_TIMEOUT, CONNECTION_POOL_TTL, CONNECTION_URL, CONNECTION_USER_NAME, CONNECTION2_FACTORY, CONNECTION2_FACTORY_NAME, DB_TRANSACTION_LOCKING, DEBUG, ELEMENT, ELEMENT_TYPE, EXTENSION_CLASS_IDX, EXTENSION_COLLECTION_IDX, EXTENSION_FIELD_IDX, EXTENSION_JDO_IDX, EXTENSION_MAP_IDX, EXTENSION_PACKAGE_IDX, FIELD_CONVERTER, ID, ID_LONG, ID_OLONG, ID_POLYMORPH_2L, ID_SEQUENCE, IMRICATED_PM_ALLOWED, INDEX, INDEX_TYPE, INHERITANCE_FILTER, INHERITANCE_FILTERED_MAPPING, INHERITANCE_HORIZONTAL_MAPPING, INHERITANCE_KEY, INHERITANCE_MAPPING, INHERITANCE_VERTICAL_MAPPING, JDO_OPTION_APPLICATION_IDENTITY, JDO_OPTION_ARRAY, JDO_OPTION_ARRAY_LIST, JDO_OPTION_CHANGE_APPLICATION_IDENTITY, JDO_OPTION_CONNECTION_DRIVER_NAME, JDO_OPTION_CONNECTION_DRIVER_NAME_OLD, JDO_OPTION_CONNECTION_DRIVER_NAME_OLD2, JDO_OPTION_CONNECTION_FACTORY_NAME, JDO_OPTION_CONNECTION_FACTORY2_NAME, JDO_OPTION_CONNECTION_PASSWORD, JDO_OPTION_CONNECTION_URL, JDO_OPTION_CONNECTION_USER_NAME, JDO_OPTION_DATASTORE_IDENTITY, JDO_OPTION_HASH_MAP, JDO_OPTION_HASH_TABLE, JDO_OPTION_IGNORE_CACHE, JDO_OPTION_LINKED_LIST, JDO_OPTION_LIST, JDO_OPTION_MAP, JDO_OPTION_MAPPING, JDO_OPTION_MULTITREADED, JDO_OPTION_NON_DURABLE_IDENTITY, JDO_OPTION_NON_TRANSACTIONAL_READ, JDO_OPTION_NON_TRANSACTIONAL_WRITE, JDO_OPTION_NULL_COLLECTION, JDO_OPTION_OPTIMISTIC, JDO_OPTION_RESTORE_VALUES, JDO_OPTION_RETAIN_VALUES, JDO_OPTION_TRANSIENT_TRANSACTIONAL, JDO_OPTION_TREE_MAP, JDO_OPTION_TREE_SET, JDO_OPTION_VECTOR, JDO_PERSISTENCE_MANAGER_FACTORY_CLASS, JDO_QUERY_JDOQL, JMX, JMX_HTTP_DEFAULT_HOST, JMX_HTTP_HOST, JMX_HTTP_PORT, JOIN_TABLE, KEY_FIELD, MANAGED, MAPPER_NAME, MAPPING_STRUCTURE, MAPPING_STRUCTURE_CIR, MAPPING_STRUCTURE_DD, MAPPING_STRUCTURE_DN, MAPPING_STRUCTURE_FC, NO_LIMIT, PM_POOL_INACTIVETTL, PM_POOL_MAX, PM_POOL_MIN, PM_POOL_TIMEOUT, PM_POOL_TTL, PREFETCH, PREFETCH_ON_EXTENT, PREFETCH_ON_GENCLASS, PREFETCH_ON_QUERY, REVERSE_FIELD, SCALE, SHAREABLE, SIZE, SOURCE_FK, SPEEDO, SPEEDO_TRANSACTION_LOCKING, SQL_NAME, SQL_SEQ_ALLOCATOR, SQL_SEQ_CACHE, SQL_SEQ_INC, SQL_SEQ_NAME, SQL_SEQ_START, SQL_TYPE, SUPPORTED_EXTENSION, TARGET_FK, TM_NAME, TM_NAME_OLD, TRANSACTION_BMODE_NORMAL, TRANSACTION_BMODE_REQUIRED, TRANSACTION_BMODE_UT, TRANSACTION_FILTERS, TRANSACTION_LOCKING, TRANSACTION_LOCKING_LEVEL, TRANSACTION_LOCKING_LEVEL_ENABLETHIN, TRANSACTION_LOCKING_LEVEL_FIELD, TRANSACTION_LOCKING_LEVEL_INSTANCE, TRANSACTION_LOCKING_PESSIMISTIC_POLICY, TRANSACTION_LOCKING_PESSIMISTIC_POLICY_MUTEX, TRANSACTION_LOCKING_PESSIMISTIC_POLICY_RW_FIFO, TRANSACTION_MODE, TRANSACTION_MODE_NORMAL, TRANSACTION_MODE_REQUIRED, TRANSACTION_MODE_UT, TX_LISTENER, USER_CACHE, USER_CACHE_CLASS_POLICY, VENDOR_NAME
 
Constructor Summary
AbstractSpeedo()
           
AbstractSpeedo(java.util.Map props)
          It creates and initializes a real POManagerFactory with Julia (Fractal implementation).
 
Method Summary
protected  void applyProperties(java.util.Map props, java.util.Map pmfProps)
           
 void bindPM2Thread(POManagerItf pm)
          Ask to the PMS to bind a particular PM to the Thread.
 void clean()
          Clean the POManagerFactory: - it enables to forget all persistent classes previously loaded.
protected  void configure(java.util.Map pmfProps)
           
 java.lang.Object getConcurrencyManagerComponent()
           
 POManagerFactoryItf getDelegate()
           
 org.objectweb.perseus.dependency.api.DependencyGraph getDependencyGraph()
           
static byte getMappingStructure(java.lang.String strval)
           
static java.lang.String getMappingStructureString(byte b)
           
 java.util.Collection getMemoryCacheEntries()
           
abstract  Personality getPersonality()
           
 POManagerFactoryItf getPMFComponent()
           
 POManagerItf getPOManager()
           
 java.util.Properties getProperties()
           
protected  java.lang.String getProperty(java.util.Map m, java.lang.String propName, java.lang.String defaultValue, boolean remove)
           
 QueryManager getQueryManager()
          Get the query manager.
 SequenceManager getSequenceManager()
          Get the sequence manager associated to the pmf.
protected  Component getSpeedoComponent(java.util.Map props)
           
 void init(java.util.Map pmfProps)
           
protected abstract  boolean isOptimisticTransaction(java.util.Map props)
           
 POManagerItf lookup()
          Finds in the associated POManagerSwitchItf a POManagerItf managed by the POManagerFactoryItf.
 void poManagerClosed(POManagerItf pr)
          Indicates when a PM has been closed.
protected  boolean removeProps(java.util.Map props, java.lang.String[] wanted)
           
 void setQueryManager(QueryManager queryManager)
          Set the query manager
 void setSequenceManager(SequenceManager sequenceManager)
          Set the sequence manager.
 void stopComponent()
           
protected abstract  void throwUserException(java.lang.String msg)
           
 void unbindPM()
          It call pms.unbind(this) in order to unbind a POManagerItf managed by this POManagerFactoryItf, from the thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PM_POOL_PATH

public static final java.lang.String PM_POOL_PATH
See Also:
Constant Field Values

PMI_PATH

public static final java.lang.String PMI_PATH
See Also:
Constant Field Values

MIM_PATH

public static final java.lang.String MIM_PATH
See Also:
Constant Field Values

MEMORY_CACHE_PATH

public static final java.lang.String MEMORY_CACHE_PATH
See Also:
Constant Field Values

DEPENDENCY_GRAPH_PATH

public static final java.lang.String DEPENDENCY_GRAPH_PATH
See Also:
Constant Field Values

QUERY_CACHE_PATH

public static final java.lang.String QUERY_CACHE_PATH
See Also:
Constant Field Values

QUERY_MANAGER

public static final java.lang.String QUERY_MANAGER
See Also:
Constant Field Values

CONNECTION_POOL_PATH

public static final java.lang.String CONNECTION_POOL_PATH
See Also:
Constant Field Values

MONOLOG_FACTORY_PATH

public static final java.lang.String MONOLOG_FACTORY_PATH
See Also:
Constant Field Values

PRIMITIVE_MAPPER_PATH

public static final java.lang.String PRIMITIVE_MAPPER_PATH
See Also:
Constant Field Values

JORM_FACTORY_PATH

public static final java.lang.String JORM_FACTORY_PATH
See Also:
Constant Field Values

COMPOSITE_TPM_PATH

public static final java.lang.String COMPOSITE_TPM_PATH
See Also:
Constant Field Values

TPM_PATH

public static final java.lang.String TPM_PATH
See Also:
Constant Field Values

PMF_PATH

public static final java.lang.String PMF_PATH
See Also:
Constant Field Values

JMX_AGENT_PATH

public static final java.lang.String JMX_AGENT_PATH
See Also:
Constant Field Values

HTML_JMX_AGENT_PATH

public static final java.lang.String HTML_JMX_AGENT_PATH
See Also:
Constant Field Values

delegate

protected POManagerFactoryItf delegate
The persistence manager factory delegate


logger

protected org.objectweb.util.monolog.api.Logger logger

speedo

protected Component speedo

isPropertiesInitialized

protected boolean isPropertiesInitialized

jmxOn

protected boolean jmxOn
Constructor Detail

AbstractSpeedo

public AbstractSpeedo()

AbstractSpeedo

public AbstractSpeedo(java.util.Map props)
               throws java.lang.Throwable
It creates and initializes a real POManagerFactory with Julia (Fractal implementation).

Throws:
java.lang.Throwable
Method Detail

getPersonality

public abstract Personality getPersonality()
Specified by:
getPersonality in interface POManagerFactoryItf

throwUserException

protected abstract void throwUserException(java.lang.String msg)

isOptimisticTransaction

protected abstract boolean isOptimisticTransaction(java.util.Map props)

stopComponent

public void stopComponent()

getPMFComponent

public POManagerFactoryItf getPMFComponent()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

getConcurrencyManagerComponent

public java.lang.Object getConcurrencyManagerComponent()
                                                throws java.lang.Exception
Throws:
java.lang.Exception

getDependencyGraph

public org.objectweb.perseus.dependency.api.DependencyGraph getDependencyGraph()
                                                                        throws java.lang.Exception
Throws:
java.lang.Exception

getMemoryCacheEntries

public java.util.Collection getMemoryCacheEntries()
                                           throws java.lang.Exception
Throws:
java.lang.Exception

getDelegate

public POManagerFactoryItf getDelegate()

getPOManager

public POManagerItf getPOManager()
Specified by:
getPOManager in interface POManagerFactoryItf

lookup

public POManagerItf lookup()
Description copied from interface: POManagerFactoryItf
Finds in the associated POManagerSwitchItf a POManagerItf managed by the POManagerFactoryItf.

Specified by:
lookup in interface POManagerFactoryItf
Returns:
a POManagerItf instance or a null value.

getSequenceManager

public SequenceManager getSequenceManager()
Description copied from interface: POManagerFactoryItf
Get the sequence manager associated to the pmf.

Specified by:
getSequenceManager in interface POManagerFactoryItf

setSequenceManager

public void setSequenceManager(SequenceManager sequenceManager)
Description copied from interface: POManagerFactoryItf
Set the sequence manager.

Specified by:
setSequenceManager in interface POManagerFactoryItf

getQueryManager

public QueryManager getQueryManager()
Description copied from interface: POManagerFactoryItf
Get the query manager.

Specified by:
getQueryManager in interface POManagerFactoryItf

setQueryManager

public void setQueryManager(QueryManager queryManager)
Description copied from interface: POManagerFactoryItf
Set the query manager

Specified by:
setQueryManager in interface POManagerFactoryItf

unbindPM

public void unbindPM()
Description copied from interface: POManagerFactoryItf
It call pms.unbind(this) in order to unbind a POManagerItf managed by this POManagerFactoryItf, from the thread.

Specified by:
unbindPM in interface POManagerFactoryItf

bindPM2Thread

public void bindPM2Thread(POManagerItf pm)
Description copied from interface: POManagerFactoryItf
Ask to the PMS to bind a particular PM to the Thread.

Specified by:
bindPM2Thread in interface POManagerFactoryItf

poManagerClosed

public void poManagerClosed(POManagerItf pr)
Description copied from interface: POManagerFactoryItf
Indicates when a PM has been closed.

Specified by:
poManagerClosed in interface POManagerFactoryItf
Parameters:
pr - the closed PM.

clean

public void clean()
Description copied from interface: POManagerFactoryItf
Clean the POManagerFactory: - it enables to forget all persistent classes previously loaded.

Specified by:
clean in interface POManagerFactoryItf

getProperties

public java.util.Properties getProperties()
Specified by:
getProperties in interface POManagerFactoryItf

getSpeedoComponent

protected Component getSpeedoComponent(java.util.Map props)
                                throws java.lang.Throwable
Throws:
java.lang.Throwable

init

public void init(java.util.Map pmfProps)
          throws java.lang.Throwable
Throws:
java.lang.Throwable

configure

protected void configure(java.util.Map pmfProps)
                  throws java.lang.Throwable
Throws:
java.lang.Throwable

applyProperties

protected void applyProperties(java.util.Map props,
                               java.util.Map pmfProps)
                        throws java.lang.Throwable
Throws:
java.lang.Throwable

getProperty

protected java.lang.String getProperty(java.util.Map m,
                                       java.lang.String propName,
                                       java.lang.String defaultValue,
                                       boolean remove)

removeProps

protected boolean removeProps(java.util.Map props,
                              java.lang.String[] wanted)

getMappingStructureString

public static java.lang.String getMappingStructureString(byte b)

getMappingStructure

public static byte getMappingStructure(java.lang.String strval)