org.objectweb.speedo.mim.lib
Class SpeedoMemoryInstanceManager

java.lang.Object
  extended byorg.objectweb.speedo.mim.lib.SpeedoMemoryInstanceManager
All Implemented Interfaces:
MemoryInstanceManagerAttribute

public class SpeedoMemoryInstanceManager
extends java.lang.Object
implements MemoryInstanceManagerAttribute

This class is an implementation of the MemoryInstanceManager provided by the persistence framwork availlable in perseus. This implementation depends on the identifier used, and the way to instanciate user objects. This implementation supports only the jorm object identifier: PName. This implementation supports also the instanciation of the Jorm generic class. To do this it is needed to specify for each jorm generic class used the name of the class which must be instanciated. This configuration is done via the GenClassNames attribute. This implementation does not used a pool, then the instance are created at each newInstance call.

Author:
S.Chassande-Barrioz

Field Summary
protected  JormFactory jf
           
static java.lang.String JORM_FACTORY_BINDING
           
protected  Logger logger
           
protected  ProxyManagerFactory pmf
           
static java.lang.String PMS_BINDING
           
 
Constructor Summary
SpeedoMemoryInstanceManager()
           
 
Method Summary
 void bindFc(java.lang.String s, java.lang.Object o)
           
 FixableCacheEntry create(java.lang.Object id, java.lang.Object obj)
          binds the SpeedoProxy to its identifier (PName) if it does not have already one.
 State createState(CacheEntry ce)
           
 void destroyState(State state)
           
 void entryBound(CacheEvent event)
           
 void entryUnbound(CacheEvent event)
           
 java.lang.String getGenClassNames()
           
 State getReferenceState(CacheEntry ce)
           
 boolean isBound(CacheEntry ce)
           
 boolean isDirty(State state)
           
 boolean isExported(State state)
           
 boolean isFlushed(State state)
           
 boolean isToMerge(State state)
           
 boolean isUnexported(State state)
           
 java.lang.String[] listFc()
           
 java.lang.Object lookupFc(java.lang.String s)
           
 void makeBound(CacheEntry ce, java.lang.Object oid)
           
 void makeClean(State state)
           
 void makeDirty(State state)
           
 void makeExported(State state)
           
 void makeFlushed(State state)
           
 void makeToMerge(State state, java.lang.Object thinLock)
           
 void makeUnbound(CacheEntry ce)
           
 void makeUnexported(State state)
           
 State merge(State oldState, State newState)
           
 java.lang.Object newInstance(java.lang.Object oid, ConnectionHolder context)
          It creates an instance since an identifier
 void setGenClassNames(java.lang.String gcname)
          It assignes a description of the gen class names.
 void setReferenceState(CacheEntry ce, State state)
           
 void stateNoMoreUsed(State state)
           
 void unbindFc(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JORM_FACTORY_BINDING

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

PMS_BINDING

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

jf

protected JormFactory jf

pmf

protected ProxyManagerFactory pmf

logger

protected Logger logger
Constructor Detail

SpeedoMemoryInstanceManager

public SpeedoMemoryInstanceManager()
Method Detail

listFc

public java.lang.String[] listFc()

lookupFc

public java.lang.Object lookupFc(java.lang.String s)

bindFc

public void bindFc(java.lang.String s,
                   java.lang.Object o)

unbindFc

public void unbindFc(java.lang.String s)

getGenClassNames

public java.lang.String getGenClassNames()
Specified by:
getGenClassNames in interface MemoryInstanceManagerAttribute
Returns:
a String describing the genclass names with the following format: "(jorm_name,java_name),(jorm_name,java_name),(jorm_name,java_name)}"

setGenClassNames

public void setGenClassNames(java.lang.String gcname)
It assignes a description of the gen class names.

Specified by:
setGenClassNames in interface MemoryInstanceManagerAttribute
Parameters:
gcname - is the desciption which must follow this format: "(jorm_name,java_name),(jorm_name,java_name),(jorm_name,java_name)}"

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
Returns:
a memory instance
Throws:
PersistenceException

createState

public State createState(CacheEntry ce)

getReferenceState

public State getReferenceState(CacheEntry ce)

destroyState

public void destroyState(State state)

makeUnexported

public void makeUnexported(State state)

isUnexported

public boolean isUnexported(State state)

makeExported

public void makeExported(State state)

isExported

public boolean isExported(State state)

makeDirty

public void makeDirty(State state)

isDirty

public boolean isDirty(State state)

setReferenceState

public void setReferenceState(CacheEntry ce,
                              State state)

makeClean

public void makeClean(State state)

makeFlushed

public void makeFlushed(State state)

isFlushed

public boolean isFlushed(State state)

makeUnbound

public void makeUnbound(CacheEntry ce)

makeBound

public void makeBound(CacheEntry ce,
                      java.lang.Object oid)

isBound

public boolean isBound(CacheEntry ce)

isToMerge

public boolean isToMerge(State state)

makeToMerge

public void makeToMerge(State state,
                        java.lang.Object thinLock)

merge

public State merge(State oldState,
                   State newState)

stateNoMoreUsed

public void stateNoMoreUsed(State state)

entryBound

public void entryBound(CacheEvent event)
Parameters:
event -

entryUnbound

public void entryUnbound(CacheEvent event)
Parameters:
event -

create

public FixableCacheEntry create(java.lang.Object id,
                                java.lang.Object obj)
binds the SpeedoProxy to its identifier (PName) if it does not have already one.

Parameters:
id - is the PName of the SpeedoProxy
obj - is the SpeedoProxy instance added into the cache
Returns:
the SpeedoProxy instance