org.objectweb.speedo.pm.api
Interface POManagerItf

All Superinterfaces:
javax.transaction.Synchronization
All Known Subinterfaces:
EJBPOManagerItf, JDOPOManagerItf
All Known Implementing Classes:
AbstractPOManager, EJBPOManager, JDOPOManager

public interface POManagerItf
extends javax.transaction.Synchronization

defines a manager of persistent instance. A POManagerItf is a javax.transaction.Synchronization for the JTA integration. This permits to support the container transaction demarcation. On the beforeCompletion method the perseus transaction is prepared. A po manager used a TransactionalPersistenceManager for managing the concurrency, the loading and the caching aspects.

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

Method Summary
 void addUse()
          Signal to the persistence maneger that it is used.
 void closePOManager()
          Close the POM
 org.objectweb.jorm.naming.api.PName decodeIdentifier(java.lang.Class aClass, java.lang.Object s)
           
 java.lang.Object getConnectionSpec()
           
 java.lang.Object getEncodedPName(PersistentObjectItf po)
          Encodes a PName into a serializable representation which could be decoded later.
 POManagerFactoryItf getPOManagerFactory()
           
 org.objectweb.perseus.concurrency.lib.Semaphore getSemaphore()
          Retrieves the semaphore object permiting the multithreading mode.
 TransactionItf getSpeedoTransaction()
           
 TransactionalPersistenceManager getTransactionalPersistenceManager()
          Retrieves the TransactionalPersistenceManager used by this POManagerItf.
 boolean isPOMClosed()
           
 void open(java.lang.Object connectionSpec)
          Opens the persistent manager.
 java.lang.Object speedoAttachCopy(java.lang.Object detached, java.util.Map map)
           
 void speedoDeletePersistent(java.lang.Object o)
          Delete persistent a PersistentObjectItf.
 void speedoDeletePersistent(java.lang.Object oid, java.lang.Class pc)
           
 void speedoDeletePersistentAll(java.lang.Object[] o)
           
 java.lang.Object speedoDetachCopy(PersistentObjectItf sp, java.util.Map map, java.util.Collection fgHints)
           
 FetchPlanItf speedoGetFetchPlan()
           
 java.lang.Object speedoGetObject(org.objectweb.jorm.naming.api.PName pn, boolean validate)
           
 java.lang.Object speedoMakePersistent(PersistentObjectItf sp, java.util.Map map)
          Make persistent a PersistentObjectItf.
 void speedoRefresh(PersistentObjectItf sp, java.util.Map map, java.util.Collection fgHints)
           
 void speedoRetrieve(PersistentObjectItf sp, java.util.Map map, java.util.Collection fgHints)
           
 
Methods inherited from interface javax.transaction.Synchronization
afterCompletion, beforeCompletion
 

Method Detail

getTransactionalPersistenceManager

TransactionalPersistenceManager getTransactionalPersistenceManager()
Retrieves the TransactionalPersistenceManager used by this POManagerItf.


open

void open(java.lang.Object connectionSpec)
Opens the persistent manager. This operation is the opposite of the javax.jdo.PersistenceManager.close() method. It prepares a POManagerItf to be used. During the preparation, the optimistic and multithread modes are initialized.

Parameters:
connectionSpec - is the information to access to the data store (user, password, ...)

getConnectionSpec

java.lang.Object getConnectionSpec()
Returns:
the connection information to access the data store

addUse

void addUse()
Signal to the persistence maneger that it is used. A persistence managed can be used by several thread. In this case each thread have done a PersistenceManagerFactory.getPersistentceManager() to obtain a po manager instance. The threads will do a close() operation, but only the last has to be taken in account. This method permits to knwon how many users uses the current pomanager.


getSemaphore

org.objectweb.perseus.concurrency.lib.Semaphore getSemaphore()
Retrieves the semaphore object permiting the multithreading mode.


getSpeedoTransaction

TransactionItf getSpeedoTransaction()
Returns:
the unique transaction associate to the POM.

closePOManager

void closePOManager()
Close the POM


isPOMClosed

boolean isPOMClosed()
Returns:
true if the POM is closed, otherwise false.

getPOManagerFactory

POManagerFactoryItf getPOManagerFactory()
Returns:
the factory of this POM.

getEncodedPName

java.lang.Object getEncodedPName(PersistentObjectItf po)
Encodes a PName into a serializable representation which could be decoded later. The representation depends on the PName structure.

Parameters:
po - is a persistent object

decodeIdentifier

org.objectweb.jorm.naming.api.PName decodeIdentifier(java.lang.Class aClass,
                                                     java.lang.Object s)

speedoMakePersistent

java.lang.Object speedoMakePersistent(PersistentObjectItf sp,
                                      java.util.Map map)
Make persistent a PersistentObjectItf. This method does the same thing than the PersistenceManager.makePersistent(Object) method except the call to the bind to the POManagerItf to the current thread.

Parameters:
sp - is the instance to make persistent.
map - is the context of the attachment process if any. If no attachment, it is null.
Returns:
TODO

speedoDeletePersistent

void speedoDeletePersistent(java.lang.Object o)
Delete persistent a PersistentObjectItf. This method does the same thing than the PersistenceManager.deletePersistent(Object) method except the call to the bind to the POManagerItf to the current thread.

Parameters:
o - is the instance to make persistent.

speedoDeletePersistentAll

void speedoDeletePersistentAll(java.lang.Object[] o)

speedoDeletePersistent

void speedoDeletePersistent(java.lang.Object oid,
                            java.lang.Class pc)

speedoGetObject

java.lang.Object speedoGetObject(org.objectweb.jorm.naming.api.PName pn,
                                 boolean validate)

speedoDetachCopy

java.lang.Object speedoDetachCopy(PersistentObjectItf sp,
                                  java.util.Map map,
                                  java.util.Collection fgHints)

speedoAttachCopy

java.lang.Object speedoAttachCopy(java.lang.Object detached,
                                  java.util.Map map)

speedoRefresh

void speedoRefresh(PersistentObjectItf sp,
                   java.util.Map map,
                   java.util.Collection fgHints)

speedoRetrieve

void speedoRetrieve(PersistentObjectItf sp,
                    java.util.Map map,
                    java.util.Collection fgHints)

speedoGetFetchPlan

FetchPlanItf speedoGetFetchPlan()