rrdService.service
Class Lock

java.lang.Object
  |
  +--rrdService.service.Lock
All Implemented Interfaces:
LockItf

public class Lock
extends java.lang.Object
implements LockItf

The class Lock implement a lockItf for writting reading and deleting

Version:
1.0 date : 15/07/2001
key-word
shared variable
Author:
Damien Pellier
See Also:
Lock, Mutex

Field Summary
private  int cptDelete
          allow to count the number of deleting access
private  int cptRead
          allow to count the number of reading access
private  int cptWrite
          allow to count the number of writting access
static int DELETE
          DELETE constante
static int READ
          READ constante
static int WRITE
          WRITE constante
 
Fields inherited from interface rrdService.service.LockItf
READ_WRITE
 
Constructor Summary
Lock()
          Constructor of class Lock
 
Method Summary
 int getStatus()
          getStatus return the status of lock return int reprsenting the status READ_WRITE or DELETE
 boolean lockDelete()
          Lock in deleting acces return boolean true if the lock is taken
 boolean lockRead()
          Lock in reading acces return boolean true if the lock is taken
 boolean lockWrite()
          Lock in writting acces return boolean true if the lock is taken
 java.lang.String toString()
          toString return a string representation of a lock
 boolean unLockRead()
          Unlock in reading acces return boolean true if the lock is left
 boolean unLockWrite()
          Unlock in writting acces return boolean true if the lock is left
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

cptDelete

private int cptDelete
allow to count the number of deleting access

cptRead

private int cptRead
allow to count the number of reading access

cptWrite

private int cptWrite
allow to count the number of writting access

DELETE

public static final int DELETE
DELETE constante

READ

public static final int READ
READ constante

WRITE

public static final int WRITE
WRITE constante
Constructor Detail

Lock

public Lock()
Constructor of class Lock
Method Detail

getStatus

public int getStatus()
getStatus return the status of lock return int reprsenting the status READ_WRITE or DELETE
Specified by:
getStatus in interface LockItf

lockDelete

public boolean lockDelete()
                   throws java.lang.Exception
Lock in deleting acces return boolean true if the lock is taken
Specified by:
lockDelete in interface LockItf

lockRead

public boolean lockRead()
                 throws java.lang.Exception
Lock in reading acces return boolean true if the lock is taken
Specified by:
lockRead in interface LockItf

lockWrite

public boolean lockWrite()
                  throws java.lang.Exception
Lock in writting acces return boolean true if the lock is taken
Specified by:
lockWrite in interface LockItf

toString

public java.lang.String toString()
toString return a string representation of a lock
Overrides:
toString in class java.lang.Object
Returns:
a string representation of a lock

unLockRead

public boolean unLockRead()
                   throws java.lang.Exception
Unlock in reading acces return boolean true if the lock is left
Specified by:
unLockRead in interface LockItf

unLockWrite

public boolean unLockWrite()
                    throws java.lang.Exception
Unlock in writting acces return boolean true if the lock is left
Specified by:
unLockWrite in interface LockItf

Copyright 1885-2001 FIRMENICH SA, Geneva

Submit a bug or feature
Copyright 1885-2001 FIRMENICH SA, Geneva,
All Rights Reserved.