org.objectweb.speedo.pm.lib
Class AbstractPOManagerFactory

java.lang.Object
  extended by org.objectweb.speedo.pm.lib.AbstractPOManagerFactory
All Implemented Interfaces:
BindingController, POManagerFactoryItf
Direct Known Subclasses:
EJBPOManagerFactory, JDOPOManagerFactory

public abstract class AbstractPOManagerFactory
extends java.lang.Object
implements POManagerFactoryItf, BindingController

Is a factory of POManagerItf. This primitive component exports the POManagerFactoryItf interface, permitting to manage the po manager allocations. Due to a high cost of POManagerItf allocation, the unsused POManagerItf are pooled. For this reason, the AbstractManagerFactory uses a Pool of POManagerItf. The AbstractPOManagerFactory manages also the attachement of POManagerItf to the current thread through a POManagerSwitchItf.

Author:
S.Chassande-Barrioz
See Also:
POManagerItf, POManagerFactoryItf, POManagerSwitchItf

Field Summary
protected  java.lang.Object _this
          The java reference to the current component
static java.lang.String CACHE_M_BINDING
           
protected  CacheManager cacheManager
          The L2 cache containing persistent objects.
static java.lang.String COMPONENT_BINDING
           
protected  java.util.Properties connectionProperties
          The properties of the PMF
protected  ConnectionSpecFactory csf
          Information about the data store connection
protected static int GETMAXPOOL
           
protected  boolean imbricatedAuthorized
           
static java.lang.String JORM_FACTORY_BINDING
           
protected  JormFactory jormFactory
          The factory initializing JORM structure (Mapping, Binder, PNC, ...)
protected  org.objectweb.util.monolog.api.Logger logger
          Manages the log's traces
protected  Pool managedPM
          Pool of PersistenceManager
protected  org.objectweb.jorm.api.PMapper mapper
          JORM object encapsulating the datastore
static java.lang.String MAPPER_BINDING
           
protected  Personality personality
           
static java.lang.String PM_POOL_BINDING
           
protected  POManagerSwitchItf pms
          The PMS managing the association PM / thread
static java.lang.String PO_MANAGER_SWITCH_BINDING
           
static java.lang.String QUERY_M_BINDING
           
protected  QueryManager queryManager
          The query manager
static java.lang.String SEQUENCE_M_BINDING
           
protected  SequenceManager sequenceManager
          Speedo component managing the sequence (datastore or memory)
protected  boolean started
          The fractal component status
protected  TransactionalPersistenceManager tpm
          The perseus component managing concurrency, caching and persitency.
static java.lang.String TPM_BINDING
           
static java.lang.String UNBIND_M_BINDING
           
protected  UnbindManager unbindManager
          The L2 cache containing persistent objects.
 
Constructor Summary
AbstractPOManagerFactory(Personality p)
           
 
Method Summary
protected  void assertIsPO(java.lang.Object pc, java.lang.String cmd)
          Verify that an instance is persistence capable.
 void bindFc(java.lang.String s, java.lang.Object o)
           
 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.
 Personality getPersonality()
           
 Pool getPool()
           
 java.util.Properties getProperties()
          Return non-configurable properties of this POManagerFactory.
 QueryManager getQueryManager()
          Get the query manager.
 SequenceManager getSequenceManager()
          Get the sequence manager associated to the pmf.
protected  POManagerFactoryItf getThis()
           
 java.lang.String[] listFc()
           
 POManagerItf lookup()
          Finds in the associated POManagerSwitchItf a POManagerItf managed by the POManagerFactoryItf.
 java.lang.Object lookupFc(java.lang.String s)
           
 void poManagerClosed(POManagerItf pr)
          Indicates when a PM has been closed.
 void setQueryManager(QueryManager queryManager)
          Set the query manager
 void setSequenceManager(SequenceManager sequenceManager)
          Set the sequence manager.
protected  void start()
           
 void unbindFc(java.lang.String s)
           
 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
 
Methods inherited from interface org.objectweb.speedo.pm.api.POManagerFactoryItf
getPOManager
 

Field Detail

MAPPER_BINDING

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

JORM_FACTORY_BINDING

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

PM_POOL_BINDING

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

PO_MANAGER_SWITCH_BINDING

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

TPM_BINDING

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

CACHE_M_BINDING

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

UNBIND_M_BINDING

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

COMPONENT_BINDING

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

SEQUENCE_M_BINDING

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

QUERY_M_BINDING

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

GETMAXPOOL

protected static final int GETMAXPOOL
See Also:
Constant Field Values

imbricatedAuthorized

protected boolean imbricatedAuthorized

managedPM

protected Pool managedPM
Pool of PersistenceManager


logger

protected org.objectweb.util.monolog.api.Logger logger
Manages the log's traces


mapper

protected org.objectweb.jorm.api.PMapper mapper
JORM object encapsulating the datastore


connectionProperties

protected java.util.Properties connectionProperties
The properties of the PMF


pms

protected POManagerSwitchItf pms
The PMS managing the association PM / thread


_this

protected java.lang.Object _this
The java reference to the current component


csf

protected ConnectionSpecFactory csf
Information about the data store connection


started

protected boolean started
The fractal component status


cacheManager

protected CacheManager cacheManager
The L2 cache containing persistent objects.


unbindManager

protected UnbindManager unbindManager
The L2 cache containing persistent objects.


jormFactory

protected JormFactory jormFactory
The factory initializing JORM structure (Mapping, Binder, PNC, ...)


tpm

protected TransactionalPersistenceManager tpm
The perseus component managing concurrency, caching and persitency.


queryManager

protected QueryManager queryManager
The query manager


sequenceManager

protected SequenceManager sequenceManager
Speedo component managing the sequence (datastore or memory)


personality

protected Personality personality
Constructor Detail

AbstractPOManagerFactory

public AbstractPOManagerFactory(Personality p)
Method Detail

start

protected void start()

getThis

protected POManagerFactoryItf getThis()

assertIsPO

protected void assertIsPO(java.lang.Object pc,
                          java.lang.String cmd)
Verify that an instance is persistence capable.

Parameters:
pc - the object to test.
Throws:
java.lang.RuntimeException - if the object is not persistence capable.

listFc

public java.lang.String[] listFc()
Specified by:
listFc in interface BindingController

lookupFc

public java.lang.Object lookupFc(java.lang.String s)
Specified by:
lookupFc in interface BindingController

bindFc

public void bindFc(java.lang.String s,
                   java.lang.Object o)
Specified by:
bindFc in interface BindingController

unbindFc

public void unbindFc(java.lang.String s)
Specified by:
unbindFc in interface BindingController

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.

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

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

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.

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

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

getPersonality

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

getProperties

public java.util.Properties getProperties()
Return non-configurable properties of this POManagerFactory. Properties with keys VendorName and VersionNumber are required. Other keys are optional.

Specified by:
getProperties in interface POManagerFactoryItf
Returns:
the non-configurable properties of this PersistenceManagerFactory.

getPool

public Pool getPool()
Returns:
the owned Pool