org.objectweb.perseus.persistence.api

Interface WorkingSet

Known Subinterfaces:
TransactionalWorkingSet
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, Y.Bersihand

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)
static byte
READ_INTENTION
The origin of the binding action.
static byte
UNKNOWN_INTENTION
static byte
WRITE_INTENTION

Method Summary

State
bind(State state, Object oid, byte mode)
Attaches an entry to the working set.
void
clear()
Removes all entries of the working set.
Set
entries()
ConnectionHolder
getConnectionHolder()
byte
getStatus()
Returns the working set's status.
Object
getUserObject()
boolean
getWSRestoreValues()
boolean
getWSRetainValues()
State
lookup(Object oid)
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 working set.

Field Details

CTX_ACTIVE

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

Field Value:
1


CTX_CLOSED

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

Field Value:
32


READ_INTENTION

public static final byte READ_INTENTION
The origin of the binding action.

Field Value:
1


UNKNOWN_INTENTION

public static final byte UNKNOWN_INTENTION

Field Value:
3


WRITE_INTENTION

public static final byte WRITE_INTENTION

Field Value:
2

Method Details

bind

public State bind(State state,
                  Object oid,
                  byte mode)
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
mode - is the origin of the binding action: read/write intention

Returns:
the value of the old state in the cache, can be null if the state was not already in the cache

See Also:
READ_INTENTION.WRITE_INTENTION.UNKNOWN_INTENTION


clear

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


entries

public Set entries()

Returns:
the list of entries attached to the working set.


getConnectionHolder

public ConnectionHolder getConnectionHolder()

Returns:
a ConnectionHolder instance permiting to acces the data support


getStatus

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

Returns:
one of the constants of the TransactionalPersistenceManager interface.


getUserObject

public Object getUserObject()

Returns:
the user object linked to the working set


getWSRestoreValues

public boolean getWSRestoreValues()


getWSRetainValues

public boolean getWSRetainValues()


lookup

public State lookup(Object oid)

Returns:
the entry attached to the working set weither its identifier


oids

public Set oids()

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.

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)


setWSRetainValues

public void setWSRetainValues(boolean val)


unbind

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


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