org.objectweb.perseus.persistence.lib
Class BasicWorkingSet

java.lang.Object
  |
  +--org.objectweb.perseus.persistence.lib.BasicWorkingSet
All Implemented Interfaces:
TransactionalWorkingSet, WorkingSet

public class BasicWorkingSet
extends java.lang.Object
implements TransactionalWorkingSet

It is an implementation of the WorkingSet interface. This implementation is a Fractal component which needs a MonologFactory.

Author:
S.Chassande-Barrioz

Field Summary
protected  ConnectionHolder connectionHolder
           
protected  Logger logger
           
protected  java.util.LinkedHashMap oid2state
           
protected  boolean restoreValues
           
protected  boolean retainValues
           
protected  byte status
           
protected  java.lang.Object userObject
           
 
Fields inherited from interface org.objectweb.perseus.persistence.api.TransactionalWorkingSet
CTX_ABORTED, CTX_ACTIVE_TRANSACTIONAL, CTX_COMMITTED, CTX_PREPARED, CTX_PREPARED_FAIL, CTX_PREPARED_OK
 
Fields inherited from interface org.objectweb.perseus.persistence.api.WorkingSet
CTX_ACTIVE, CTX_CLOSED
 
Constructor Summary
BasicWorkingSet()
           
 
Method Summary
 void bind(State state, java.lang.Object oid)
          Attaches an entry to the transaction.
 void bindFc(java.lang.String c, java.lang.Object s)
           
 void clear()
          Removes all entries of the transaction.
 java.util.Set entries()
           
 ConnectionHolder getConnectionHolder()
           
 byte getStatus()
          Returns the working set's status.
 java.lang.Object getUserObject()
           
 boolean getWSRestoreValues()
           
 boolean getWSRetainValues()
           
 java.lang.String[] listFc()
           
 State lookup(java.lang.Object oid)
           
 java.lang.Object lookupFc(java.lang.String c)
           
 java.util.Set oids()
           
 void setStatus(byte status)
          Sets the working set's status.
 void setWSRestoreValues(boolean val)
           
 void setWSRetainValues(boolean val)
           
 boolean unbind(java.lang.Object oid)
          Dettaches an entry from the transaction.
 void unbindFc(java.lang.String c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Logger logger

oid2state

protected java.util.LinkedHashMap oid2state

status

protected byte status

userObject

protected java.lang.Object userObject

connectionHolder

protected ConnectionHolder connectionHolder

retainValues

protected boolean retainValues

restoreValues

protected boolean restoreValues
Constructor Detail

BasicWorkingSet

public BasicWorkingSet()
Method Detail

listFc

public java.lang.String[] listFc()

lookupFc

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

bindFc

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

unbindFc

public void unbindFc(java.lang.String c)

getStatus

public byte getStatus()
Description copied from interface: WorkingSet
Returns the working set's status.

Specified by:
getStatus in interface WorkingSet
Returns:
one of the constants of the TransactionalPersistenceManager interface.

setStatus

public void setStatus(byte status)
               throws PersistenceException
Description copied from interface: WorkingSet
Sets the working set's status. This setter permits also to intercept the working set life cycle.

Specified by:
setStatus in interface WorkingSet
Parameters:
status - one of the constants of the TransactionalPersistenceManager interface.
Throws:
PersistenceException - if this is a probleme in the interception of the working set life cycle.

lookup

public State lookup(java.lang.Object oid)
Specified by:
lookup in interface WorkingSet
Returns:
the entry attached to the transaction weither its identifier

bind

public void bind(State state,
                 java.lang.Object oid)
Attaches an entry to the transaction.

Specified by:
bind in interface WorkingSet
Parameters:
state - the state which must be attached to the transaction
oid - is the id of the corresponding object

unbind

public boolean unbind(java.lang.Object oid)
Dettaches an entry from the transaction.

Specified by:
unbind in interface WorkingSet
Parameters:
oid - is the identifier of entry which must be detattached from the transaction
Returns:
true if the entry was present in the working set

clear

public void clear()
Removes all entries of the transaction.

Specified by:
clear in interface WorkingSet

entries

public java.util.Set entries()
Specified by:
entries in interface WorkingSet
Returns:
the collection of entry attached to the transaction.

oids

public java.util.Set oids()
Specified by:
oids in interface WorkingSet
Returns:
the list of entries attached to the working set

getUserObject

public java.lang.Object getUserObject()
Specified by:
getUserObject in interface WorkingSet
Returns:
the user object linked to the working set

getConnectionHolder

public ConnectionHolder getConnectionHolder()
Specified by:
getConnectionHolder in interface WorkingSet
Returns:
a ConnectionHolder instance permiting to acces the data support

getWSRetainValues

public boolean getWSRetainValues()
Specified by:
getWSRetainValues in interface WorkingSet

setWSRetainValues

public void setWSRetainValues(boolean val)
Specified by:
setWSRetainValues in interface WorkingSet

getWSRestoreValues

public boolean getWSRestoreValues()
Specified by:
getWSRestoreValues in interface WorkingSet

setWSRestoreValues

public void setWSRestoreValues(boolean val)
Specified by:
setWSRestoreValues in interface WorkingSet


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