Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasig.portal.concurrency
Interface IEntityLock

All Known Implementing Classes:
  EntityLockImpl

    public interface IEntityLock

Defines a lock associated with an owner and a portal entity that guarantees some degree of exclusive access to the entity, depending on `lockType` and `expirationTime`. See IEntityLockService for the rules governing lock assignment and a code example.

Version:
  $Revision: 1.4 $
Author:
  Dan Ellentuck
See Also:
  `IEntityLockService`

Method Summary
`void` | `convert(int newType)` Attempts to change the `lockType` of this lock to `newType`.
`void` | `convert(int newType, int newDuration)` Attempts to change the `lockType` of this lock to `newType`.
`java.lang.String` | `getEntityKey()`
`java.lang.Class` | `getEntityType()`
`java.util.Date` | `getExpirationTime()`
`java.lang.String` | `getLockOwner()` Could be the portal user or the framework or ...?
`int` | `getLockType()` See IEntityLockingService for a description of lock types.
`boolean` | `isValid()` Answers if this lock is still good.
`void` | `release()` Invalidate the lock.
`void` | `renew()` Extends the expiration time of this lock for a service-defined period.
`void` | `renew(int duration)` Extends the expiration time of this lock for `duration` seconds.

Method Detail

### convert

    void convert(int newType)
                 throws LockingException

  Attempts to change the `lockType` of this lock to `newType`. The `expirationTime` is renewed.

  Parameters:
    `newType` - int
  Throws:
    `LockingException` - - if the conversion fails.

### convert

    void convert(int newType,
                 int newDuration)
                 throws LockingException

  Attempts to change the `lockType` of this lock to `newType`. The `expirationTime` is extended `newDuration` seconds.

  Parameters:
    `newType` - int
    `newDuration` - int
  Throws:
    `LockingException` - - if the conversion fails.

### getEntityKey

    java.lang.String getEntityKey()

  Returns:
    java.lang.String

### getEntityType

    java.lang.Class getEntityType()

  Returns:
    java.lang.Class
  See Also:
    `for known types.`

### getExpirationTime

    java.util.Date getExpirationTime()

  Returns:
    java.util.Date

### getLockOwner

    java.lang.String getLockOwner()

  Could be the portal user or the framework or ...?

  Returns:
    java.lang.String

### getLockType

    int getLockType()

  See IEntityLockingService for a description of lock types.

  Returns:
    int

### isValid

    boolean isValid()
                    throws LockingException

  Answers if this lock is still good.

  Throws:
    `LockingException`

### release

    void release()
                 throws LockingException

  Invalidate the lock.

  Throws:
    `LockingException`

### renew

    void renew()
               throws LockingException

  Extends the expiration time of this lock for a service-defined period.

  Throws:
    `LockingException`

### renew

    void renew(int duration)
               throws LockingException

  Extends the expiration time of this lock for `duration` seconds.

  Throws:
    `LockingException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD