org.objectweb.perseus.concurrency.api

Interface ConcurrencyManager

Known Implementing Classes:
DistributedConcurrencyManager, OptimisticConcurrencyManager, PessimisticConcurrencyManager

public interface ConcurrencyManager

This is the interface for Concurrency Control service.

Author:
Luciano Garcia-Banuelos (Luciano.Garcia@imag.fr)

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
finalize(Object ctx)
This method marks the end of accesses made by the execution context.
Object
readIntention(Object ctx, Object resourceId, Object hints)
This method records an access intention to a data object in read mode.
boolean
validate(Object ctx)
This method requests the validation os accesses made by the context.
Object
writeIntention(Object ctx, Object resourceId, Object hints)
This method records an access intention to a data object in write mode.

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.


begin

public void begin(Object ctx)
This method records the start of an execution context. It can be a transaction starting.

Parameters:
ctx - is the context


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.


readIntention

public Object readIntention(Object ctx,
                            Object resourceId,
                            Object hints)
            throws ConcurrencyException
This method records an access intention to a data object in read mode.

Parameters:
ctx - is an identifier of the execution context. It can be a transaction handle.
resourceId - is the resource identifier
hints - is an object parameter permiting to some implementation to do some action at "readIntention time".

Returns:
null or an object depending on the ConcurrencyManager type

Throws:
ConcurrencyException - if the no resource are available for this resource identifer or if there is a concurrency problem. In this last case that means the context should be cancelled.


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.


writeIntention

public Object writeIntention(Object ctx,
                             Object resourceId,
                             Object hints)
            throws ConcurrencyException
This method records an access intention to a data object in write mode. A call to the readIntention is necessary before a call to this method.

Parameters:
ctx - is an identifier of the execution context. It can be a transaction handle.
resourceId - is the resource identifier
hints - is an object parameter permiting to some implementation to do some action at "readIntention time".

Returns:
null or an object depending on the ConcurrencyManager type

Throws:
ConcurrencyException - if the no resource are available for this resource identifer or if there is a concurrency problem. In this last case that means the context should be cancelled.


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