org.objectweb.perseus.persistence.api
Interface MemoryInstanceManager


public interface MemoryInstanceManager

It defines a memory instance manager able to create memory instance since an identifier. The method releaseInstance permit to use a Pool of memory instance manager.

Author:
S.Chassande-Barrioz, P.Dechamboux

Method Summary
 boolean isObjectSharing(java.lang.Object o)
          A persistence service can offer two different models of programmation concerning the persistent java object.
 java.lang.Object newInstance(java.lang.Object oid, ConnectionHolder context)
          It creates an instance since an identifier
 

Method Detail

newInstance

public java.lang.Object newInstance(java.lang.Object oid,
                                    ConnectionHolder context)
                             throws PersistenceException
It creates an instance since an identifier

Parameters:
oid - is the identifier of the futur object
context - can be used by the naming to access to the support
Returns:
a memory instance
Throws:
PersistenceException - if an error occured during the instanciation of the memory instance.

isObjectSharing

public boolean isObjectSharing(java.lang.Object o)
A persistence service can offer two different models of programmation concerning the persistent java object. The first solution is to share the persistent java object between transactions (in parallel). In this case the persistent object has several State, one for each transaction. The second solution is to have one persistent object for each transaction. In this case each persistent object have only one state, the one used in the transaction. The first strategy permits to use the same persistent object (same java reference) in several threads/transactions. In other hand the second strategy avoids to use the cache for keeping the java reference to the persistent object if the caching strategy is no cache. This methods indicates the strategy to follow for a persistent object or its identifier.

Parameters:
o - is a persistent object or its identifier
Returns:
true for the first strategy (share persistent object between transaction), false for the second strategy (one persistent instance per transaction).
See Also:
State


Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.