org.objectweb.perseus.concurrency.optimistic

Class OptimisticConcurrencyManager

Implemented Interfaces:
BindingController, ConcurrencyManager

public abstract class OptimisticConcurrencyManager
extends java.lang.Object
implements ConcurrencyManager, BindingController

Author:
E. Bruneton

Field Summary

static String
DEPENDENCY_GRAPH_BINDING
protected Logger
logger
protected Map
timeStamps
A map associating time stamps to all oids in all active contexts.

Constructor Summary

OptimisticConcurrencyManager()

Method Summary

void
abort(Object ctx)
This method allows to release the resources allocated in a given context.
void
begin(Object ctx)
This method records the start of an execution context.
void
bindFc(String s, Object o)
void
finalize(Object ctx)
This method marks the end of accesses made by the execution context.
protected Object
getState(Object ctx, Object resourceId, TimeStamp timeStamp, Object hints, boolean isDirtyBefore, boolean isWrite)
String[]
listFc()
Object
lookupFc(String s)
Object
readIntention(Object ctx, Object resourceId, Object hints)
void
unbindFc(String s)
boolean
validate(Object ctx)
This method requests the validation os accesses made by the context.
Object
writeIntention(Object ctx, Object resourceId, Object hints)

Field Details

DEPENDENCY_GRAPH_BINDING

public static final String DEPENDENCY_GRAPH_BINDING


logger

protected Logger logger


timeStamps

protected Map timeStamps
A map associating time stamps to all oids in all active contexts.

Constructor Details

OptimisticConcurrencyManager

public OptimisticConcurrencyManager()

Method Details

abort

public void abort(Object ctx)
This method allows to release the resources allocated in a given context. This method should be called when the validate method has returned false.
Specified by:
abort in interface ConcurrencyManager


begin

public void begin(Object ctx)
This method records the start of an execution context. It can be a transaction starting.
Specified by:
begin in interface ConcurrencyManager

Parameters:
ctx - is the context


bindFc

public void bindFc(String s,
                   Object o)


finalize

public void finalize(Object ctx)
This method marks the end of accesses made by the execution context. This method should be called when the validate method has returned true.
Specified by:
finalize in interface ConcurrencyManager


getState

protected Object getState(Object ctx,
                          Object resourceId,
                          TimeStamp timeStamp,
                          Object hints,
                          boolean isDirtyBefore,
                          boolean isWrite)
            throws ConcurrencyException

Parameters:
ctx - is the context using the resource
resourceId - is the resource identifier
timeStamp - is the TimeStamp instance matching the resource
hints - uses to give information on access
isDirtyBefore - indicates if the object was already dirty before the access.
isWrite - indicates if the access is a write access

Returns:
the resource state to use

Throws:
ConcurrencyException - it is not possible to create a State for this resource identifier. One reason can the unavailibity of the resource.


listFc

public String[] listFc()


lookupFc

public Object lookupFc(String s)


readIntention

public Object readIntention(Object ctx,
                            Object resourceId,
                            Object hints)
            throws ConcurrencyException
Specified by:
readIntention in interface ConcurrencyManager

Returns:
the TimeStamp.


unbindFc

public void unbindFc(String s)


validate

public boolean validate(Object ctx)
This method requests the validation os accesses made by the context. It retrieves a boolean value to indicate if the accesses are validate or not.
Specified by:
validate in interface ConcurrencyManager


writeIntention

public Object writeIntention(Object ctx,
                             Object resourceId,
                             Object hints)
            throws ConcurrencyException
Specified by:
writeIntention in interface ConcurrencyManager

Returns:
the TimeStamp.


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