org.objectweb.perseus.concurrency.api
Interface ConcurrencyManager

All Known Implementing Classes:
DbDelegateConcurrencyManager, 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(java.lang.Object ctx)
          This method allows to release the resources allocated in a given context.
 void begin(java.lang.Object ctx)
          This method records the start of an execution context.
 void finalize(java.lang.Object ctx)
          This method marks the end of accesses made by the execution context.
 java.lang.Object readIntention(java.lang.Object ctx, java.lang.Object resource, java.lang.Object lockHints)
          This method records an access intention to a data object in read mode.
 boolean validate(java.lang.Object ctx)
          This method requests the validation os accesses made by the context.
 java.lang.Object writeIntention(java.lang.Object ctx, java.lang.Object resource, java.lang.Object lockHints)
          This method records an access intention to a data object in write mode.
 

Method Detail

begin

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

Parameters:
ctx - is the context

validate

public boolean validate(java.lang.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.


finalize

public void finalize(java.lang.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.


abort

public void abort(java.lang.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.


readIntention

public java.lang.Object readIntention(java.lang.Object ctx,
                                      java.lang.Object resource,
                                      java.lang.Object lockHints)
                               throws ConcurrencyException
This method records an access intention to a data object in read mode.

Parameters:
resource - is the resource or it identifier (Object used for synchronization)
ctx - is an identifier of the execution context. It can be a transaction handle.
lockHints - permit to take smaller lock than on the resource globaly
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.

writeIntention

public java.lang.Object writeIntention(java.lang.Object ctx,
                                       java.lang.Object resource,
                                       java.lang.Object lockHints)
                                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:
resource - is the resource or its identifier
ctx - is an identifier of the execution context. It can be a transaction handle.
lockHints - permit to take smaller lock than on the resource globaly
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.