org.objectweb.perseus.persistence.api
Interface WorkingSet

All Known Subinterfaces:
TransactionalWorkingSet
All Known Implementing Classes:
BasicWorkingSet

public interface WorkingSet

It defines a context used in by the PersistenceManager. A context contains a collection of CacheEntry instances and has a status.

Author:
S.Chassande-Barrioz

Field Summary
static byte CTX_ACTIVE
          The status of a non transactional context which is not already closed.
static byte CTX_CLOSED
          The status of a cloased context (transactional or not)
 
Method Summary
 void bind(State state, java.lang.Object oid)
          Attaches an entry to the working set.
 void clear()
          Removes all entries of the working set.
 java.util.Set entries()
           
 ConnectionHolder getConnectionHolder()
           
 byte getStatus()
          Returns the working set's status.
 java.lang.Object getUserObject()
           
 boolean getWSRestoreValues()
           
 boolean getWSRetainValues()
           
 State lookup(java.lang.Object oid)
           
 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 working set.
 

Field Detail

CTX_ACTIVE

public static final byte CTX_ACTIVE
The status of a non transactional context which is not already closed.

See Also:
Constant Field Values

CTX_CLOSED

public static final byte CTX_CLOSED
The status of a cloased context (transactional or not)

See Also:
Constant Field Values
Method Detail

getStatus

public byte getStatus()
Returns the working set's status.

Returns:
one of the constants of the TransactionalPersistenceManager interface.

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.

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)
Returns:
the entry attached to the working set weither its identifier

bind

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

Parameters:
state - is the state which must be attached to the working set
oid - is the id of the corresponding object

unbind

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

Parameters:
oid - is the identifier of entry which must be detattached from the working set
Returns:
true if the entry was present in the working set

clear

public void clear()
Removes all entries of the working set.


entries

public java.util.Set entries()
Returns:
the list of entries attached to the working set.

oids

public java.util.Set oids()
Returns:
the list of entries attached to the working set

getUserObject

public java.lang.Object getUserObject()
Returns:
the user object linked to the working set

getConnectionHolder

public ConnectionHolder getConnectionHolder()
Returns:
a ConnectionHolder instance permiting to acces the data support

getWSRetainValues

public boolean getWSRetainValues()

setWSRetainValues

public void setWSRetainValues(boolean val)

getWSRestoreValues

public boolean getWSRestoreValues()

setWSRestoreValues

public void setWSRestoreValues(boolean val)


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