org.objectweb.perseus.concurrency.dbdelegate
Class DbDelegateConcurrencyManager

java.lang.Object
  extended byorg.objectweb.perseus.concurrency.dbdelegate.DbDelegateConcurrencyManager
All Implemented Interfaces:
ConcurrencyManager

public abstract class DbDelegateConcurrencyManager
extends java.lang.Object
implements ConcurrencyManager

Author:
P. Dechamboux

Field Summary
protected  Logger logger
           
 
Constructor Summary
DbDelegateConcurrencyManager()
           
 
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 bindFc(java.lang.String s, java.lang.Object o)
           
abstract  void finalize(java.lang.Object ctx)
          This method marks the end of accesses made by the execution context.
 java.lang.String getFcState()
           
protected abstract  java.lang.Object getState(java.lang.Object ctx, java.lang.Object resource, java.lang.Object thinLock)
           
 java.lang.String[] listFc()
           
 java.lang.Object lookupFc(java.lang.String s)
           
 java.lang.Object readIntention(java.lang.Object ctx, java.lang.Object resourceId, java.lang.Object hints)
          This method records an access intention to a data object in read mode.
 void startFc()
           
 void stopFc()
           
 void unbindFc(java.lang.String s)
           
 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 resourceId, java.lang.Object hints)
          This method records an access intention to a data object in write mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Logger logger
Constructor Detail

DbDelegateConcurrencyManager

public DbDelegateConcurrencyManager()
                             throws ConcurrencyException
Method Detail

getState

protected abstract java.lang.Object getState(java.lang.Object ctx,
                                             java.lang.Object resource,
                                             java.lang.Object thinLock)
                                      throws ConcurrencyException
Parameters:
ctx - is the context using the resource
resource - is the resource
thinLock - uses to take a thin lock
Returns:
the resource state to use
Throws:
ConcurrencyException

listFc

public java.lang.String[] listFc()

lookupFc

public java.lang.Object lookupFc(java.lang.String s)
                          throws NoSuchInterfaceException
Throws:
NoSuchInterfaceException

bindFc

public void bindFc(java.lang.String s,
                   java.lang.Object o)
            throws IllegalBindingException,
                   NoSuchInterfaceException
Throws:
IllegalBindingException
NoSuchInterfaceException

unbindFc

public void unbindFc(java.lang.String s)
              throws NoSuchInterfaceException
Throws:
NoSuchInterfaceException

getFcState

public java.lang.String getFcState()

startFc

public void startFc()
             throws IllegalLifeCycleException
Throws:
IllegalLifeCycleException

stopFc

public void stopFc()
            throws IllegalLifeCycleException
Throws:
IllegalLifeCycleException

begin

public void begin(java.lang.Object ctx)
Description copied from interface: ConcurrencyManager
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

validate

public boolean validate(java.lang.Object ctx)
Description copied from interface: ConcurrencyManager
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

finalize

public abstract void finalize(java.lang.Object ctx)
Description copied from interface: ConcurrencyManager
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

abort

public void abort(java.lang.Object ctx)
Description copied from interface: ConcurrencyManager
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

readIntention

public java.lang.Object readIntention(java.lang.Object ctx,
                                      java.lang.Object resourceId,
                                      java.lang.Object hints)
                               throws ConcurrencyException
Description copied from interface: ConcurrencyManager
This method records an access intention to a data object in read mode.

Specified by:
readIntention in interface ConcurrencyManager
Parameters:
resourceId - is the resource or it identifier (Object used for synchronization)
ctx - is an identifier of the execution context. It can be a transaction handle.
hints - 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 resourceId,
                                       java.lang.Object hints)
                                throws ConcurrencyException
Description copied from interface: ConcurrencyManager
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.

Specified by:
writeIntention in interface ConcurrencyManager
Parameters:
resourceId - is the resource or its identifier
ctx - is an identifier of the execution context. It can be a transaction handle.
hints - 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.