org.objectweb.perseus.persistence.lib

Class BasicWorkingSet

Implemented Interfaces:
BindingController, TransactionalWorkingSet, WorkingSet

public class BasicWorkingSet
extends java.lang.Object
implements TransactionalWorkingSet, BindingController

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

Author:
S.Chassande-Barrioz, Y.Bersihand

Field Summary

protected ConnectionHolder
connectionHolder
protected Logger
logger
protected LinkedHashMap
oid2state
protected boolean
restoreValues
protected boolean
retainValues
protected byte
status
protected 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, READ_INTENTION, UNKNOWN_INTENTION, WRITE_INTENTION

Constructor Summary

BasicWorkingSet()

Method Summary

State
bind(State state, Object oid, byte mode)
Attaches an entry to the transaction.
void
bindFc(String c, Object s)
void
clear()
Removes all entries of the transaction.
Set
entries()
ConnectionHolder
getConnectionHolder()
byte
getStatus()
Returns the working set's status.
Object
getUserObject()
boolean
getWSRestoreValues()
boolean
getWSRetainValues()
String[]
listFc()
State
lookup(Object oid)
Object
lookupFc(String c)
Set
oids()
void
setStatus(byte status)
Sets the working set's status.
void
setWSRestoreValues(boolean val)
void
setWSRetainValues(boolean val)
boolean
unbind(Object oid)
Dettaches an entry from the transaction.
void
unbindFc(String c)

Field Details

connectionHolder

protected ConnectionHolder connectionHolder


logger

protected Logger logger


oid2state

protected LinkedHashMap oid2state


restoreValues

protected boolean restoreValues


retainValues

protected boolean retainValues


status

protected byte status


userObject

protected Object userObject

Constructor Details

BasicWorkingSet

public BasicWorkingSet()

Method Details

bind

public State bind(State state,
                  Object oid,
                  byte mode)
Attaches an entry to the transaction.
Specified by:
bind in interface WorkingSet

Parameters:
state - the state which must be attached to the transaction
mode - see WorkingSet.READ_INTENTION WorkingSet.WRITE_INTENTION WorkingSet.UNKNOWN_INTENTION

Returns:
the old state value in the cache


bindFc

public void bindFc(String c,
                   Object s)


clear

public void clear()
Removes all entries of the transaction.
Specified by:
clear in interface WorkingSet


entries

public Set entries()
Specified by:
entries in interface WorkingSet

Returns:
the collection of entry attached to the transaction.


getConnectionHolder

public ConnectionHolder getConnectionHolder()
Specified by:
getConnectionHolder in interface WorkingSet

Returns:
a ConnectionHolder instance permiting to acces the data support


getStatus

public byte getStatus()
Returns the working set's status.
Specified by:
getStatus in interface WorkingSet

Returns:
one of the constants of the TransactionalPersistenceManager interface.


getUserObject

public Object getUserObject()
Specified by:
getUserObject in interface WorkingSet

Returns:
the user object linked to the working set


getWSRestoreValues

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


getWSRetainValues

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


listFc

public String[] listFc()


lookup

public State lookup(Object oid)
Specified by:
lookup in interface WorkingSet

Returns:
the entry attached to the transaction weither its identifier


lookupFc

public Object lookupFc(String c)


oids

public Set oids()
Specified by:
oids in interface WorkingSet

Returns:
the list of entries attached to the working set


setStatus

public void setStatus(byte status)
            throws PersistenceException
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.


setWSRestoreValues

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


setWSRetainValues

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


unbind

public boolean unbind(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


unbindFc

public void unbindFc(String c)


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